Chromium Code Reviews| 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 #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 Loading... | |
| 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 // Gets battery image based on |supply_status|. If |supply_status| is | 36 // Get the icon index in the battery icon array image based on |
|
Daniel Erat
2012/09/11 22:17:09
s/Get/Gets/
| |
| 37 // uncertain about the power state, return |default_image| instead. | 37 // |supply_status|. If |supply_status| is uncertain about the power state, |
| 38 static gfx::ImageSkia GetBatteryImage(const PowerSupplyStatus& supply_status, | 38 // return -1. |
|
Daniel Erat
2012/09/11 22:17:09
s/return/returns/
| |
| 39 IconSet icon_set, | 39 static int GetBatteryImageIndex(const PowerSupplyStatus& supply_status); |
| 40 const gfx::ImageSkia& default_image); | 40 // Lookup the actual icon in the icon array image for |image_index|. |
|
Daniel Erat
2012/09/11 22:17:09
add a blank line before this one
s/Lookup/Looks u
| |
| 41 static gfx::ImageSkia GetBatteryImage(int image_index, IconSet icon_set); | |
| 41 | 42 |
| 42 private: | 43 private: |
| 43 enum NotificationState { | 44 enum NotificationState { |
| 44 NOTIFICATION_NONE, | 45 NOTIFICATION_NONE, |
| 45 NOTIFICATION_LOW_POWER, | 46 NOTIFICATION_LOW_POWER, |
| 46 NOTIFICATION_CRITICAL | 47 NOTIFICATION_CRITICAL |
| 47 }; | 48 }; |
| 48 | 49 |
| 49 // Overridden from SystemTrayItem. | 50 // Overridden from SystemTrayItem. |
| 50 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 51 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 68 tray::PowerNotificationView* notification_view_; | 69 tray::PowerNotificationView* notification_view_; |
| 69 NotificationState notification_state_; | 70 NotificationState notification_state_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(TrayPower); | 72 DISALLOW_COPY_AND_ASSIGN(TrayPower); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace internal | 75 } // namespace internal |
| 75 } // namespace ash | 76 } // namespace ash |
| 76 | 77 |
| 77 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_ | 78 #endif // ASH_SYSTEM_POWER_TRAY_POWER_H_ |
| OLD | NEW |