| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/enterprise/tray_enterprise.h" | 5 #include "ash/system/chromeos/enterprise/tray_enterprise.h" |
| 6 | 6 |
| 7 #include "ash/common/login_status.h" | 7 #include "ash/common/login_status.h" |
| 8 #include "ash/common/system/tray/system_tray_delegate.h" | 8 #include "ash/common/system/tray/system_tray_delegate.h" |
| 9 #include "ash/common/system/tray/system_tray_notifier.h" |
| 9 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
| 10 #include "ash/shell.h" | |
| 11 #include "ash/system/chromeos/label_tray_view.h" | 11 #include "ash/system/chromeos/label_tray_view.h" |
| 12 #include "ash/system/tray/system_tray_notifier.h" | |
| 13 #include "base/logging.h" | 12 #include "base/logging.h" |
| 14 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 15 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
| 16 | 15 |
| 17 namespace ash { | 16 namespace ash { |
| 18 | 17 |
| 19 TrayEnterprise::TrayEnterprise(SystemTray* system_tray) | 18 TrayEnterprise::TrayEnterprise(SystemTray* system_tray) |
| 20 : SystemTrayItem(system_tray), | 19 : SystemTrayItem(system_tray), |
| 21 tray_view_(NULL) { | 20 tray_view_(NULL) { |
| 22 Shell::GetInstance()->system_tray_notifier()-> | 21 WmShell::Get()->system_tray_notifier()->AddEnterpriseDomainObserver(this); |
| 23 AddEnterpriseDomainObserver(this); | |
| 24 } | 22 } |
| 25 | 23 |
| 26 TrayEnterprise::~TrayEnterprise() { | 24 TrayEnterprise::~TrayEnterprise() { |
| 27 Shell::GetInstance()->system_tray_notifier()-> | 25 WmShell::Get()->system_tray_notifier()->RemoveEnterpriseDomainObserver(this); |
| 28 RemoveEnterpriseDomainObserver(this); | |
| 29 } | 26 } |
| 30 | 27 |
| 31 void TrayEnterprise::UpdateEnterpriseMessage() { | 28 void TrayEnterprise::UpdateEnterpriseMessage() { |
| 32 base::string16 message = | 29 base::string16 message = |
| 33 WmShell::Get()->system_tray_delegate()->GetEnterpriseMessage(); | 30 WmShell::Get()->system_tray_delegate()->GetEnterpriseMessage(); |
| 34 if (tray_view_) | 31 if (tray_view_) |
| 35 tray_view_->SetMessage(message); | 32 tray_view_->SetMessage(message); |
| 36 } | 33 } |
| 37 | 34 |
| 38 views::View* TrayEnterprise::CreateDefaultView(LoginStatus status) { | 35 views::View* TrayEnterprise::CreateDefaultView(LoginStatus status) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 52 | 49 |
| 53 void TrayEnterprise::OnEnterpriseDomainChanged() { | 50 void TrayEnterprise::OnEnterpriseDomainChanged() { |
| 54 UpdateEnterpriseMessage(); | 51 UpdateEnterpriseMessage(); |
| 55 } | 52 } |
| 56 | 53 |
| 57 void TrayEnterprise::OnViewClicked(views::View* sender) { | 54 void TrayEnterprise::OnViewClicked(views::View* sender) { |
| 58 WmShell::Get()->system_tray_delegate()->ShowEnterpriseInfo(); | 55 WmShell::Get()->system_tray_delegate()->ShowEnterpriseInfo(); |
| 59 } | 56 } |
| 60 | 57 |
| 61 } // namespace ash | 58 } // namespace ash |
| OLD | NEW |