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