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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator.cc

Issue 500333002: Respect --profile-directory flag when used with --show-app-list flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/startup/startup_browser_creator.h" 5 #include "chrome/browser/ui/startup/startup_browser_creator.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 #include <set> 8 #include <set>
9 9
10 #include "apps/app_load_service.h" 10 #include "apps/app_load_service.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 return profile_launch_observer.Get().activated_profile(); 721 return profile_launch_observer.Get().activated_profile();
722 } 722 }
723 723
724 bool HasPendingUncleanExit(Profile* profile) { 724 bool HasPendingUncleanExit(Profile* profile) {
725 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED && 725 return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
726 !profile_launch_observer.Get().HasBeenLaunched(profile); 726 !profile_launch_observer.Get().HasBeenLaunched(profile);
727 } 727 }
728 728
729 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir, 729 base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
730 const CommandLine& command_line) { 730 const CommandLine& command_line) {
731 if (command_line.HasSwitch(switches::kProfileDirectory)) {
732 return user_data_dir.Append(
733 command_line.GetSwitchValuePath(switches::kProfileDirectory));
734 }
735
731 // If we are showing the app list then chrome isn't shown so load the app 736 // If we are showing the app list then chrome isn't shown so load the app
732 // list's profile rather than chrome's. 737 // list's profile rather than chrome's.
733 if (command_line.HasSwitch(switches::kShowAppList)) { 738 if (command_line.HasSwitch(switches::kShowAppList)) {
734 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)-> 739 return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
735 GetProfilePath(user_data_dir); 740 GetProfilePath(user_data_dir);
736 } 741 }
737 742
738 if (command_line.HasSwitch(switches::kProfileDirectory)) {
739 return user_data_dir.Append(
740 command_line.GetSwitchValuePath(switches::kProfileDirectory));
741 }
742
743 return g_browser_process->profile_manager()->GetLastUsedProfileDir( 743 return g_browser_process->profile_manager()->GetLastUsedProfileDir(
744 user_data_dir); 744 user_data_dir);
745 } 745 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698