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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 23532073: Only showing the new multi user menus when there are at least 2 suitable users known to the system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years, 3 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.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/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 6975c1641d0daec9fb9739f97e3de2d5037e9355..116aee885bbbca2081516d220ac8b961d7563999 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -41,6 +41,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/login/default_pinned_apps_field_trial.h"
+#include "chrome/browser/chromeos/login/user_manager.h"
#endif
// static
@@ -111,7 +112,20 @@ ChromeShellDelegate::~ChromeShellDelegate() {
}
bool ChromeShellDelegate::IsMultiProfilesEnabled() const {
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles);
+ // TODO(skuhne): There is a function named profiles::IsMultiProfilesEnabled
+ // which does similar things - but it is not the same. We should investigate
+ // if these two could be folded together.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles))
+ return false;
+#if defined(OS_CHROMEOS)
+ // If there is a user manager, we need to see that we can at least have 2
+ // simultaneous users to allow this feature.
+ if (chromeos::UserManager::IsInitialized() &&
+ chromeos::UserManager::Get()->GetUsersAdmittedForMultiProfile().size() +
+ chromeos::UserManager::Get()->GetLoggedInUsers().size() <= 1)
+ return false;
+#endif
+ return true;
}
bool ChromeShellDelegate::IsRunningInForcedAppMode() const {
« no previous file with comments | « chrome/browser/profiles/avatar_menu_model.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698