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

Unified Diff: ash/system/tray/system_tray.cc

Issue 14756019: Adding new user menu section to the SystemTrayMenu & refactoring of user access (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 7 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: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 8dc0fa4bc83b3b0301e67f0900ca16738bf451cf..4602271ef299ec6293f309af1a5434009f1cf693 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -138,7 +138,17 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
#if !defined(OS_WIN)
AddTrayItem(new internal::TraySessionLengthLimit(this));
AddTrayItem(new internal::TrayLogoutButton(this));
- AddTrayItem(new internal::TrayUser(this));
+ // In multi-profile user mode we can have multiple user tiles.
+ ash::Shell* shell = ash::Shell::GetInstance();
+ int maximum_user_profiles =
+ shell->delegate()->IsMultiProfilesEnabled() ?
+ shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers() :
+ 0;
+ // Note: We purposely use one more item then logged in users to account for
+ // the additional separator.
+ for (int i = 0; i <= maximum_user_profiles; i++)
+ AddTrayItem(new internal::TrayUser(this, i));
+
#endif
#if defined(OS_CHROMEOS)
AddTrayItem(new internal::TrayEnterprise(this));

Powered by Google App Engine
This is Rietveld 408576698