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

Side by Side 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, 7 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/system/chromeos/managed/tray_locally_managed_user.h"
6
7 #include "ash/system/chromeos/label_tray_view.h"
8 #include "ash/system/tray/system_tray_notifier.h"
9 #include "ash/system/user/login_status.h"
10 #include "base/logging.h"
11 #include "grit/ash_resources.h"
12
13 namespace ash {
14 namespace internal {
15
16 TrayLocallyManagedUser::TrayLocallyManagedUser(SystemTray* system_tray)
17 : SystemTrayItem(system_tray),
18 tray_view_(NULL) {
19 }
20
21 TrayLocallyManagedUser::~TrayLocallyManagedUser() {
22 }
23
24 void TrayLocallyManagedUser::UpdateMessage() {
25 base::string16 message = Shell::GetInstance()->system_tray_delegate()->
26 GetLocallyManagedUserMessage();
27 if (tray_view_)
28 tray_view_->SetMessage(message);
29 }
30
31 views::View* TrayLocallyManagedUser::CreateDefaultView(
32 user::LoginStatus status) {
33 CHECK(tray_view_ == NULL);
34 if (status != ash::user::LOGGED_IN_LOCALLY_MANAGED)
35 return NULL;
36
37 // TODO(antrim): replace to appropriate icon when there is one.
38 tray_view_ = new LabelTrayView(this, IDR_AURA_UBER_TRAY_ENTERPRISE_DARK);
39 UpdateMessage();
40 return tray_view_;
41 }
42
43 void TrayLocallyManagedUser::DestroyDefaultView() {
44 tray_view_ = NULL;
45 }
46
47 void TrayLocallyManagedUser::OnViewClicked(views::View* sender) {
48 Shell::GetInstance()->system_tray_delegate()->ShowLocallyManagedUserInfo();
49 }
50
51 } // namespace internal
52 } // namespace ash
53
OLDNEW
« 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