| 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..4662a766ebee165770e1581118a75622be8cb12c 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,
|
| + 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(
|
| + 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,
|
|
|