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 19f2279885a975149db650e981332b70d70c6cfc..8cbc3a269acdc95b847b7dcaad73c26cffa938a6 100644 |
| --- a/chrome/browser/profiles/profile_manager.cc |
| +++ b/chrome/browser/profiles/profile_manager.cc |
| @@ -165,6 +165,22 @@ void QueueProfileDirectoryForDeletion(const base::FilePath& path) { |
| ProfilesToDelete().push_back(path); |
| } |
| +void OpenBrowserWindowForProfile(bool always_create, |
| + chrome::HostDesktopType desktop_type, |
|
Nikita (slow)
2013/06/11 18:22:16
nit: parameters need to be aligned
noms
2013/06/12 20:41:54
Done.
|
| + 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,22 @@ void ProfileManager::FindOrCreateNewWindowForProfile( |
| #endif // defined(OS_IOS) |
| } |
| +// static |
| +void ProfileManager::SwitchToProfile( |
| + const base::FilePath& path, |
| + chrome::HostDesktopType desktop_type, |
| + bool always_create) { |
| + |
|
Nikita (slow)
2013/06/11 18:22:16
nit: drop empty line
noms
2013/06/12 20:41:54
Done.
|
| + 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, |