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

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

Issue 127343004: Avoid loading the last used browser profile in app_controller_mac when it's not needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android link error (-> kProfileLastUsed setter is #ifdefed out in profile_manager.cc) Created 6 years, 11 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 | chrome/browser/app_controller_mac.mm » ('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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 AppShimController controller; 598 AppShimController controller;
599 base::MessageLoopForUI main_message_loop; 599 base::MessageLoopForUI main_message_loop;
600 main_message_loop.set_thread_name("MainThread"); 600 main_message_loop.set_thread_name("MainThread");
601 base::PlatformThread::SetName("CrAppShimMain"); 601 base::PlatformThread::SetName("CrAppShimMain");
602 602
603 if (pid == -1) { 603 if (pid == -1) {
604 // Launch Chrome if it isn't already running. 604 // Launch Chrome if it isn't already running.
605 ProcessSerialNumber psn; 605 ProcessSerialNumber psn;
606 CommandLine command_line(CommandLine::NO_PROGRAM); 606 CommandLine command_line(CommandLine::NO_PROGRAM);
607 command_line.AppendSwitch(switches::kSilentLaunch); 607 command_line.AppendSwitch(switches::kSilentLaunch);
608 command_line.AppendSwitchPath(switches::kProfileDirectory, 608
609 info->profile_dir); 609 // If the shim is the app launcher, pass --show-app-list when starting a new
610 // Chrome process to inform startup codepaths and load the correct profile.
611 if (info->app_mode_id == app_mode::kAppListModeId) {
612 command_line.AppendSwitch(switches::kShowAppList);
613 } else {
614 command_line.AppendSwitchPath(switches::kProfileDirectory,
615 info->profile_dir);
616 }
617
610 bool success = 618 bool success =
611 base::mac::OpenApplicationWithPath(base::mac::OuterBundlePath(), 619 base::mac::OpenApplicationWithPath(base::mac::OuterBundlePath(),
612 command_line, 620 command_line,
613 kLSLaunchDefaults, 621 kLSLaunchDefaults,
614 &psn); 622 &psn);
615 if (!success) 623 if (!success)
616 return 1; 624 return 1;
617 625
618 base::Callback<void(bool)> on_ping_chrome_reply = 626 base::Callback<void(bool)> on_ping_chrome_reply =
619 base::Bind(&AppShimController::OnPingChromeReply, 627 base::Bind(&AppShimController::OnPingChromeReply,
(...skipping 17 matching lines...) Expand all
637 // minute. 645 // minute.
638 main_message_loop.PostTask( 646 main_message_loop.PostTask(
639 FROM_HERE, 647 FROM_HERE,
640 base::Bind(&AppShimController::Init, 648 base::Bind(&AppShimController::Init,
641 base::Unretained(&controller))); 649 base::Unretained(&controller)));
642 } 650 }
643 651
644 main_message_loop.Run(); 652 main_message_loop.Run();
645 return 0; 653 return 0;
646 } 654 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698