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 <memory> | 8 #include <memory> |
9 | 9 |
10 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" | 10 #include "ash/common/system/chromeos/session/session_length_limit_observer.h" |
11 #include "ash/common/system/tray/system_tray_item.h" | 11 #include "ash/common/system/tray/system_tray_item.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 namespace test { | 18 namespace test { |
19 class TraySessionLengthLimitTest; | 19 class TraySessionLengthLimitTest; |
20 } | 20 } |
21 | 21 |
22 class LabelTrayView; | 22 class LabelTrayView; |
23 | 23 |
24 // Adds a countdown timer to the system tray if the session length is limited. | 24 // Adds a countdown timer to the system tray if the session length is limited. |
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 { LIMIT_NONE, LIMIT_SET, LIMIT_EXPIRING_SOON }; |
29 LIMIT_NONE, | |
30 LIMIT_SET, | |
31 LIMIT_EXPIRING_SOON | |
32 }; | |
33 | 29 |
34 explicit TraySessionLengthLimit(SystemTray* system_tray); | 30 explicit TraySessionLengthLimit(SystemTray* system_tray); |
35 ~TraySessionLengthLimit() override; | 31 ~TraySessionLengthLimit() override; |
36 | 32 |
37 // SystemTrayItem: | 33 // SystemTrayItem: |
38 views::View* CreateDefaultView(LoginStatus status) override; | 34 views::View* CreateDefaultView(LoginStatus status) override; |
39 void DestroyDefaultView() override; | 35 void DestroyDefaultView() override; |
40 | 36 |
41 // SessionLengthLimitObserver: | 37 // SessionLengthLimitObserver: |
42 void OnSessionStartTimeChanged() override; | 38 void OnSessionStartTimeChanged() override; |
(...skipping 27 matching lines...) Expand all Loading... |
70 | 66 |
71 LabelTrayView* tray_bubble_view_; | 67 LabelTrayView* tray_bubble_view_; |
72 std::unique_ptr<base::RepeatingTimer> timer_; | 68 std::unique_ptr<base::RepeatingTimer> timer_; |
73 | 69 |
74 DISALLOW_COPY_AND_ASSIGN(TraySessionLengthLimit); | 70 DISALLOW_COPY_AND_ASSIGN(TraySessionLengthLimit); |
75 }; | 71 }; |
76 | 72 |
77 } // namespace ash | 73 } // namespace ash |
78 | 74 |
79 #endif // ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ | 75 #endif // ASH_SYSTEM_CHROMEOS_SESSION_SESSION_LENGTH_LIMIT_H_ |
OLD | NEW |