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

Side by Side Diff: ash/system/power/tray_power.h

Issue 10540041: Add battery status to settings row in uber tray bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not show settings if user is not logined in or screen is locked. Created 8 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 | Annotate | Revision Log
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 #pragma once 7 #pragma once
8 8
9 #include "ash/system/power/power_status_observer.h" 9 #include "ash/system/power/power_status_observer.h"
10 #include "ash/system/tray/system_tray_item.h" 10 #include "ash/system/tray/system_tray_item.h"
11 11
12 class SkBitmap;
13
14 namespace gfx {
15 class ImageSkia;
16 }
17
12 namespace ash { 18 namespace ash {
13 namespace internal { 19 namespace internal {
14 20
15 namespace tray { 21 namespace tray {
16 class PowerNotificationView; 22 class PowerNotificationView;
17 class PowerTrayView; 23 class PowerTrayView;
18 } 24 }
19 25
26 enum IconSet {
27 ICON_LIGHT,
28 ICON_DARK
29 };
30
20 class TrayPower : public SystemTrayItem, 31 class TrayPower : public SystemTrayItem,
21 public PowerStatusObserver { 32 public PowerStatusObserver {
22 public: 33 public:
23 TrayPower(); 34 TrayPower();
24 virtual ~TrayPower(); 35 virtual ~TrayPower();
25 36
37 static gfx::ImageSkia GetBatteryImage(const PowerSupplyStatus& supply_status,
38 IconSet icon_set);
39
26 private: 40 private:
27 enum NotificationState { 41 enum NotificationState {
28 NOTIFICATION_NONE, 42 NOTIFICATION_NONE,
29 NOTIFICATION_LOW_POWER, 43 NOTIFICATION_LOW_POWER,
30 NOTIFICATION_CRITICAL 44 NOTIFICATION_CRITICAL
31 }; 45 };
32 46
33 // Overridden from SystemTrayItem. 47 // Overridden from SystemTrayItem.
34 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 48 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
35 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 49 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
(...skipping 14 matching lines...) Expand all
50 tray::PowerNotificationView* notification_view_; 64 tray::PowerNotificationView* notification_view_;
51 NotificationState notification_state_; 65 NotificationState notification_state_;
52 66
53 DISALLOW_COPY_AND_ASSIGN(TrayPower); 67 DISALLOW_COPY_AND_ASSIGN(TrayPower);
54 }; 68 };
55 69
56 } // namespace internal 70 } // namespace internal
57 } // namespace ash 71 } // namespace ash
58 72
59 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_ 73 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698