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