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

Unified Diff: chrome/browser/ui/browser_command_controller.cc

Issue 12040085: Adding show profile switcher field trial. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/profiles/avatar_menu_model_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_command_controller.cc
diff --git a/chrome/browser/ui/browser_command_controller.cc b/chrome/browser/ui/browser_command_controller.cc
index 60f0fe9512cf9fa63c1c092e6c4589bcf08870df..40daf80a136d32673d5e1c64b176e2a11baa56d7 100644
--- a/chrome/browser/ui/browser_command_controller.cc
+++ b/chrome/browser/ui/browser_command_controller.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/browser/profiles/avatar_menu_model.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sessions/tab_restore_service.h"
@@ -1178,13 +1179,12 @@ void BrowserCommandController::UpdateCommandsForFullscreenMode(
void BrowserCommandController::UpdateCommandsForMultipleProfiles() {
bool show_main_ui = IsShowingMainUI(window() && window()->IsFullscreen());
- bool has_multiple_profiles = profile_manager_ &&
- profile_manager_->GetNumberOfProfiles() > 1;
- command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU,
- show_main_ui &&
+ bool enable = show_main_ui &&
!profile()->IsOffTheRecord() &&
- ProfileManager::IsMultipleProfilesEnabled() &&
- has_multiple_profiles);
+ profile_manager_ &&
+ AvatarMenuModel::ShouldShowAvatarMenu();
+ command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU,
+ enable);
}
void BrowserCommandController::UpdatePrintingState() {
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698