| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 if (battery_alert) { | 113 if (battery_alert) { |
| 114 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(true); | 114 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(true); |
| 115 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); | 115 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 void UpdateImage() { | 120 void UpdateImage() { |
| 121 const PowerStatus::BatteryImageInfo info = | 121 const PowerStatus::BatteryImageInfo info = |
| 122 PowerStatus::Get()->GetBatteryImageInfo(PowerStatus::ICON_LIGHT); | 122 PowerStatus::Get()->GetBatteryImageInfo(); |
| 123 if (info != previous_image_info_) { | 123 if (info != previous_image_info_) { |
| 124 image_view()->SetImage(PowerStatus::Get()->GetBatteryImage(info)); | 124 image_view()->SetImage(PowerStatus::Get()->GetBatteryImage(info)); |
| 125 previous_image_info_ = info; | 125 previous_image_info_ = info; |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 base::string16 accessible_name_; | 129 base::string16 accessible_name_; |
| 130 | 130 |
| 131 // Information about the last-used image. Cached to avoid unnecessary updates | 131 // Information about the last-used image. Cached to avoid unnecessary updates |
| 132 // (http://crbug.com/589348). | 132 // (http://crbug.com/589348). |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 } | 346 } |
| 347 NOTREACHED(); | 347 NOTREACHED(); |
| 348 return false; | 348 return false; |
| 349 } | 349 } |
| 350 | 350 |
| 351 void TrayPower::NotifyUsbNotificationClosedByUser() { | 351 void TrayPower::NotifyUsbNotificationClosedByUser() { |
| 352 usb_notification_dismissed_ = true; | 352 usb_notification_dismissed_ = true; |
| 353 } | 353 } |
| 354 | 354 |
| 355 } // namespace ash | 355 } // namespace ash |
| OLD | NEW |