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

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

Issue 637533002: Added calls for deferred supervised user status change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/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 44856326681b1967365d114fdaa143bbe76b4ff1..7bee8bf6ef4cd8e9c2d35770d2d5d894dc312583 100644
--- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
+++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc
@@ -193,6 +193,7 @@ SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
have_session_start_time_(false),
have_session_length_limit_(false),
should_run_bluetooth_discovery_(false),
+ session_started_(false),
Daniel Erat 2014/10/07 16:19:19 do you need to check whether a session is already
merkulova 2014/10/08 09:47:11 I'm using this flag to prevent early UpdateAfterLo
volume_control_delegate_(new VolumeController()),
device_settings_observer_(CrosSettings::Get()->AddSettingsObserver(
kSystemUse24HourClock,
@@ -225,6 +226,8 @@ SystemTrayDelegateChromeOS::SystemTrayDelegateChromeOS()
accessibility_subscription_ = accessibility_manager->RegisterCallback(
base::Bind(&SystemTrayDelegateChromeOS::OnAccessibilityStatusChanged,
base::Unretained(this)));
+
+ user_manager::UserManager::Get()->AddSessionStateObserver(this);
}
void SystemTrayDelegateChromeOS::Initialize() {
@@ -316,6 +319,8 @@ SystemTrayDelegateChromeOS::~SystemTrayDelegateChromeOS() {
connector->GetDeviceCloudPolicyManager();
if (policy_manager)
policy_manager->core()->store()->RemoveObserver(this);
+
+ user_manager::UserManager::Get()->RemoveSessionStateObserver(this);
}
// Overridden from ash::SystemTrayDelegate:
@@ -859,6 +864,17 @@ SystemTrayDelegateChromeOS::GetUserAccountsDelegate(
return accounts_delegates_.get(user_id);
}
+void SystemTrayDelegateChromeOS::UserChangedSupervisedStatus(
+ user_manager::User* user) {
+ Profile* user_profile = ProfileHelper::Get()->GetProfileByUser(user);
+ DCHECK(user_profile);
+
+ if (session_started_ && user_profile_ == user_profile) {
+ ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(
+ GetUserLoginStatus());
+ }
+}
+
ash::SystemTray* SystemTrayDelegateChromeOS::GetPrimarySystemTray() {
return ash::Shell::GetInstance()->GetPrimarySystemTray();
}
@@ -1118,6 +1134,7 @@ void SystemTrayDelegateChromeOS::Observe(
break;
}
case chrome::NOTIFICATION_SESSION_STARTED: {
+ session_started_ = true;
ash::Shell::GetInstance()->UpdateAfterLoginStatusChange(
GetUserLoginStatus());
SetProfile(ProfileManager::GetActiveUserProfile());

Powered by Google App Engine
This is Rietveld 408576698