Chromium Code Reviews| 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 |