Chromium Code Reviews| Index: chrome/browser/profiles/profile_manager.cc |
| diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
| index 7be5e410698770f015262982dd9329ff8a1fd1fb..9398d6cc0abcd62f544c52fbc30f7307ab6603ed 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -166,6 +166,22 @@ bool IsProfileMarkedForDeletion(const base::FilePath& profile_path) { |
| profile_path) != ProfilesToDelete().end(); |
| } |
| +void OpenBrowserWindowForProfile(bool always_create, |
| + chrome::HostDesktopType desktop_type, |
| + Profile* profile, |
| + Profile::CreateStatus status) { |
| + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| + |
| + if (status == Profile::CREATE_STATUS_INITIALIZED) { |
| + ProfileManager::FindOrCreateNewWindowForProfile( |
| + profile, |
| + chrome::startup::IS_NOT_PROCESS_STARTUP, |
| + chrome::startup::IS_NOT_FIRST_RUN, |
| + desktop_type, |
| + always_create); |
| + } |
| +} |
| + |
| #if defined(OS_CHROMEOS) |
| void CheckCryptohomeIsMounted(chromeos::DBusMethodCallStatus call_status, |
| bool is_mounted) { |
| @@ -628,6 +644,21 @@ void ProfileManager::FindOrCreateNewWindowForProfile( |
| #endif // defined(OS_IOS) |
| } |
| +// static |
| +void ProfileManager::SwitchToProfile( |
|
sail
2013/07/02 21:46:40
I don't think there's any value in having this in
noms
2013/07/03 17:11:35
The reason I moved it here is that the user choose
sail
2013/07/03 18:18:04
Adding this to profile manager is a bad idea.
The
noms
2013/07/05 17:39:27
As discussed offline, this is ok because it's only
|
| + const base::FilePath& path, |
| + chrome::HostDesktopType desktop_type, |
| + bool always_create) { |
| + g_browser_process->profile_manager()->CreateProfileAsync( |
| + path, |
| + base::Bind(&OpenBrowserWindowForProfile, |
| + always_create, |
| + desktop_type), |
| + string16(), |
| + string16(), |
| + false); |
| +} |
| + |
| void ProfileManager::Observe( |
| int type, |
| const content::NotificationSource& source, |