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> |
| 8 |
7 #include "ash/shell.h" | 9 #include "ash/shell.h" |
8 #include "ash/system/chromeos/label_tray_view.h" | 10 #include "ash/system/chromeos/label_tray_view.h" |
9 #include "ash/system/system_notifier.h" | 11 #include "ash/system/system_notifier.h" |
10 #include "ash/system/tray/system_tray_delegate.h" | 12 #include "ash/system/tray/system_tray_delegate.h" |
11 #include "ash/system/tray/system_tray_notifier.h" | 13 #include "ash/system/tray/system_tray_notifier.h" |
12 #include "ash/system/tray/tray_notification_view.h" | 14 #include "ash/system/tray/tray_notification_view.h" |
13 #include "ash/system/user/login_status.h" | 15 #include "ash/system/user/login_status.h" |
14 #include "base/callback.h" | 16 #include "base/callback.h" |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
16 #include "grit/ash_resources.h" | 18 #include "grit/ash_resources.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 95 |
94 void TraySupervisedUser::CreateOrUpdateNotification( | 96 void TraySupervisedUser::CreateOrUpdateNotification( |
95 const base::string16& new_message) { | 97 const base::string16& new_message) { |
96 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 98 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
97 scoped_ptr<Notification> notification( | 99 scoped_ptr<Notification> notification( |
98 message_center::Notification::CreateSystemNotification( | 100 message_center::Notification::CreateSystemNotification( |
99 kNotificationId, base::string16() /* no title */, new_message, | 101 kNotificationId, base::string16() /* no title */, new_message, |
100 bundle.GetImageNamed(GetSupervisedUserIconId()), | 102 bundle.GetImageNamed(GetSupervisedUserIconId()), |
101 system_notifier::kNotifierSupervisedUser, | 103 system_notifier::kNotifierSupervisedUser, |
102 base::Closure() /* null callback */)); | 104 base::Closure() /* null callback */)); |
103 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 105 message_center::MessageCenter::Get()->AddNotification( |
| 106 std::move(notification)); |
104 } | 107 } |
105 | 108 |
106 void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() { | 109 void TraySupervisedUser::CreateOrUpdateSupervisedWarningNotification() { |
107 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); | 110 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); |
108 CreateOrUpdateNotification(delegate->GetSupervisedUserMessage()); | 111 CreateOrUpdateNotification(delegate->GetSupervisedUserMessage()); |
109 } | 112 } |
110 | 113 |
111 void TraySupervisedUser::OnCustodianInfoChanged() { | 114 void TraySupervisedUser::OnCustodianInfoChanged() { |
112 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); | 115 SystemTrayDelegate* delegate = Shell::GetInstance()->system_tray_delegate(); |
113 std::string manager_name = delegate->GetSupervisedUserManager(); | 116 std::string manager_name = delegate->GetSupervisedUserManager(); |
(...skipping 12 matching lines...) Expand all Loading... |
126 | 129 |
127 // Not intended to be used for non-supervised users. | 130 // Not intended to be used for non-supervised users. |
128 CHECK(delegate->IsUserSupervised()); | 131 CHECK(delegate->IsUserSupervised()); |
129 | 132 |
130 if (delegate->IsUserChild()) | 133 if (delegate->IsUserChild()) |
131 return IDR_AURA_UBER_TRAY_CHILD_USER; | 134 return IDR_AURA_UBER_TRAY_CHILD_USER; |
132 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; | 135 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; |
133 } | 136 } |
134 | 137 |
135 } // namespace ash | 138 } // namespace ash |
OLD | NEW |