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/common/login_status.h" | 9 #include "ash/common/login_status.h" |
10 #include "ash/common/system/system_notifier.h" | 10 #include "ash/common/system/system_notifier.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 if (system_tray_delegate) | 42 if (system_tray_delegate) |
43 system_tray_delegate->RemoveCustodianInfoTrayObserver(this); | 43 system_tray_delegate->RemoveCustodianInfoTrayObserver(this); |
44 } | 44 } |
45 | 45 |
46 void TraySupervisedUser::UpdateMessage() { | 46 void TraySupervisedUser::UpdateMessage() { |
47 base::string16 message = | 47 base::string16 message = |
48 WmShell::Get()->system_tray_delegate()->GetSupervisedUserMessage(); | 48 WmShell::Get()->system_tray_delegate()->GetSupervisedUserMessage(); |
49 if (tray_view_) | 49 if (tray_view_) |
50 tray_view_->SetMessage(message); | 50 tray_view_->SetMessage(message); |
51 if (message_center::MessageCenter::Get()->FindVisibleNotificationById( | 51 if (message_center::MessageCenter::Get()->FindVisibleNotificationById( |
52 kNotificationId)) | 52 kNotificationId)) |
53 CreateOrUpdateNotification(message); | 53 CreateOrUpdateNotification(message); |
54 } | 54 } |
55 | 55 |
56 views::View* TraySupervisedUser::CreateDefaultView(LoginStatus status) { | 56 views::View* TraySupervisedUser::CreateDefaultView(LoginStatus status) { |
57 CHECK(tray_view_ == NULL); | 57 CHECK(tray_view_ == NULL); |
58 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | 58 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); |
59 if (!delegate->IsUserSupervised()) | 59 if (!delegate->IsUserSupervised()) |
60 return NULL; | 60 return NULL; |
61 | 61 |
62 tray_view_ = new LabelTrayView(this, GetSupervisedUserIconId()); | 62 tray_view_ = new LabelTrayView(this, GetSupervisedUserIconId()); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Not intended to be used for non-supervised users. | 125 // Not intended to be used for non-supervised users. |
126 CHECK(delegate->IsUserSupervised()); | 126 CHECK(delegate->IsUserSupervised()); |
127 | 127 |
128 if (delegate->IsUserChild()) | 128 if (delegate->IsUserChild()) |
129 return IDR_AURA_UBER_TRAY_CHILD_USER; | 129 return IDR_AURA_UBER_TRAY_CHILD_USER; |
130 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; | 130 return IDR_AURA_UBER_TRAY_SUPERVISED_USER; |
131 } | 131 } |
132 | 132 |
133 } // namespace ash | 133 } // namespace ash |
OLD | NEW |