| 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_SESSION_SESSION_LENGTH_LIMIT_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ | 6 #define ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ |
| 7 | 7 |
| 8 #include "ash/system/chromeos/session/session_length_limit_observer.h" | 8 #include "ash/system/chromeos/session/session_length_limit_observer.h" |
| 9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class ASH_EXPORT TraySessionLengthLimit : public SystemTrayItem, | 25 class ASH_EXPORT TraySessionLengthLimit : public SystemTrayItem, |
| 26 public SessionLengthLimitObserver { | 26 public SessionLengthLimitObserver { |
| 27 public: | 27 public: |
| 28 enum LimitState { | 28 enum LimitState { |
| 29 LIMIT_NONE, | 29 LIMIT_NONE, |
| 30 LIMIT_SET, | 30 LIMIT_SET, |
| 31 LIMIT_EXPIRING_SOON | 31 LIMIT_EXPIRING_SOON |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 explicit TraySessionLengthLimit(SystemTray* system_tray); | 34 explicit TraySessionLengthLimit(SystemTray* system_tray); |
| 35 virtual ~TraySessionLengthLimit(); | 35 ~TraySessionLengthLimit() override; |
| 36 | 36 |
| 37 // SystemTrayItem: | 37 // SystemTrayItem: |
| 38 virtual views::View* CreateDefaultView(user::LoginStatus status) override; | 38 views::View* CreateDefaultView(user::LoginStatus status) override; |
| 39 virtual void DestroyDefaultView() override; | 39 void DestroyDefaultView() override; |
| 40 | 40 |
| 41 // SessionLengthLimitObserver: | 41 // SessionLengthLimitObserver: |
| 42 virtual void OnSessionStartTimeChanged() override; | 42 void OnSessionStartTimeChanged() override; |
| 43 virtual void OnSessionLengthLimitChanged() override; | 43 void OnSessionLengthLimitChanged() override; |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 friend class test::TraySessionLengthLimitTest; | 46 friend class test::TraySessionLengthLimitTest; |
| 47 | 47 |
| 48 static const char kNotificationId[]; | 48 static const char kNotificationId[]; |
| 49 | 49 |
| 50 // Update state, notification and tray bubble view. Called by the | 50 // Update state, notification and tray bubble view. Called by the |
| 51 // RepeatingTimer in regular intervals and also by OnSession*Changed(). | 51 // RepeatingTimer in regular intervals and also by OnSession*Changed(). |
| 52 void Update(); | 52 void Update(); |
| 53 | 53 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 70 | 70 |
| 71 LabelTrayView* tray_bubble_view_; | 71 LabelTrayView* tray_bubble_view_; |
| 72 scoped_ptr<base::RepeatingTimer<TraySessionLengthLimit> > timer_; | 72 scoped_ptr<base::RepeatingTimer<TraySessionLengthLimit> > timer_; |
| 73 | 73 |
| 74 DISALLOW_COPY_AND_ASSIGN(TraySessionLengthLimit); | 74 DISALLOW_COPY_AND_ASSIGN(TraySessionLengthLimit); |
| 75 }; | 75 }; |
| 76 | 76 |
| 77 } // namespace ash | 77 } // namespace ash |
| 78 | 78 |
| 79 #endif // ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ | 79 #endif // ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ |
| OLD | NEW |