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

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: 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..d8685f993a84f6c8005b6ab92d41104faa36ce06 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -63,6 +63,9 @@ using views::TrayBubbleView;
namespace ash {
+// The maximum number of simultaneous user profiles.
+const int kMaxSimultaneousUserProfiles = 3;
+
// The minimum width of the system tray menu width.
const int kMinimumSystemTrayMenuWidth = 300;
@@ -138,7 +141,14 @@ 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.
+ // The additional entry is used for a double separator.
+ int maximum_user_profiles =
+ ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled() ?
+ (kMaxSimultaneousUserProfiles + 1): 1;
+ 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