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