| 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/system/chromeos/label_tray_view.h" | 8 #include "ash/system/chromeos/label_tray_view.h" |
| 9 #include "ash/system/system_notifier.h" | 9 #include "ash/system/system_notifier.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 kNotificationId)) | 44 kNotificationId)) |
| 45 CreateOrUpdateNotification(message); | 45 CreateOrUpdateNotification(message); |
| 46 } | 46 } |
| 47 | 47 |
| 48 views::View* TraySupervisedUser::CreateDefaultView( | 48 views::View* TraySupervisedUser::CreateDefaultView( |
| 49 user::LoginStatus status) { | 49 user::LoginStatus status) { |
| 50 CHECK(tray_view_ == NULL); | 50 CHECK(tray_view_ == NULL); |
| 51 if (status != ash::user::LOGGED_IN_SUPERVISED) | 51 if (status != ash::user::LOGGED_IN_SUPERVISED) |
| 52 return NULL; | 52 return NULL; |
| 53 | 53 |
| 54 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_MANAGED_USER); | 54 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_SUPERVISED_USER); |
| 55 UpdateMessage(); | 55 UpdateMessage(); |
| 56 return tray_view_; | 56 return tray_view_; |
| 57 } | 57 } |
| 58 | 58 |
| 59 void TraySupervisedUser::DestroyDefaultView() { | 59 void TraySupervisedUser::DestroyDefaultView() { |
| 60 tray_view_ = NULL; | 60 tray_view_ = NULL; |
| 61 } | 61 } |
| 62 | 62 |
| 63 void TraySupervisedUser::OnViewClicked(views::View* sender) { | 63 void TraySupervisedUser::OnViewClicked(views::View* sender) { |
| 64 Shell::GetInstance()->system_tray_delegate()->ShowSupervisedUserInfo(); | 64 Shell::GetInstance()->system_tray_delegate()->ShowSupervisedUserInfo(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 77 } | 77 } |
| 78 | 78 |
| 79 void TraySupervisedUser::CreateOrUpdateNotification( | 79 void TraySupervisedUser::CreateOrUpdateNotification( |
| 80 const base::string16& new_message) { | 80 const base::string16& new_message) { |
| 81 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 81 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
| 82 scoped_ptr<Notification> notification( | 82 scoped_ptr<Notification> notification( |
| 83 message_center::Notification::CreateSystemNotification( | 83 message_center::Notification::CreateSystemNotification( |
| 84 kNotificationId, | 84 kNotificationId, |
| 85 base::string16() /* no title */, | 85 base::string16() /* no title */, |
| 86 new_message, | 86 new_message, |
| 87 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_MANAGED_USER), | 87 bundle.GetImageNamed(IDR_AURA_UBER_TRAY_SUPERVISED_USER), |
| 88 system_notifier::kNotifierSupervisedUser, | 88 system_notifier::kNotifierSupervisedUser, |
| 89 base::Closure() /* null callback */)); | 89 base::Closure() /* null callback */)); |
| 90 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); | 90 message_center::MessageCenter::Get()->AddNotification(notification.Pass()); |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace ash | 93 } // namespace ash |
| OLD | NEW |