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

Unified Diff: ash/system/power/tray_power.h

Issue 10907037: Only update system power indicators on change (Closed) Base URL: https://git.chromium.org/git/chromium/src@git-svn
Patch Set: Last nits, and some SetImage() removal:wq Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/system/power/power_status_view.cc ('k') | ash/system/power/tray_power.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/power/tray_power.h
diff --git a/ash/system/power/tray_power.h b/ash/system/power/tray_power.h
index 44324fe9dcfd73c0a01a9894cb47c13d46ed39c2..91ebf74b99402b671a3c785d19c34e7b8cdc9a20 100644
--- a/ash/system/power/tray_power.h
+++ b/ash/system/power/tray_power.h
@@ -33,11 +33,13 @@ class TrayPower : public SystemTrayItem,
TrayPower();
virtual ~TrayPower();
- // Gets battery image based on |supply_status|. If |supply_status| is
- // uncertain about the power state, return |default_image| instead.
- static gfx::ImageSkia GetBatteryImage(const PowerSupplyStatus& supply_status,
- IconSet icon_set,
- const gfx::ImageSkia& default_image);
+ // Gets the icon index in the battery icon array image based on
+ // |supply_status|. If |supply_status| is uncertain about the power state,
+ // returns -1.
+ static int GetBatteryImageIndex(const PowerSupplyStatus& supply_status);
+
+ // Looks up the actual icon in the icon array image for |image_index|.
+ static gfx::ImageSkia GetBatteryImage(int image_index, IconSet icon_set);
private:
enum NotificationState {
« no previous file with comments | « ash/system/power/power_status_view.cc ('k') | ash/system/power/tray_power.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698