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

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

Issue 871373011: Child accounts icons added to Chrome OS notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pngs compressed. Created 5 years, 11 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 53287e6f5f5ebe721e1634b4e197fa80084db698..65b748157789f5fd03f5180ab4bbb9115bc5468d 100644
--- a/ash/system/chromeos/supervised/tray_supervised_user.cc
+++ b/ash/system/chromeos/supervised/tray_supervised_user.cc
@@ -60,7 +60,7 @@ views::View* TraySupervisedUser::CreateDefaultView(
if (!delegate->IsUserSupervised())
return NULL;
- tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_SUPERVISED_USER);
+ tray_view_ = new LabelTrayView(this, GetSupervisedUserIconId());
UpdateMessage();
return tray_view_;
}
@@ -96,10 +96,8 @@ void TraySupervisedUser::CreateOrUpdateNotification(
ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance();
scoped_ptr<Notification> notification(
message_center::Notification::CreateSystemNotification(
- kNotificationId,
- base::string16() /* no title */,
- new_message,
- bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SUPERVISED_USER),
+ kNotificationId, base::string16() /* no title */, new_message,
+ bundle.GetImageNamed(GetSupervisedUserIconId()),
system_notifier::kNotifierSupervisedUser,
base::Closure() /* null callback */));
message_center::MessageCenter::Get()->AddNotification(notification.Pass());
@@ -123,4 +121,15 @@ void TraySupervisedUser::OnCustodianInfoChanged() {
}
}
+int TraySupervisedUser::GetSupervisedUserIconId() const {
+ SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+
+ // Not intended to be used for non-supervised users.
+ CHECK(delegate->IsUserSupervised());
+
+ if (delegate->IsUserChild())
+ return IDR_AURA_UBER_TRAY_CHILD_USER;
+ return IDR_AURA_UBER_TRAY_SUPERVISED_USER;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698