OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/chromeos/supervised/tray_supervised_user.h" | 5 #include "ash/system/chromeos/supervised/tray_supervised_user.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/chromeos/label_tray_view.h" | 10 #include "ash/system/chromeos/label_tray_view.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 !delegate->GetSupervisedUserManager().empty()) | 89 !delegate->GetSupervisedUserManager().empty()) |
90 CreateOrUpdateSupervisedWarningNotification(); | 90 CreateOrUpdateSupervisedWarningNotification(); |
91 | 91 |
92 status_ = status; | 92 status_ = status; |
93 is_user_supervised_ = is_user_supervised; | 93 is_user_supervised_ = is_user_supervised; |
94 } | 94 } |
95 | 95 |
96 void TraySupervisedUser::CreateOrUpdateNotification( | 96 void TraySupervisedUser::CreateOrUpdateNotification( |
97 const base::string16& new_message) { | 97 const base::string16& new_message) { |
98 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 98 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
99 scoped_ptr<Notification> notification( | 99 std::unique_ptr<Notification> notification( |
100 message_center::Notification::CreateSystemNotification( | 100 message_center::Notification::CreateSystemNotification( |
101 kNotificationId, base::string16() /* no title */, new_message, | 101 kNotificationId, base::string16() /* no title */, new_message, |
102 bundle.GetImageNamed(GetSupervisedUserIconId()), | 102 bundle.GetImageNamed(GetSupervisedUserIconId()), |
103 system_notifier::kNotifierSupervisedUser, | 103 system_notifier::kNotifierSupervisedUser, |
104 base::Closure() /* null callback */)); | 104 base::Closure() /* null callback */)); |
105 message_center::MessageCenter::Get()->AddNotification( | 105 message_center::MessageCenter::Get()->AddNotification( |
106 std::move(notification)); | 106 std::move(notification)); |
107 } | 107 } |
108 | 108 |
109 void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() { | 109 void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() { |
(...skipping 19 matching lines...) Expand all Loading... |
129 | 129 |
130 // Not intended to be used for non-supervised users. | 130 // Not intended to be used for non-supervised users. |
131 CHECK(delegate->IsUserSupervised()); | 131 CHECK(delegate->IsUserSupervised()); |
132 | 132 |
133 if (delegate->IsUserChild()) | 133 if (delegate->IsUserChild()) |
134 return IDR_AURA_UBER_TRAY_CHILD_USER; | 134 return IDR_AURA_UBER_TRAY_CHILD_USER; |
135 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; | 135 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; |
136 } | 136 } |
137 | 137 |
138 } // namespace ash | 138 } // namespace ash |
OLD | NEW |