Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Side by Side Diff: ash/system/chromeos/power/tray_power.cc

Issue 2063633002: Render Ash material design battery image icon without PNGs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/system/chromeos/power/tray_power.h" 5 #include "ash/system/chromeos/power/tray_power.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/ash_switches.h" 9 #include "ash/ash_switches.h"
10 #include "ash/common/accessibility_delegate.h" 10 #include "ash/common/accessibility_delegate.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(true); 113 accessible_name_ = PowerStatus::Get()->GetAccessibleNameString(true);
114 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true); 114 NotifyAccessibilityEvent(ui::AX_EVENT_ALERT, true);
115 } 115 }
116 } 116 }
117 117
118 private: 118 private:
119 void UpdateImage() { 119 void UpdateImage() {
120 const PowerStatus::BatteryImageInfo info = 120 const PowerStatus::BatteryImageInfo info =
121 PowerStatus::Get()->GetBatteryImageInfo(PowerStatus::ICON_LIGHT); 121 PowerStatus::Get()->GetBatteryImageInfo(PowerStatus::ICON_LIGHT);
122 if (info != previous_image_info_) { 122 if (info != previous_image_info_) {
123 SetImage(PowerStatus::Get()->GetBatteryImage(PowerStatus::ICON_LIGHT)); 123 SetImage(PowerStatus::Get()->GetBatteryImage(info));
124 previous_image_info_ = info; 124 previous_image_info_ = info;
125 } 125 }
126 } 126 }
127 127
128 base::string16 accessible_name_; 128 base::string16 accessible_name_;
129 129
130 // Information about the last-used image. Cached to avoid unnecessary updates 130 // Information about the last-used image. Cached to avoid unnecessary updates
131 // (http://crbug.com/589348). 131 // (http://crbug.com/589348).
132 PowerStatus::BatteryImageInfo previous_image_info_; 132 PowerStatus::BatteryImageInfo previous_image_info_;
133 133
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 355 }
356 NOTREACHED(); 356 NOTREACHED();
357 return false; 357 return false;
358 } 358 }
359 359
360 void TrayPower::NotifyUsbNotificationClosedByUser() { 360 void TrayPower::NotifyUsbNotificationClosedByUser() {
361 usb_notification_dismissed_ = true; 361 usb_notification_dismissed_ = true;
362 } 362 }
363 363
364 } // namespace ash 364 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698