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

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: 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..d1b6c375ae189a4ad2444b1100678f2790f4afe6 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,14 @@ void TraySupervisedUser::OnCustodianInfoChanged() {
}
}
+int TraySupervisedUser::GetSupervisedUserIconId() {
oshima 2015/01/27 10:36:47 can this be const?
merkulova 2015/01/27 16:39:47 Done.
+ SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate();
+
+ if (delegate->IsUserChild())
+ return IDR_AURA_UBER_TRAY_CHILD_USER;
+ else if (delegate->IsUserSupervised())
+ return IDR_AURA_UBER_TRAY_SUPERVISED_USER;
+ return -1;
+}
+
} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698