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

Side by Side Diff: ash/system/enterprise/tray_enterprise.h

Issue 2839043004: chromeos: Refactor ash SystemTrayDelegate enterprise methods to mojo (Closed)
Patch Set: Created 3 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
OLDNEW
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 #ifndef ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_ 5 #ifndef ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_
6 #define ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_ 6 #define ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_
7 7
8 #include "ash/system/enterprise/enterprise_domain_observer.h" 8 #include "ash/system/enterprise/enterprise_domain_observer.h"
9 #include "ash/system/tray/system_tray_item.h" 9 #include "ash/system/tray/system_tray_item.h"
10 #include "ash/system/tray/view_click_listener.h" 10 #include "ash/system/tray/view_click_listener.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 12
13 namespace ash { 13 namespace ash {
14 class LabelTrayView; 14 class LabelTrayView;
15 class SystemTray; 15 class SystemTray;
16 16
17 // System tray item that shows a message ("This device managed by example.com")
18 // in the tray menu for enterprise enrolled devices.
17 class TrayEnterprise : public SystemTrayItem, 19 class TrayEnterprise : public SystemTrayItem,
18 public ViewClickListener, 20 public ViewClickListener,
19 public EnterpriseDomainObserver { 21 public EnterpriseDomainObserver {
20 public: 22 public:
21 explicit TrayEnterprise(SystemTray* system_tray); 23 explicit TrayEnterprise(SystemTray* system_tray);
22 ~TrayEnterprise() override; 24 ~TrayEnterprise() override;
23 25
26 LabelTrayView* tray_view() { return tray_view_; }
xiyuan 2017/04/26 19:55:12 nit: Prevailing style is to put inline accessors a
James Cook 2017/04/26 21:04:15 Done.
27
24 // If message is not empty updates content of default view, otherwise hides 28 // If message is not empty updates content of default view, otherwise hides
25 // tray items. 29 // tray items.
26 void UpdateEnterpriseMessage(); 30 void UpdateEnterpriseMessage();
27 31
28 // Overridden from SystemTrayItem. 32 // Overridden from SystemTrayItem.
29 views::View* CreateDefaultView(LoginStatus status) override; 33 views::View* CreateDefaultView(LoginStatus status) override;
30 void DestroyDefaultView() override; 34 void DestroyDefaultView() override;
31 35
32 // Overridden from EnterpriseDomainObserver. 36 // Overridden from EnterpriseDomainObserver.
33 void OnEnterpriseDomainChanged() override; 37 void OnEnterpriseDomainChanged() override;
34 38
35 // Overridden from ViewClickListener. 39 // Overridden from ViewClickListener.
36 void OnViewClicked(views::View* sender) override; 40 void OnViewClicked(views::View* sender) override;
37 41
38 private: 42 private:
39 LabelTrayView* tray_view_; 43 LabelTrayView* tray_view_;
40 44
41 DISALLOW_COPY_AND_ASSIGN(TrayEnterprise); 45 DISALLOW_COPY_AND_ASSIGN(TrayEnterprise);
42 }; 46 };
43 47
44 } // namespace ash 48 } // namespace ash
45 49
46 #endif // ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_ 50 #endif // ASH_SYSTEM_ENTERPRISE_TRAY_ENTERPRISE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698