Index: ash/system/chromeos/power/power_status_view.h |
diff --git a/ash/system/chromeos/power/power_status_view.h b/ash/system/chromeos/power/power_status_view.h |
index 421ce40067b2213842f4146cf9199ea8a1c62eb7..465da02b8a3a3adb39814e4ab753096474ec8075 100644 |
--- a/ash/system/chromeos/power/power_status_view.h |
+++ b/ash/system/chromeos/power/power_status_view.h |
@@ -5,7 +5,7 @@ |
#ifndef ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_VIEW_H_ |
#define ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_VIEW_H_ |
-#include "chromeos/dbus/power_supply_status.h" |
+#include "ash/system/chromeos/power/power_status.h" |
#include "ui/views/view.h" |
namespace views { |
@@ -16,7 +16,7 @@ class Label; |
namespace ash { |
namespace internal { |
-class PowerStatusView : public views::View { |
+class PowerStatusView : public views::View, public PowerStatus::Observer { |
public: |
enum ViewType { |
VIEW_DEFAULT, |
@@ -24,25 +24,21 @@ class PowerStatusView : public views::View { |
}; |
PowerStatusView(ViewType view_type, bool default_view_right_align); |
- virtual ~PowerStatusView() {} |
- |
- void UpdatePowerStatus(const chromeos::PowerSupplyStatus& status); |
- const base::string16& accessible_name() const { return accessible_name_; } |
+ virtual ~PowerStatusView(); |
// Overridden from views::View. |
virtual gfx::Size GetPreferredSize() OVERRIDE; |
virtual int GetHeightForWidth(int width) OVERRIDE; |
virtual void Layout() OVERRIDE; |
+ // Overridden from PowerStatus::Observer. |
+ virtual void OnPowerStatusChanged() OVERRIDE; |
+ |
private: |
void LayoutDefaultView(); |
void LayoutNotificationView(); |
- void UpdateText(); |
- void UpdateIcon(); |
- void Update(); |
void UpdateTextForDefaultView(); |
void UpdateTextForNotificationView(); |
- base::string16 GetBatteryTimeAccessibilityString(int hour, int min); |
// Overridden from views::View. |
virtual void ChildPreferredSizeChanged(views::View* child) OVERRIDE; |
@@ -62,24 +58,8 @@ class PowerStatusView : public views::View { |
// Battery status indicator icon. |
views::ImageView* icon_; |
- // Index of the current icon in the icon array image, or -1 if unknown. |
- int icon_image_index_; |
- |
- // Horizontal offset of the current icon in the icon array image. |
- int icon_image_offset_; |
- |
- // Battery charging may be unreliable for non-standard power supplies. |
- // It may change from charging to discharging frequently depending on |
- // charger power and current power consumption. We show different UIs |
- // when in this state. See TrayPower::IsBatteryChargingUnreliable. |
- bool battery_charging_unreliable_; |
- |
ViewType view_type_; |
- chromeos::PowerSupplyStatus supply_status_; |
- |
- base::string16 accessible_name_; |
- |
DISALLOW_COPY_AND_ASSIGN(PowerStatusView); |
}; |