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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 app_mode::VerifySocketPermissions(socket_path); | 206 app_mode::VerifySocketPermissions(socket_path); |
207 | 207 |
208 CreateChannelAndSendLaunchApp(socket_path); | 208 CreateChannelAndSendLaunchApp(socket_path); |
209 } | 209 } |
210 | 210 |
211 void AppShimController::CreateChannelAndSendLaunchApp( | 211 void AppShimController::CreateChannelAndSendLaunchApp( |
212 const base::FilePath& socket_path) { | 212 const base::FilePath& socket_path) { |
213 IPC::ChannelHandle handle(socket_path.value()); | 213 IPC::ChannelHandle handle(socket_path.value()); |
214 channel_ = IPC::ChannelProxy::Create(handle, | 214 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_NAMED_CLIENT, |
215 IPC::Channel::MODE_NAMED_CLIENT, | 215 this, g_io_thread->task_runner().get()); |
216 this, | |
217 g_io_thread->message_loop_proxy().get()); | |
218 | 216 |
219 bool launched_by_chrome = base::CommandLine::ForCurrentProcess()->HasSwitch( | 217 bool launched_by_chrome = base::CommandLine::ForCurrentProcess()->HasSwitch( |
220 app_mode::kLaunchedByChromeProcessId); | 218 app_mode::kLaunchedByChromeProcessId); |
221 apps::AppShimLaunchType launch_type = launched_by_chrome ? | 219 apps::AppShimLaunchType launch_type = launched_by_chrome ? |
222 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; | 220 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; |
223 | 221 |
224 [delegate_ setController:this]; | 222 [delegate_ setController:this]; |
225 | 223 |
226 std::vector<base::FilePath> files; | 224 std::vector<base::FilePath> files; |
227 [delegate_ getFilesToOpenAtStartup:&files]; | 225 [delegate_ getFilesToOpenAtStartup:&files]; |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
693 // minute. | 691 // minute. |
694 main_message_loop.PostTask( | 692 main_message_loop.PostTask( |
695 FROM_HERE, | 693 FROM_HERE, |
696 base::Bind(&AppShimController::Init, | 694 base::Bind(&AppShimController::Init, |
697 base::Unretained(&controller))); | 695 base::Unretained(&controller))); |
698 } | 696 } |
699 | 697 |
700 main_message_loop.Run(); | 698 main_message_loop.Run(); |
701 return 0; | 699 return 0; |
702 } | 700 } |
OLD | NEW |