| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_CHROMEOS_POWER_POWER_STATUS_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ | 6 #define ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ |
| 7 | 7 |
| 8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 // Returns true if line power (including a charger of any type) is connected. | 115 // Returns true if line power (including a charger of any type) is connected. |
| 116 bool IsLinePowerConnected() const; | 116 bool IsLinePowerConnected() const; |
| 117 | 117 |
| 118 // Returns true if an official, non-USB charger is connected. | 118 // Returns true if an official, non-USB charger is connected. |
| 119 bool IsMainsChargerConnected() const; | 119 bool IsMainsChargerConnected() const; |
| 120 | 120 |
| 121 // Returns true if a USB charger (which is likely to only support a low | 121 // Returns true if a USB charger (which is likely to only support a low |
| 122 // charging rate) is connected. | 122 // charging rate) is connected. |
| 123 bool IsUsbChargerConnected() const; | 123 bool IsUsbChargerConnected() const; |
| 124 | 124 |
| 125 // Returns true if an original spring charger is connected. | |
| 126 bool IsOriginalSpringChargerConnected() const; | |
| 127 | |
| 128 // Returns the image that should be shown for the battery's current state. | 125 // Returns the image that should be shown for the battery's current state. |
| 129 gfx::ImageSkia GetBatteryImage(IconSet icon_set) const; | 126 gfx::ImageSkia GetBatteryImage(IconSet icon_set) const; |
| 130 | 127 |
| 131 // Returns an string describing the current state for accessibility. | 128 // Returns an string describing the current state for accessibility. |
| 132 base::string16 GetAccessibleNameString(bool full_description) const; | 129 base::string16 GetAccessibleNameString(bool full_description) const; |
| 133 | 130 |
| 134 // Updates |proto_|. Does not notify observers. | 131 // Updates |proto_|. Does not notify observers. |
| 135 void SetProtoForTesting(const power_manager::PowerSupplyProperties& proto); | 132 void SetProtoForTesting(const power_manager::PowerSupplyProperties& proto); |
| 136 | 133 |
| 137 protected: | 134 protected: |
| 138 PowerStatus(); | 135 PowerStatus(); |
| 139 virtual ~PowerStatus(); | 136 virtual ~PowerStatus(); |
| 140 | 137 |
| 141 private: | 138 private: |
| 142 // Overriden from PowerManagerClient::Observer. | 139 // Overriden from PowerManagerClient::Observer. |
| 143 virtual void PowerChanged( | 140 virtual void PowerChanged( |
| 144 const power_manager::PowerSupplyProperties& proto) override; | 141 const power_manager::PowerSupplyProperties& proto) override; |
| 145 | 142 |
| 146 ObserverList<Observer> observers_; | 143 ObserverList<Observer> observers_; |
| 147 | 144 |
| 148 // Current state. | 145 // Current state. |
| 149 power_manager::PowerSupplyProperties proto_; | 146 power_manager::PowerSupplyProperties proto_; |
| 150 | 147 |
| 151 DISALLOW_COPY_AND_ASSIGN(PowerStatus); | 148 DISALLOW_COPY_AND_ASSIGN(PowerStatus); |
| 152 }; | 149 }; |
| 153 | 150 |
| 154 } // namespace ash | 151 } // namespace ash |
| 155 | 152 |
| 156 #endif // ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ | 153 #endif // ASH_SYSTEM_CHROMEOS_POWER_POWER_STATUS_H_ |
| OLD | NEW |