| 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 #include "ash/common/system/chromeos/power/tray_power.h" | 5 #include "ash/common/system/chromeos/power/tray_power.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/common/accessibility_delegate.h" | 9 #include "ash/common/accessibility_delegate.h" |
| 10 #include "ash/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 const int TrayPower::kCriticalMinutes = 5; | 136 const int TrayPower::kCriticalMinutes = 5; |
| 137 const int TrayPower::kLowPowerMinutes = 15; | 137 const int TrayPower::kLowPowerMinutes = 15; |
| 138 const int TrayPower::kNoWarningMinutes = 30; | 138 const int TrayPower::kNoWarningMinutes = 30; |
| 139 const int TrayPower::kCriticalPercentage = 5; | 139 const int TrayPower::kCriticalPercentage = 5; |
| 140 const int TrayPower::kLowPowerPercentage = 10; | 140 const int TrayPower::kLowPowerPercentage = 10; |
| 141 const int TrayPower::kNoWarningPercentage = 15; | 141 const int TrayPower::kNoWarningPercentage = 15; |
| 142 | 142 |
| 143 const char TrayPower::kUsbNotificationId[] = "usb-charger"; | 143 const char TrayPower::kUsbNotificationId[] = "usb-charger"; |
| 144 | 144 |
| 145 TrayPower::TrayPower(SystemTray* system_tray, MessageCenter* message_center) | 145 TrayPower::TrayPower(SystemTray* system_tray, MessageCenter* message_center) |
| 146 : SystemTrayItem(system_tray), | 146 : SystemTrayItem(system_tray, UMA_POWER), |
| 147 message_center_(message_center), | 147 message_center_(message_center), |
| 148 power_tray_(NULL), | 148 power_tray_(NULL), |
| 149 notification_state_(NOTIFICATION_NONE), | 149 notification_state_(NOTIFICATION_NONE), |
| 150 usb_charger_was_connected_(false), | 150 usb_charger_was_connected_(false), |
| 151 line_power_was_connected_(false), | 151 line_power_was_connected_(false), |
| 152 usb_notification_dismissed_(false) { | 152 usb_notification_dismissed_(false) { |
| 153 PowerStatus::Get()->AddObserver(this); | 153 PowerStatus::Get()->AddObserver(this); |
| 154 } | 154 } |
| 155 | 155 |
| 156 TrayPower::~TrayPower() { | 156 TrayPower::~TrayPower() { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 350 } |
| 351 NOTREACHED(); | 351 NOTREACHED(); |
| 352 return false; | 352 return false; |
| 353 } | 353 } |
| 354 | 354 |
| 355 void TrayPower::NotifyUsbNotificationClosedByUser() { | 355 void TrayPower::NotifyUsbNotificationClosedByUser() { |
| 356 usb_notification_dismissed_ = true; | 356 usb_notification_dismissed_ = true; |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace ash | 359 } // namespace ash |
| OLD | NEW |