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

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: Pre-review pass. 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
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);
}

Powered by Google App Engine
This is Rietveld 408576698