| Index: chrome/browser/profiles/avatar_menu_model.cc
|
| diff --git a/chrome/browser/profiles/avatar_menu_model.cc b/chrome/browser/profiles/avatar_menu_model.cc
|
| index 9c5c5c80b86d43ee44f9dd90a7c7f34068e79d49..e3d5d0333b55ee9a5f847b570de54c89a8a6bdeb 100644
|
| --- a/chrome/browser/profiles/avatar_menu_model.cc
|
| +++ b/chrome/browser/profiles/avatar_menu_model.cc
|
| @@ -31,6 +31,7 @@ using content::BrowserThread;
|
| namespace {
|
|
|
| void OnProfileCreated(bool always_create,
|
| + chrome::HostDesktopType desktop_type,
|
| Profile* profile,
|
| Profile::CreateStatus status) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| @@ -40,6 +41,7 @@ void OnProfileCreated(bool always_create,
|
| profile,
|
| chrome::startup::IS_NOT_PROCESS_STARTUP,
|
| chrome::startup::IS_NOT_FIRST_RUN,
|
| + desktop_type,
|
| always_create);
|
| }
|
| }
|
| @@ -82,8 +84,18 @@ void AvatarMenuModel::SwitchToProfile(size_t index, bool always_create) {
|
| index == GetActiveProfileIndex());
|
| const Item& item = GetItemAt(index);
|
| FilePath path = profile_info_->GetPathOfProfileAtIndex(item.model_index);
|
| +
|
| + chrome::HostDesktopType desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE;
|
| + if (browser_) {
|
| + desktop_type = browser_->host_desktop_type();
|
| + }
|
| +
|
| g_browser_process->profile_manager()->CreateProfileAsync(
|
| - path, base::Bind(&OnProfileCreated, always_create), string16(),
|
| + path,
|
| + base::Bind(&OnProfileCreated,
|
| + always_create,
|
| + desktop_type),
|
| + string16(),
|
| string16());
|
|
|
| ProfileMetrics::LogProfileSwitchUser(ProfileMetrics::SWITCH_PROFILE_ICON);
|
| @@ -103,8 +115,13 @@ void AvatarMenuModel::EditProfile(size_t index) {
|
| }
|
|
|
| void AvatarMenuModel::AddNewProfile() {
|
| + chrome::HostDesktopType desktop_type = chrome::HOST_DESKTOP_TYPE_NATIVE;
|
| + if (browser_) {
|
| + desktop_type = browser_->host_desktop_type();
|
| + }
|
| +
|
| ProfileManager::CreateMultiProfileAsync(
|
| - string16(), string16(), ProfileManager::CreateCallback());
|
| + string16(), string16(), ProfileManager::CreateCallback(), desktop_type);
|
| ProfileMetrics::LogProfileAddNewUser(ProfileMetrics::ADD_NEW_USER_ICON);
|
| }
|
|
|
|
|