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

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

Issue 20037002: Fix app shim focus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase Created 7 years, 5 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
« no previous file with comments | « no previous file | apps/app_shim/extension_app_shim_handler_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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 return 1; 382 return 1;
383 383
384 } else { 384 } else {
385 CommandLine command_line(CommandLine::NO_PROGRAM); 385 CommandLine command_line(CommandLine::NO_PROGRAM);
386 command_line.AppendSwitch(switches::kSilentLaunch); 386 command_line.AppendSwitch(switches::kSilentLaunch);
387 command_line.AppendSwitchPath(switches::kProfileDirectory, 387 command_line.AppendSwitchPath(switches::kProfileDirectory,
388 info->profile_dir); 388 info->profile_dir);
389 bool success = 389 bool success =
390 base::mac::OpenApplicationWithPath(info->chrome_outer_bundle_path, 390 base::mac::OpenApplicationWithPath(info->chrome_outer_bundle_path,
391 command_line, 391 command_line,
392 kLSLaunchDefaults,
392 &psn); 393 &psn);
393 if (!success) 394 if (!success)
394 return 1; 395 return 1;
395 } 396 }
396 397
397 // This code abuses the fact that Apple Events sent before the process is 398 // This code abuses the fact that Apple Events sent before the process is
398 // fully initialized don't receive a reply until its run loop starts. Once 399 // fully initialized don't receive a reply until its run loop starts. Once
399 // the reply is received, Chrome will have opened its IPC port, guaranteed. 400 // the reply is received, Chrome will have opened its IPC port, guaranteed.
400 [ReplyEventHandler pingProcess:psn andCall:base::Bind(&OnPingChromeReply)]; 401 [ReplyEventHandler pingProcess:psn andCall:base::Bind(&OnPingChromeReply)];
401 402
402 base::MessageLoopForUI main_message_loop; 403 base::MessageLoopForUI main_message_loop;
403 main_message_loop.set_thread_name("MainThread"); 404 main_message_loop.set_thread_name("MainThread");
404 base::PlatformThread::SetName("CrAppShimMain"); 405 base::PlatformThread::SetName("CrAppShimMain");
405 main_message_loop.Run(); 406 main_message_loop.Run();
406 return 0; 407 return 0;
407 } 408 }
OLDNEW
« no previous file with comments | « no previous file | apps/app_shim/extension_app_shim_handler_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698