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 |