| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_COMMON_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H_ | |
| 6 #define ASH_COMMON_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/common/system/chromeos/supervised/custodian_info_tray_observer.h" | |
| 10 #include "ash/common/system/tray/system_tray_item.h" | |
| 11 #include "ash/common/system/tray/view_click_listener.h" | |
| 12 #include "base/macros.h" | |
| 13 #include "base/strings/string16.h" | |
| 14 | |
| 15 namespace ash { | |
| 16 class LabelTrayView; | |
| 17 class SystemTray; | |
| 18 | |
| 19 class ASH_EXPORT TraySupervisedUser : public SystemTrayItem, | |
| 20 public ViewClickListener, | |
| 21 public CustodianInfoTrayObserver { | |
| 22 public: | |
| 23 explicit TraySupervisedUser(SystemTray* system_tray); | |
| 24 ~TraySupervisedUser() override; | |
| 25 | |
| 26 // If message is not empty updates content of default view, otherwise hides | |
| 27 // tray items. | |
| 28 void UpdateMessage(); | |
| 29 | |
| 30 // Overridden from SystemTrayItem. | |
| 31 views::View* CreateDefaultView(LoginStatus status) override; | |
| 32 void DestroyDefaultView() override; | |
| 33 void UpdateAfterLoginStatusChange(LoginStatus status) override; | |
| 34 | |
| 35 // Overridden from ViewClickListener. | |
| 36 void OnViewClicked(views::View* sender) override; | |
| 37 | |
| 38 // Overridden from CustodianInfoTrayObserver: | |
| 39 void OnCustodianInfoChanged() override; | |
| 40 | |
| 41 private: | |
| 42 friend class TraySupervisedUserTest; | |
| 43 | |
| 44 static const char kNotificationId[]; | |
| 45 | |
| 46 void CreateOrUpdateNotification(const base::string16& new_message); | |
| 47 | |
| 48 void CreateOrUpdateSupervisedWarningNotification(); | |
| 49 | |
| 50 int GetSupervisedUserIconId() const; | |
| 51 | |
| 52 LabelTrayView* tray_view_; | |
| 53 | |
| 54 // Previous login status to avoid showing notification upon unlock. | |
| 55 LoginStatus status_; | |
| 56 | |
| 57 // Previous user supervised state to avoid showing notification upon unlock. | |
| 58 bool is_user_supervised_; | |
| 59 | |
| 60 DISALLOW_COPY_AND_ASSIGN(TraySupervisedUser); | |
| 61 }; | |
| 62 | |
| 63 } // namespace ash | |
| 64 | |
| 65 #endif // ASH_COMMON_SYSTEM_CHROMEOS_SUPERVISED_TRAY_SUPERVISED_USER_H_ | |
| OLD | NEW |