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..a00cb42d08df63cce57dcff9adac79d9008cff0f 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()) |
|
dzhioev (left Google)
2015/01/27 19:33:26
Does GetIsUserChild imply IsUserSupervised?
merkulova
2015/01/28 15:10:54
Yes.
|
| 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() const { |
| + 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; |
|
dzhioev (left Google)
2015/01/27 19:33:27
I think we need CHECK here.
merkulova
2015/01/28 15:10:54
Done.
|
| +} |
| + |
| } // namespace ash |