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

Unified Diff: chrome/browser/ui/startup/startup_browser_creator.cc

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/startup/startup_browser_creator.cc
diff --git a/chrome/browser/ui/startup/startup_browser_creator.cc b/chrome/browser/ui/startup/startup_browser_creator.cc
index 7fe31ffa49c4f0260fc7f7a29c7feaa3ebecc152..c5663e12484a50bbfeea08960ef0e2ddd6d953d1 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -47,6 +47,7 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/search_engines/util.h"
+#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/browser_finder.h"
@@ -794,3 +795,21 @@ bool HasPendingUncleanExit(Profile* profile) {
return profile->GetLastSessionExitType() == Profile::EXIT_CRASHED &&
!profile_launch_observer.Get().HasBeenLaunched(profile);
}
+
+base::FilePath GetStartupProfilePath(const base::FilePath& user_data_dir,
+ const CommandLine& command_line) {
+ // If we are showing the app list then chrome isn't shown so load the app
+ // list's profile rather than chrome's.
+ if (command_line.HasSwitch(switches::kShowAppList)) {
+ return AppListService::Get(chrome::HOST_DESKTOP_TYPE_NATIVE)->
+ GetProfilePath(user_data_dir);
+ }
+
+ if (command_line.HasSwitch(switches::kProfileDirectory)) {
+ return user_data_dir.Append(
+ command_line.GetSwitchValuePath(switches::kProfileDirectory));
+ }
+
+ return g_browser_process->profile_manager()->GetLastUsedProfileDir(
+ user_data_dir);
+}
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698