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

Side by Side 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: 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 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 #ifndef ASH_SYSTEM_POWER_TRAY_POWER_H_ 5 #ifndef ASH_SYSTEM_POWER_TRAY_POWER_H_
6 #define ASH_SYSTEM_POWER_TRAY_POWER_H_ 6 #define ASH_SYSTEM_POWER_TRAY_POWER_H_
7 7
8 #include "ash/system/power/power_status_observer.h" 8 #include "ash/system/power/power_status_observer.h"
9 #include "ash/system/tray/system_tray_item.h" 9 #include "ash/system/tray/system_tray_item.h"
10 10
(...skipping 15 matching lines...) Expand all
26 ICON_LIGHT, 26 ICON_LIGHT,
27 ICON_DARK 27 ICON_DARK
28 }; 28 };
29 29
30 class TrayPower : public SystemTrayItem, 30 class TrayPower : public SystemTrayItem,
31 public PowerStatusObserver { 31 public PowerStatusObserver {
32 public: 32 public:
33 TrayPower(); 33 TrayPower();
34 virtual ~TrayPower(); 34 virtual ~TrayPower();
35 35
36 static gfx::ImageSkia GetBatteryImage(const PowerSupplyStatus& supply_status, 36 static int GetBatteryImageIndex(const PowerSupplyStatus& supply_status);
Daniel Erat 2012/09/04 21:51:58 nit: add comments documenting what these do
37 IconSet icon_set); 37 static gfx::ImageSkia GetBatteryImage(int image_index, IconSet icon_set);
38 38
39 private: 39 private:
40 enum NotificationState { 40 enum NotificationState {
41 NOTIFICATION_NONE, 41 NOTIFICATION_NONE,
42 NOTIFICATION_LOW_POWER, 42 NOTIFICATION_LOW_POWER,
43 NOTIFICATION_CRITICAL 43 NOTIFICATION_CRITICAL
44 }; 44 };
45 45
46 // Overridden from SystemTrayItem. 46 // Overridden from SystemTrayItem.
47 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 47 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
(...skipping 17 matching lines...) Expand all
65 tray::PowerNotificationView* notification_view_; 65 tray::PowerNotificationView* notification_view_;
66 NotificationState notification_state_; 66 NotificationState notification_state_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(TrayPower); 68 DISALLOW_COPY_AND_ASSIGN(TrayPower);
69 }; 69 };
70 70
71 } // namespace internal 71 } // namespace internal
72 } // namespace ash 72 } // namespace ash
73 73
74 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_ 74 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698