| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 Quit(); | 80 Quit(); |
| 81 return; | 81 return; |
| 82 } | 82 } |
| 83 | 83 |
| 84 base::FilePath socket_path = | 84 base::FilePath socket_path = |
| 85 user_data_dir.Append(app_mode::kAppShimSocketName); | 85 user_data_dir.Append(app_mode::kAppShimSocketName); |
| 86 IPC::ChannelHandle handle(socket_path.value()); | 86 IPC::ChannelHandle handle(socket_path.value()); |
| 87 channel_ = new IPC::ChannelProxy(handle, IPC::Channel::MODE_NAMED_CLIENT, | 87 channel_ = new IPC::ChannelProxy(handle, IPC::Channel::MODE_NAMED_CLIENT, |
| 88 this, g_io_thread->message_loop_proxy()); | 88 this, g_io_thread->message_loop_proxy()); |
| 89 | 89 |
| 90 if (CommandLine::ForCurrentProcess()->HasSwitch(app_mode::kNoLaunchApp)) |
| 91 return; |
| 92 |
| 90 channel_->Send(new AppShimHostMsg_LaunchApp( | 93 channel_->Send(new AppShimHostMsg_LaunchApp( |
| 91 g_info->profile_dir.value(), g_info->app_mode_id)); | 94 g_info->profile_dir.value(), g_info->app_mode_id)); |
| 92 } | 95 } |
| 93 | 96 |
| 94 bool AppShimController::OnMessageReceived(const IPC::Message& message) { | 97 bool AppShimController::OnMessageReceived(const IPC::Message& message) { |
| 95 bool handled = true; | 98 bool handled = true; |
| 96 IPC_BEGIN_MESSAGE_MAP(AppShimController, message) | 99 IPC_BEGIN_MESSAGE_MAP(AppShimController, message) |
| 97 IPC_MESSAGE_HANDLER(AppShimMsg_LaunchApp_Done, OnLaunchAppDone) | 100 IPC_MESSAGE_HANDLER(AppShimMsg_LaunchApp_Done, OnLaunchAppDone) |
| 98 IPC_MESSAGE_UNHANDLED(handled = false) | 101 IPC_MESSAGE_UNHANDLED(handled = false) |
| 99 IPC_END_MESSAGE_MAP() | 102 IPC_END_MESSAGE_MAP() |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 // fully initialized don't receive a reply until its run loop starts. Once | 301 // fully initialized don't receive a reply until its run loop starts. Once |
| 299 // the reply is received, Chrome will have opened its IPC port, guaranteed. | 302 // the reply is received, Chrome will have opened its IPC port, guaranteed. |
| 300 [ReplyEventHandler pingProcess:psn andCall:base::Bind(&OnPingChromeReply)]; | 303 [ReplyEventHandler pingProcess:psn andCall:base::Bind(&OnPingChromeReply)]; |
| 301 | 304 |
| 302 base::MessageLoopForUI main_message_loop; | 305 base::MessageLoopForUI main_message_loop; |
| 303 main_message_loop.set_thread_name("MainThread"); | 306 main_message_loop.set_thread_name("MainThread"); |
| 304 base::PlatformThread::SetName("CrAppShimMain"); | 307 base::PlatformThread::SetName("CrAppShimMain"); |
| 305 main_message_loop.Run(); | 308 main_message_loop.Run(); |
| 306 return 0; | 309 return 0; |
| 307 } | 310 } |
| OLD | NEW |