OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H | 5 #ifndef ASH_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H |
6 #define ASH_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H | 6 #define ASH_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/chromeos/supervised/custodian_info_tray_observer.h" | 9 #include "ash/system/chromeos/supervised/custodian_info_tray_observer.h" |
10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public CustodianInfoTrayObserver { | 21 public CustodianInfoTrayObserver { |
22 public: | 22 public: |
23 explicit TraySupervisedUser(SystemTray* system_tray); | 23 explicit TraySupervisedUser(SystemTray* system_tray); |
24 ~TraySupervisedUser() override; | 24 ~TraySupervisedUser() override; |
25 | 25 |
26 // If message is not empty updates content of default view, otherwise hides | 26 // If message is not empty updates content of default view, otherwise hides |
27 // tray items. | 27 // tray items. |
28 void UpdateMessage(); | 28 void UpdateMessage(); |
29 | 29 |
30 // Overridden from SystemTrayItem. | 30 // Overridden from SystemTrayItem. |
31 views::View* CreateDefaultView(user::LoginStatus status) override; | 31 views::View* CreateDefaultView(LoginStatus status) override; |
32 void DestroyDefaultView() override; | 32 void DestroyDefaultView() override; |
33 void UpdateAfterLoginStatusChange(user::LoginStatus status) override; | 33 void UpdateAfterLoginStatusChange(LoginStatus status) override; |
34 | 34 |
35 // Overridden from ViewClickListener. | 35 // Overridden from ViewClickListener. |
36 void OnViewClicked(views::View* sender) override; | 36 void OnViewClicked(views::View* sender) override; |
37 | 37 |
38 // Overridden from CustodianInfoTrayObserver: | 38 // Overridden from CustodianInfoTrayObserver: |
39 void OnCustodianInfoChanged() override; | 39 void OnCustodianInfoChanged() override; |
40 | 40 |
41 private: | 41 private: |
42 friend class TraySupervisedUserTest; | 42 friend class TraySupervisedUserTest; |
43 | 43 |
44 static const char kNotificationId[]; | 44 static const char kNotificationId[]; |
45 | 45 |
46 void CreateOrUpdateNotification(const base::string16& new_message); | 46 void CreateOrUpdateNotification(const base::string16& new_message); |
47 | 47 |
48 void CreateOrUpdateSupervisedWarningNotification(); | 48 void CreateOrUpdateSupervisedWarningNotification(); |
49 | 49 |
50 int GetSupervisedUserIconId() const; | 50 int GetSupervisedUserIconId() const; |
51 | 51 |
52 LabelTrayView* tray_view_; | 52 LabelTrayView* tray_view_; |
53 | 53 |
54 // Previous login status to avoid showing notification upon unlock. | 54 // Previous login status to avoid showing notification upon unlock. |
55 user::LoginStatus status_; | 55 LoginStatus status_; |
56 | 56 |
57 // Previous user supervised state to avoid showing notification upon unlock. | 57 // Previous user supervised state to avoid showing notification upon unlock. |
58 bool is_user_supervised_; | 58 bool is_user_supervised_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(TraySupervisedUser); | 60 DISALLOW_COPY_AND_ASSIGN(TraySupervisedUser); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace ash | 63 } // namespace ash |
64 | 64 |
65 #endif // ASH_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H | 65 #endif // ASH_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H |
OLD | NEW |