OLD | NEW |
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_CHROMEOS_POWER_TRAY_POWER_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ |
6 #define ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ | 6 #define ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ |
7 | 7 |
8 #include "ash/system/chromeos/power/power_status.h" | 8 #include "ash/system/chromeos/power/power_status.h" |
9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 enum NotificationState { | 34 enum NotificationState { |
35 NOTIFICATION_NONE, | 35 NOTIFICATION_NONE, |
36 | 36 |
37 // Low battery charge. | 37 // Low battery charge. |
38 NOTIFICATION_LOW_POWER, | 38 NOTIFICATION_LOW_POWER, |
39 | 39 |
40 // Critically low battery charge. | 40 // Critically low battery charge. |
41 NOTIFICATION_CRITICAL, | 41 NOTIFICATION_CRITICAL, |
42 }; | 42 }; |
43 | 43 |
| 44 // Time-based notification thresholds when on battery power. |
| 45 static const int kCriticalMinutes; |
| 46 static const int kLowPowerMinutes; |
| 47 static const int kNoWarningMinutes; |
| 48 |
| 49 // Percentage-based notification thresholds when using a low-power charger. |
| 50 static const int kCriticalPercentage; |
| 51 static const int kLowPowerPercentage; |
| 52 static const int kNoWarningPercentage; |
| 53 |
44 TrayPower(SystemTray* system_tray, | 54 TrayPower(SystemTray* system_tray, |
45 message_center::MessageCenter* message_center); | 55 message_center::MessageCenter* message_center); |
46 virtual ~TrayPower(); | 56 virtual ~TrayPower(); |
47 | 57 |
48 private: | 58 private: |
49 friend class TrayPowerTest; | 59 friend class TrayPowerTest; |
50 | 60 |
51 // Overridden from SystemTrayItem. | 61 // Overridden from SystemTrayItem. |
52 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 62 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
53 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 63 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
81 // called? | 91 // called? |
82 bool usb_charger_was_connected_; | 92 bool usb_charger_was_connected_; |
83 | 93 |
84 DISALLOW_COPY_AND_ASSIGN(TrayPower); | 94 DISALLOW_COPY_AND_ASSIGN(TrayPower); |
85 }; | 95 }; |
86 | 96 |
87 } // namespace internal | 97 } // namespace internal |
88 } // namespace ash | 98 } // namespace ash |
89 | 99 |
90 #endif // ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ | 100 #endif // ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ |
OLD | NEW |