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

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
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..5eff60e2f310675e995c7aedaf48b0f6ebfc4733 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,11 @@ 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);
+ AvatarMenuModel::ShouldShowAvatarMenu();
+ command_updater_.UpdateCommandEnabled(IDC_SHOW_AVATAR_MENU,
+ enable);
}
void BrowserCommandController::UpdatePrintingState() {
« chrome/browser/profiles/profile_manager.cc ('K') | « chrome/browser/profiles/profile_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698