OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/system/chromeos/managed/tray_locally_managed_user.h" |
| 6 |
| 7 #include "ash/system/chromeos/label_tray_view.h" |
| 8 #include "ash/system/tray/system_tray_notifier.h" |
| 9 #include "ash/system/user/login_status.h" |
| 10 #include "base/logging.h" |
| 11 #include "grit/ash_resources.h" |
| 12 |
| 13 namespace ash { |
| 14 namespace internal { |
| 15 |
| 16 TrayLocallyManagedUser::TrayLocallyManagedUser(SystemTray* system_tray) |
| 17 : SystemTrayItem(system_tray), |
| 18 tray_view_(NULL) { |
| 19 } |
| 20 |
| 21 TrayLocallyManagedUser::~TrayLocallyManagedUser() { |
| 22 } |
| 23 |
| 24 void TrayLocallyManagedUser::UpdateMessage() { |
| 25 base::string16 message = Shell::GetInstance()->system_tray_delegate()-> |
| 26 GetLocallyManagedUserMessage(); |
| 27 if (tray_view_) |
| 28 tray_view_->SetMessage(message); |
| 29 } |
| 30 |
| 31 views::View* TrayLocallyManagedUser::CreateDefaultView( |
| 32 user::LoginStatus status) { |
| 33 CHECK(tray_view_ == NULL); |
| 34 if (status != ash::user::LOGGED_IN_LOCALLY_MANAGED) |
| 35 return NULL; |
| 36 |
| 37 // TODO(antrim): replace to appropriate icon when there is one. |
| 38 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE_DARK); |
| 39 UpdateMessage(); |
| 40 return tray_view_; |
| 41 } |
| 42 |
| 43 void TrayLocallyManagedUser::DestroyDefaultView() { |
| 44 tray_view_ = NULL; |
| 45 } |
| 46 |
| 47 void TrayLocallyManagedUser::OnViewClicked(views::View* sender) { |
| 48 Shell::GetInstance()->system_tray_delegate()->ShowLocallyManagedUserInfo(); |
| 49 } |
| 50 |
| 51 } // namespace internal |
| 52 } // namespace ash |
| 53 |
OLD | NEW |