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

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

Issue 12090062: Enable profile switching for standalone App Launcher via the Settings App. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable tests on aura Created 7 years, 10 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
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 ec5571c764ac5b2bc4682450c86c0aa2c6bce73f..ed5f267241828e32995f66a8881a904c3577438b 100644
--- a/chrome/browser/ui/startup/startup_browser_creator.cc
+++ b/chrome/browser/ui/startup/startup_browser_creator.cc
@@ -640,37 +640,33 @@ bool StartupBrowserCreator::CreateAutomationProvider(
// static
void StartupBrowserCreator::ProcessCommandLineOnProfileCreated(
- const CommandLine& cmd_line,
+ const CommandLine& command_line,
const FilePath& cur_dir,
Profile* profile,
Profile::CreateStatus status) {
if (status == Profile::CREATE_STATUS_INITIALIZED)
- ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL,
+ ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL,
NULL);
}
// static
void StartupBrowserCreator::ProcessCommandLineAlreadyRunning(
- const CommandLine& cmd_line,
- const FilePath& cur_dir) {
- if (cmd_line.HasSwitch(switches::kProfileDirectory)) {
- ProfileManager* profile_manager = g_browser_process->profile_manager();
- FilePath path = cmd_line.GetSwitchValuePath(switches::kProfileDirectory);
- path = profile_manager->user_data_dir().Append(path);
- profile_manager->CreateProfileAsync(path,
- base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated,
- cmd_line, cur_dir), string16(), string16(), false);
- return;
- }
+ const CommandLine& command_line,
+ const FilePath& cur_dir,
+ const FilePath& profile_path) {
+ ProfileManager* profile_manager = g_browser_process->profile_manager();
+ Profile* profile = profile_manager->GetProfileByPath(profile_path);
- Profile* profile = ProfileManager::GetLastUsedProfile();
+ // The profile isn't loaded yet and so needs to be loaded asynchronously.
if (!profile) {
- // We should only be able to get here if the profile already exists and
- // has been created.
- NOTREACHED();
+ profile_manager->CreateProfileAsync(profile_path,
+ base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated,
+ command_line, cur_dir), string16(), string16(), false);
return;
}
- ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL);
+
+ ProcessCmdLineImpl(command_line, cur_dir, false, profile, Profiles(), NULL,
+ NULL);
}
// static
« no previous file with comments | « chrome/browser/ui/startup/startup_browser_creator.h ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698