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

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

Issue 1184523003: attachment broker wip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comments. Created 5 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/apps/app_shim/app_shim_host_mac.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 15 matching lines...) Expand all
26 #include "base/message_loop/message_loop.h" 26 #include "base/message_loop/message_loop.h"
27 #include "base/strings/string_number_conversions.h" 27 #include "base/strings/string_number_conversions.h"
28 #include "base/strings/sys_string_conversions.h" 28 #include "base/strings/sys_string_conversions.h"
29 #include "base/threading/thread.h" 29 #include "base/threading/thread.h"
30 #include "chrome/common/chrome_constants.h" 30 #include "chrome/common/chrome_constants.h"
31 #include "chrome/common/chrome_paths.h" 31 #include "chrome/common/chrome_paths.h"
32 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
33 #include "chrome/common/mac/app_mode_common.h" 33 #include "chrome/common/mac/app_mode_common.h"
34 #include "chrome/common/mac/app_shim_messages.h" 34 #include "chrome/common/mac/app_shim_messages.h"
35 #include "chrome/grit/generated_resources.h" 35 #include "chrome/grit/generated_resources.h"
36 #include "content/public/common/child_process_host.h"
36 #include "ipc/ipc_channel_proxy.h" 37 #include "ipc/ipc_channel_proxy.h"
37 #include "ipc/ipc_listener.h" 38 #include "ipc/ipc_listener.h"
38 #include "ipc/ipc_message.h" 39 #include "ipc/ipc_message.h"
39 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
40 #include "ui/base/resource/resource_bundle.h" 41 #include "ui/base/resource/resource_bundle.h"
41 42
42 namespace { 43 namespace {
43 44
44 // Timeout in seconds to wait for a reply for the initial Apple Event. Note that 45 // Timeout in seconds to wait for a reply for the initial Apple Event. Note that
45 // kAEDefaultTimeout on Mac is "about one minute" according to Apple's 46 // kAEDefaultTimeout on Mac is "about one minute" according to Apple's
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 205 }
205 206
206 app_mode::VerifySocketPermissions(socket_path); 207 app_mode::VerifySocketPermissions(socket_path);
207 208
208 CreateChannelAndSendLaunchApp(socket_path); 209 CreateChannelAndSendLaunchApp(socket_path);
209 } 210 }
210 211
211 void AppShimController::CreateChannelAndSendLaunchApp( 212 void AppShimController::CreateChannelAndSendLaunchApp(
212 const base::FilePath& socket_path) { 213 const base::FilePath& socket_path) {
213 IPC::ChannelHandle handle(socket_path.value()); 214 IPC::ChannelHandle handle(socket_path.value());
214 channel_ = IPC::ChannelProxy::Create(handle, IPC::Channel::MODE_NAMED_CLIENT, 215 channel_ = IPC::ChannelProxy::Create(
215 this, g_io_thread->task_runner().get()); 216 handle, IPC::Channel::MODE_NAMED_CLIENT, this,
217 g_io_thread->task_runner().get(),
218 content::ChildProcessHost::GetAttachmentBroker());
216 219
217 bool launched_by_chrome = base::CommandLine::ForCurrentProcess()->HasSwitch( 220 bool launched_by_chrome = base::CommandLine::ForCurrentProcess()->HasSwitch(
218 app_mode::kLaunchedByChromeProcessId); 221 app_mode::kLaunchedByChromeProcessId);
219 apps::AppShimLaunchType launch_type = launched_by_chrome ? 222 apps::AppShimLaunchType launch_type = launched_by_chrome ?
220 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL; 223 apps::APP_SHIM_LAUNCH_REGISTER_ONLY : apps::APP_SHIM_LAUNCH_NORMAL;
221 224
222 [delegate_ setController:this]; 225 [delegate_ setController:this];
223 226
224 std::vector<base::FilePath> files; 227 std::vector<base::FilePath> files;
225 [delegate_ getFilesToOpenAtStartup:&files]; 228 [delegate_ getFilesToOpenAtStartup:&files];
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 // minute. 694 // minute.
692 main_message_loop.PostTask( 695 main_message_loop.PostTask(
693 FROM_HERE, 696 FROM_HERE,
694 base::Bind(&AppShimController::Init, 697 base::Bind(&AppShimController::Init,
695 base::Unretained(&controller))); 698 base::Unretained(&controller)));
696 } 699 }
697 700
698 main_message_loop.Run(); 701 main_message_loop.Run();
699 return 0; 702 return 0;
700 } 703 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/apps/app_shim/app_shim_host_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698