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

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

Issue 2829813002: cros: Move IsUserSupervised and IsUserChild off SystemTrayDelegate (Closed)
Patch Set: review comments Created 3 years, 8 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/ui/ash/system_tray_delegate_chromeos.h ('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/system_tray_delegate_chromeos.cc
diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
index b176b964197d999c0d84c4cf30014c9de291d1dc..edbf0cc91a3e3041361e784ff3236c0f87cc8fff 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -113,6 +113,11 @@ bool IsSessionInSecondaryLoginScreen() {
return session_manager::SessionManager::Get()->IsInSecondaryLoginScreen();
}
+bool IsUserSupervised() {
+ user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser();
+ return user && user->IsSupervised();
+}
+
} // namespace
SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
@@ -234,20 +239,11 @@ base::string16 SystemTrayDelegateChromeOS::GetSupervisedUserMessage()
const {
if (!IsUserSupervised())
return base::string16();
- if (IsUserChild())
+ if (user_manager::UserManager::Get()->IsLoggedInAsChildUser())
return GetChildUserMessage();
return GetLegacySupervisedUserMessage();
}
-bool SystemTrayDelegateChromeOS::IsUserSupervised() const {
- user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser();
- return user && user->IsSupervised();
-}
-
-bool SystemTrayDelegateChromeOS::IsUserChild() const {
- return user_manager::UserManager::Get()->IsLoggedInAsChildUser();
-}
-
void SystemTrayDelegateChromeOS::ShowEnterpriseInfo() {
// TODO(mash): Refactor out SessionStateDelegate and move to SystemTrayClient.
ash::LoginStatus status = GetUserLoginStatus();
@@ -695,6 +691,8 @@ SystemTrayDelegateChromeOS::GetLegacySupervisedUserMessage() const {
const base::string16
SystemTrayDelegateChromeOS::GetChildUserMessage() const {
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
+ // TODO(jamescook): If supervised users are always enabled on Chrome OS then
+ // these ifdefs can be removed.
SupervisedUserService* service =
SupervisedUserServiceFactory::GetForProfile(user_profile_);
base::string16 first_custodian =
« no previous file with comments | « chrome/browser/ui/ash/system_tray_delegate_chromeos.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698