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/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/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 RemoveEnterpriseDomainObserver(this); | 27 RemoveEnterpriseDomainObserver(this); |
28 } | 28 } |
29 | 29 |
30 void TrayEnterprise::UpdateEnterpriseMessage() { | 30 void TrayEnterprise::UpdateEnterpriseMessage() { |
31 base::string16 message = Shell::GetInstance()->system_tray_delegate()-> | 31 base::string16 message = Shell::GetInstance()->system_tray_delegate()-> |
32 GetEnterpriseMessage(); | 32 GetEnterpriseMessage(); |
33 if (tray_view_) | 33 if (tray_view_) |
34 tray_view_->SetMessage(message); | 34 tray_view_->SetMessage(message); |
35 } | 35 } |
36 | 36 |
37 views::View* TrayEnterprise::CreateDefaultView(user::LoginStatus status) { | 37 views::View* TrayEnterprise::CreateDefaultView(LoginStatus status) { |
38 CHECK(tray_view_ == NULL); | 38 CHECK(tray_view_ == NULL); |
39 // For public accounts, enterprise ownership is indicated in the user details | 39 // For public accounts, enterprise ownership is indicated in the user details |
40 // instead. | 40 // instead. |
41 if (status == ash::user::LOGGED_IN_PUBLIC) | 41 if (status == LoginStatus::PUBLIC) |
42 return NULL; | 42 return NULL; |
43 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE); | 43 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE); |
44 UpdateEnterpriseMessage(); | 44 UpdateEnterpriseMessage(); |
45 return tray_view_; | 45 return tray_view_; |
46 } | 46 } |
47 | 47 |
48 void TrayEnterprise::DestroyDefaultView() { | 48 void TrayEnterprise::DestroyDefaultView() { |
49 tray_view_ = NULL; | 49 tray_view_ = NULL; |
50 } | 50 } |
51 | 51 |
52 void TrayEnterprise::OnEnterpriseDomainChanged() { | 52 void TrayEnterprise::OnEnterpriseDomainChanged() { |
53 UpdateEnterpriseMessage(); | 53 UpdateEnterpriseMessage(); |
54 } | 54 } |
55 | 55 |
56 void TrayEnterprise::OnViewClicked(views::View* sender) { | 56 void TrayEnterprise::OnViewClicked(views::View* sender) { |
57 Shell::GetInstance()->system_tray_delegate()->ShowEnterpriseInfo(); | 57 Shell::GetInstance()->system_tray_delegate()->ShowEnterpriseInfo(); |
58 } | 58 } |
59 | 59 |
60 } // namespace ash | 60 } // namespace ash |
OLD | NEW |