Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Unified Diff: ash/system/chromeos/managed/tray_locally_managed_user.cc

Issue 14507003: Add tray warning for Locally managed users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win-aura compile error Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/chromeos/managed/tray_locally_managed_user.h ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/managed/tray_locally_managed_user.cc
diff --git a/ash/system/chromeos/managed/tray_locally_managed_user.cc b/ash/system/chromeos/managed/tray_locally_managed_user.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b610f5b6e1b7e0d1d9ead6e7d4f6825e29a096cf
--- /dev/null
+++ b/ash/system/chromeos/managed/tray_locally_managed_user.cc
@@ -0,0 +1,53 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ash/system/chromeos/managed/tray_locally_managed_user.h"
+
+#include "ash/system/chromeos/label_tray_view.h"
+#include "ash/system/tray/system_tray_notifier.h"
+#include "ash/system/user/login_status.h"
+#include "base/logging.h"
+#include "grit/ash_resources.h"
+
+namespace ash {
+namespace internal {
+
+TrayLocallyManagedUser::TrayLocallyManagedUser(SystemTray* system_tray)
+ : SystemTrayItem(system_tray),
+ tray_view_(NULL) {
+}
+
+TrayLocallyManagedUser::~TrayLocallyManagedUser() {
+}
+
+void TrayLocallyManagedUser::UpdateMessage() {
+ base::string16 message = Shell::GetInstance()->system_tray_delegate()->
+ GetLocallyManagedUserMessage();
+ if (tray_view_)
+ tray_view_->SetMessage(message);
+}
+
+views::View* TrayLocallyManagedUser::CreateDefaultView(
+ user::LoginStatus status) {
+ CHECK(tray_view_ == NULL);
+ if (status != ash::user::LOGGED_IN_LOCALLY_MANAGED)
+ return NULL;
+
+ // TODO(antrim): replace to appropriate icon when there is one.
+ tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE_DARK);
+ UpdateMessage();
+ return tray_view_;
+}
+
+void TrayLocallyManagedUser::DestroyDefaultView() {
+ tray_view_ = NULL;
+}
+
+void TrayLocallyManagedUser::OnViewClicked(views::View* sender) {
+ Shell::GetInstance()->system_tray_delegate()->ShowLocallyManagedUserInfo();
+}
+
+} // namespace internal
+} // namespace ash
+
« no previous file with comments | « ash/system/chromeos/managed/tray_locally_managed_user.h ('k') | ash/system/tray/system_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698