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

Unified Diff: ash/system/chromeos/supervised/tray_supervised_user.cc

Issue 561713002: ash: Add checks for supervised users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed child class updated. Checks improved. Created 6 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
Index: ash/system/chromeos/supervised/tray_supervised_user.cc
diff --git a/ash/system/chromeos/supervised/tray_supervised_user.cc b/ash/system/chromeos/supervised/tray_supervised_user.cc
index f85d0fe5df9d9dc4b13cfe71a090b7b8c7c429de..c57c5725d1c93166b1dad45f4910c81a7bd01fd2 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.cc
+++ b/ash/system/chromeos/supervised/tray_supervised_user.cc
@@ -29,7 +29,8 @@ const char TraySupervisedUser::kNotificationId[] =
TraySupervisedUser::TraySupervisedUser(SystemTray* system_tray)
: SystemTrayItem(system_tray),
tray_view_(NULL),
- status_(ash::user::LOGGED_IN_NONE) {
+ status_(ash::user::LOGGED_IN_NONE),
+ is_user_supervised_(false) {
}
TraySupervisedUser::~TraySupervisedUser() {
@@ -48,7 +49,9 @@ void TraySupervisedUser::UpdateMessage() {
views::View* TraySupervisedUser::CreateDefaultView(
user::LoginStatus status) {
CHECK(tray_view_ == NULL);
- if (status != ash::user::LOGGED_IN_SUPERVISED)
+ SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+ if (!(status != ash::user::LOGGED_IN_SUPERVISED ||
Marc Treib 2014/09/15 08:16:21 Should this be "==" instead of "!="?
merkulova 2014/09/18 08:51:29 Done.
+ delegate->IsUserSupervised()))
return NULL;
tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_SUPERVISED_USER);
@@ -66,14 +69,19 @@ void TraySupervisedUser::OnViewClicked(views::View* sender) {
void TraySupervisedUser::UpdateAfterLoginStatusChange(
user::LoginStatus status) {
- if (status == status_)
+ SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+
+ bool is_user_supervised = status == ash::user::LOGGED_IN_SUPERVISED ||
+ delegate->IsUserSupervised();
+ if (status == status_ && is_user_supervised == is_user_supervised_)
return;
- if (status == ash::user::LOGGED_IN_SUPERVISED &&
+
+ if (is_user_supervised &&
status_ != ash::user::LOGGED_IN_LOCKED) {
- SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
CreateOrUpdateNotification(delegate->GetSupervisedUserMessage());
}
status_ = status;
+ is_user_supervised_ = is_user_supervised;
}
void TraySupervisedUser::CreateOrUpdateNotification(

Powered by Google App Engine
This is Rietveld 408576698