Chromium Code Reviews| Index: chrome/browser/chromeos/dbus/power_manager_client.h |
| diff --git a/chrome/browser/chromeos/dbus/power_manager_client.h b/chrome/browser/chromeos/dbus/power_manager_client.h |
| index aa670ad18c2b1fe758ebb841aa14663e63ef5940..2058f340372c58c86df331ea72ba118f77730589 100644 |
| --- a/chrome/browser/chromeos/dbus/power_manager_client.h |
| +++ b/chrome/browser/chromeos/dbus/power_manager_client.h |
| @@ -19,6 +19,29 @@ class Signal; |
| namespace chromeos { |
| +// This is the local struct that is used in Chrome. |
| +struct PowerSupplyStatus { |
| + bool line_power_on; |
| + |
| + bool battery_is_present; |
| + bool battery_is_full; |
| + |
| + // Time in seconds until the battery is empty or full, 0 for unknown. |
| + int64 battery_seconds_to_empty; |
| + int64 battery_seconds_to_full; |
| + |
| + double battery_percentage; |
| + |
| + PowerSupplyStatus() : line_power_on(false), |
| + battery_is_present(false), |
| + battery_is_full(false), |
| + battery_seconds_to_empty(0), |
| + battery_seconds_to_full(0), |
| + battery_percentage(0) {} |
|
satorux1
2011/11/03 23:38:47
linux_chromeos_clang build tends to complain about
Simon Que
2011/11/04 22:35:31
Done.
|
| + |
| + const std::string& ToString() const; |
| +}; |
| + |
| // PowerManagerClient is used to communicate with the power manager. |
| class PowerManagerClient { |
| public: |
| @@ -28,7 +51,11 @@ class PowerManagerClient { |
| // Called when the brightness is changed. |
| // |level| is of the range [0, 100]. |
| // |user_initiated| is true if the action is initiated by the user. |
| - virtual void BrightnessChanged(int level, bool user_initiated) = 0; |
| + virtual void BrightnessChanged(int level, bool user_initiated) {} |
| + |
| + // Called when power supply polling takes place. |status| is a data |
| + // structure that contains the current state of the power supply. |
| + virtual void PowerChanged(const PowerSupplyStatus& status) {} |
| }; |
| // Adds and removes the observer. |
| @@ -42,6 +69,9 @@ class PowerManagerClient { |
| // Increases the screen brightness. |
| virtual void IncreaseScreenBrightness() = 0; |
| + // UI initiated request for status update. |
| + virtual void RequestStatusUpdate() = 0; |
|
satorux1
2011/11/04 22:24:57
Please add this to mock_power_manager_client.h too
Simon Que
2011/11/04 22:35:31
Done.
|
| + |
| // Creates the instance. |
| static PowerManagerClient* Create(dbus::Bus* bus); |