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::Create(handle, |
218 new IPC::ChannelProxy(handle, | 218 IPC::Channel::MODE_NAMED_CLIENT, |
219 IPC::Channel::MODE_NAMED_CLIENT, | 219 this, |
220 this, | 220 g_io_thread->message_loop_proxy().get()); |
221 g_io_thread->message_loop_proxy().get())); | |
222 | 221 |
223 bool launched_by_chrome = | 222 bool launched_by_chrome = |
224 CommandLine::ForCurrentProcess()->HasSwitch( | 223 CommandLine::ForCurrentProcess()->HasSwitch( |
225 app_mode::kLaunchedByChromeProcessId); | 224 app_mode::kLaunchedByChromeProcessId); |
226 apps::AppShimLaunchType launch_type = launched_by_chrome ? | 225 apps::AppShimLaunchType launch_type = launched_by_chrome ? |
227 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; | 226 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; |
228 | 227 |
229 [delegate_ setController:this]; | 228 [delegate_ setController:this]; |
230 | 229 |
231 std::vector<base::FilePath> files; | 230 std::vector<base::FilePath> files; |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 // minute. | 665 // minute. |
667 main_message_loop.PostTask( | 666 main_message_loop.PostTask( |
668 FROM_HERE, | 667 FROM_HERE, |
669 base::Bind(&AppShimController::Init, | 668 base::Bind(&AppShimController::Init, |
670 base::Unretained(&controller))); | 669 base::Unretained(&controller))); |
671 } | 670 } |
672 | 671 |
673 main_message_loop.Run(); | 672 main_message_loop.Run(); |
674 return 0; | 673 return 0; |
675 } | 674 } |
OLD | NEW |