OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we | 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we |
6 // produce small app bundles which locate the Chromium framework and load it, | 6 // produce small app bundles which locate the Chromium framework and load it, |
7 // passing the appropriate data. This is the entry point into the framework for | 7 // passing the appropriate data. This is the entry point into the framework for |
8 // those app bundles. | 8 // those app bundles. |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 app_mode::VerifySocketPermissions(socket_path); | 209 app_mode::VerifySocketPermissions(socket_path); |
210 | 210 |
211 CreateChannelAndSendLaunchApp(socket_path); | 211 CreateChannelAndSendLaunchApp(socket_path); |
212 } | 212 } |
213 | 213 |
214 void AppShimController::CreateChannelAndSendLaunchApp( | 214 void AppShimController::CreateChannelAndSendLaunchApp( |
215 const base::FilePath& socket_path) { | 215 const base::FilePath& socket_path) { |
216 IPC::ChannelHandle handle(socket_path.value()); | 216 IPC::ChannelHandle handle(socket_path.value()); |
217 channel_.reset( | 217 channel_ = IPC::ChannelProxy::CreateNamedClient( |
218 new IPC::ChannelProxy(handle, | 218 handle, this, g_io_thread->message_loop_proxy().get()); |
219 IPC::Channel::MODE_NAMED_CLIENT, | |
220 this, | |
221 g_io_thread->message_loop_proxy().get())); | |
222 | 219 |
223 bool launched_by_chrome = | 220 bool launched_by_chrome = |
224 CommandLine::ForCurrentProcess()->HasSwitch( | 221 CommandLine::ForCurrentProcess()->HasSwitch( |
225 app_mode::kLaunchedByChromeProcessId); | 222 app_mode::kLaunchedByChromeProcessId); |
226 apps::AppShimLaunchType launch_type = launched_by_chrome ? | 223 apps::AppShimLaunchType launch_type = launched_by_chrome ? |
227 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; | 224 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; |
228 | 225 |
229 [delegate_ setController:this]; | 226 [delegate_ setController:this]; |
230 | 227 |
231 std::vector<base::FilePath> files; | 228 std::vector<base::FilePath> files; |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // minute. | 663 // minute. |
667 main_message_loop.PostTask( | 664 main_message_loop.PostTask( |
668 FROM_HERE, | 665 FROM_HERE, |
669 base::Bind(&AppShimController::Init, | 666 base::Bind(&AppShimController::Init, |
670 base::Unretained(&controller))); | 667 base::Unretained(&controller))); |
671 } | 668 } |
672 | 669 |
673 main_message_loop.Run(); | 670 main_message_loop.Run(); |
674 return 0; | 671 return 0; |
675 } | 672 } |
OLD | NEW |