Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: chrome/browser/profiles/avatar_menu_model.cc

Issue 10967003: Add desktop type context to most existing instances of FindTabbedBrowser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moving check_deps exception to specific_include_rules after chat with Kai. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..fdec4a36b7a1ed7ae5ea6696ce1af52acc07c627 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,17 @@ 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 +114,12 @@ 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);
}
« no previous file with comments | « chrome/browser/platform_util_chromeos.cc ('k') | chrome/browser/profiles/profile_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698