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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 // Show a notification that a low-power USB charger has been connected. | 85 // Show a notification that a low-power USB charger has been connected. |
86 // Returns true if a notification was shown or explicitly hidden. | 86 // Returns true if a notification was shown or explicitly hidden. |
87 bool MaybeShowUsbChargerNotification(); | 87 bool MaybeShowUsbChargerNotification(); |
88 | 88 |
89 // Sets |notification_state_|. Returns true if a notification should be shown. | 89 // Sets |notification_state_|. Returns true if a notification should be shown. |
90 bool UpdateNotificationState(); | 90 bool UpdateNotificationState(); |
91 bool UpdateNotificationStateForRemainingTime(); | 91 bool UpdateNotificationStateForRemainingTime(); |
92 bool UpdateNotificationStateForRemainingPercentage(); | 92 bool UpdateNotificationStateForRemainingPercentage(); |
93 | 93 |
94 // Records the charger type in UMA. | |
95 void RecordChargerType(); | |
96 | |
97 message_center::MessageCenter* message_center_; // Not owned. | 94 message_center::MessageCenter* message_center_; // Not owned. |
98 tray::PowerTrayView* power_tray_; | 95 tray::PowerTrayView* power_tray_; |
99 tray::PowerNotificationView* notification_view_; | 96 tray::PowerNotificationView* notification_view_; |
100 NotificationState notification_state_; | 97 NotificationState notification_state_; |
101 | 98 |
102 // Was a USB charger connected the last time OnPowerStatusChanged() was | 99 // Was a USB charger connected the last time OnPowerStatusChanged() was |
103 // called? | 100 // called? |
104 bool usb_charger_was_connected_; | 101 bool usb_charger_was_connected_; |
105 | 102 |
106 // Was line power connected the last time onPowerStatusChanged() was called? | 103 // Was line power connected the last time onPowerStatusChanged() was called? |
107 bool line_power_was_connected_; | 104 bool line_power_was_connected_; |
108 | 105 |
109 DISALLOW_COPY_AND_ASSIGN(TrayPower); | 106 DISALLOW_COPY_AND_ASSIGN(TrayPower); |
110 }; | 107 }; |
111 | 108 |
112 } // namespace ash | 109 } // namespace ash |
113 | 110 |
114 #endif // ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ | 111 #endif // ASH_SYSTEM_CHROMEOS_POWER_TRAY_POWER_H_ |
OLD | NEW |