Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: chrome/app/chrome_main_app_mode_mac.mm

Issue 14579006: Start app shim when app launched. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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;
tapted 2013/05/21 08:33:25 Since we're going down this path, it still needs t
jackhou1 2013/05/28 06:50:33 Done.
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/platform_app_launcher.cc » ('j') | chrome/browser/web_applications/web_app.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698