Chromium Code Reviews| 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 712f980cc9af817df92fc667d1dba7a5d575eb2f..71ec5d9f5a2ce5aa9d8888f9c23032f1e5391403 100644 |
| --- a/chrome/browser/ui/startup/startup_browser_creator.cc |
| +++ b/chrome/browser/ui/startup/startup_browser_creator.cc |
| @@ -585,24 +585,20 @@ void StartupBrowserCreator::ProcessCommandLineOnProfileCreated( |
| // 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, |
| + const FilePath& cur_dir, |
| + const FilePath& profile_path) { |
| + ProfileManager* profile_manager = g_browser_process->profile_manager(); |
| + FilePath user_data_dir = profile_manager->user_data_dir(); |
|
benwells
2013/01/18 06:18:46
Is user_data_dir used?
koz (OOO until 15th September)
2013/01/20 23:32:00
Oops, nope. Removed.
|
| + Profile* profile = profile_manager->GetProfileByPath(profile_path); |
| + |
| + // The profile isn't loaded yet and so needs to be loaded asynchronously. |
| + if (!profile) { |
| + profile_manager->CreateProfileAsync(profile_path, |
| base::Bind(&StartupBrowserCreator::ProcessCommandLineOnProfileCreated, |
| cmd_line, cur_dir), string16(), string16(), false); |
| return; |
| } |
| - Profile* profile = ProfileManager::GetLastUsedProfile(); |
| - if (!profile) { |
| - // We should only be able to get here if the profile already exists and |
| - // has been created. |
| - NOTREACHED(); |
| - return; |
| - } |
| ProcessCmdLineImpl(cmd_line, cur_dir, false, profile, Profiles(), NULL, NULL); |
| } |