Index: ash/system/chromeos/managed/tray_locally_managed_user.cc |
diff --git a/ash/system/chromeos/enterprise/tray_enterprise.cc b/ash/system/chromeos/managed/tray_locally_managed_user.cc |
similarity index 61% |
copy from ash/system/chromeos/enterprise/tray_enterprise.cc |
copy to ash/system/chromeos/managed/tray_locally_managed_user.cc |
index b31673857a75348c9d9095f9d6da86b52a18ac77..7a535359c1384d3da06e3ff362145a110bdda41c 100644 |
--- a/ash/system/chromeos/enterprise/tray_enterprise.cc |
+++ b/ash/system/chromeos/managed/tray_locally_managed_user.cc |
@@ -2,7 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "ash/system/chromeos/enterprise/tray_enterprise.h" |
+#include "ash/system/chromeos/managed/tray_locally_managed_user.h" |
#include "ash/system/tray/hover_highlight_view.h" |
#include "ash/system/tray/system_tray_notifier.h" |
@@ -19,10 +19,10 @@ |
namespace ash { |
namespace internal { |
-class EnterpriseDefaultView : public views::View { |
+class LocallyManagedUserDefaultView : public views::View { |
Daniel Erat
2013/04/29 13:32:57
this class is almost exactly the same as Enterpris
Denis Kuznetsov (DE-MUC)
2013/04/29 14:14:58
Done.
|
public: |
- explicit EnterpriseDefaultView(ViewClickListener* click_listener); |
- virtual ~EnterpriseDefaultView(); |
+ explicit LocallyManagedUserDefaultView(ViewClickListener* click_listener); |
+ virtual ~LocallyManagedUserDefaultView(); |
void SetMessage(const base::string16& message); |
private: |
views::View* CreateChildView(const base::string16& message) const; |
@@ -30,20 +30,20 @@ class EnterpriseDefaultView : public views::View { |
ViewClickListener* click_listener_; |
base::string16 message_; |
- DISALLOW_COPY_AND_ASSIGN(EnterpriseDefaultView); |
+ DISALLOW_COPY_AND_ASSIGN(LocallyManagedUserDefaultView); |
}; |
-EnterpriseDefaultView::EnterpriseDefaultView( |
+LocallyManagedUserDefaultView::LocallyManagedUserDefaultView( |
ViewClickListener* click_listener) |
: click_listener_(click_listener) { |
SetLayoutManager(new views::FillLayout()); |
SetVisible(false); |
} |
-EnterpriseDefaultView::~EnterpriseDefaultView() { |
+LocallyManagedUserDefaultView::~LocallyManagedUserDefaultView() { |
} |
-void EnterpriseDefaultView::SetMessage(const base::string16& message) { |
+void LocallyManagedUserDefaultView::SetMessage(const base::string16& message) { |
if (message_ == message) |
return; |
@@ -57,9 +57,10 @@ void EnterpriseDefaultView::SetMessage(const base::string16& message) { |
} |
} |
-views::View* EnterpriseDefaultView::CreateChildView( |
+views::View* LocallyManagedUserDefaultView::CreateChildView( |
const base::string16& message) const { |
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
+ // TODO(antrim): replace to appropriate icon when there is one. |
const gfx::ImageSkia* icon = |
rb.GetImageSkiaNamed(IDR_AURA_UBER_TRAY_ENTERPRISE_DARK); |
HoverHighlightView* child = new HoverHighlightView(click_listener_); |
@@ -73,46 +74,37 @@ views::View* EnterpriseDefaultView::CreateChildView( |
return child; |
} |
-TrayEnterprise::TrayEnterprise(SystemTray* system_tray) |
+TrayLocallyManagedUser::TrayLocallyManagedUser(SystemTray* system_tray) |
: SystemTrayItem(system_tray), |
default_view_(NULL) { |
- Shell::GetInstance()->system_tray_notifier()-> |
- AddEnterpriseDomainObserver(this); |
} |
-TrayEnterprise::~TrayEnterprise() { |
- Shell::GetInstance()->system_tray_notifier()-> |
- RemoveEnterpriseDomainObserver(this); |
+TrayLocallyManagedUser::~TrayLocallyManagedUser() { |
} |
-void TrayEnterprise::UpdateEnterpriseMessage() { |
+void TrayLocallyManagedUser::UpdateMessage() { |
base::string16 message = Shell::GetInstance()->system_tray_delegate()-> |
- GetEnterpriseMessage(); |
+ GetLocallyManagedUserMessage(); |
if (default_view_) |
default_view_->SetMessage(message); |
} |
-views::View* TrayEnterprise::CreateDefaultView(user::LoginStatus status) { |
+views::View* TrayLocallyManagedUser::CreateDefaultView( |
+ user::LoginStatus status) { |
CHECK(default_view_ == NULL); |
- // For public accounts, enterprise ownership is indicated in the user details |
- // instead. |
- if (status == ash::user::LOGGED_IN_PUBLIC) |
+ if (status != ash::user::LOGGED_IN_LOCALLY_MANAGED) |
return NULL; |
- default_view_ = new EnterpriseDefaultView(this); |
- UpdateEnterpriseMessage(); |
+ default_view_ = new LocallyManagedUserDefaultView(this); |
+ UpdateMessage(); |
return default_view_; |
} |
-void TrayEnterprise::DestroyDefaultView() { |
+void TrayLocallyManagedUser::DestroyDefaultView() { |
default_view_ = NULL; |
} |
-void TrayEnterprise::OnEnterpriseDomainChanged() { |
- UpdateEnterpriseMessage(); |
-} |
- |
-void TrayEnterprise::OnViewClicked(views::View* sender) { |
- Shell::GetInstance()->system_tray_delegate()->ShowEnterpriseInfo(); |
+void TrayLocallyManagedUser::OnViewClicked(views::View* sender) { |
+ Shell::GetInstance()->system_tray_delegate()->ShowLocallyManagedUserInfo(); |
} |
} // namespace internal |