summaryrefslogtreecommitdiffstats
path: root/chromeos/dbus/power_manager_client.h
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:53:29 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-06 21:53:29 +0000
commit546161f3e901724a01cbb90c8fb58706649d97f4 (patch)
tree68f4cb3bf48ec40c23e19a6b824ac77b697fc99f /chromeos/dbus/power_manager_client.h
parentf681b07a8029e8d7c26aa42d53fd1e7e8e16414c (diff)
downloadchromium_src-546161f3e901724a01cbb90c8fb58706649d97f4.zip
chromium_src-546161f3e901724a01cbb90c8fb58706649d97f4.tar.gz
chromium_src-546161f3e901724a01cbb90c8fb58706649d97f4.tar.bz2
chromeos: Clean up power status polling code.
This makes Chrome decode PowerSupplyProperties protocol buffers from PowerSupplyPoll D-Bus signals sent by powerd. It also removes an unnecessary UpdateRequestType enum from PowerManagerClient. BUG=245108,234671 Review URL: https://chromiumcodereview.appspot.com/16493002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@204614 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/power_manager_client.h')
-rw-r--r--chromeos/dbus/power_manager_client.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h
index 2e77799..c3fb5b9 100644
--- a/chromeos/dbus/power_manager_client.h
+++ b/chromeos/dbus/power_manager_client.h
@@ -56,8 +56,9 @@ class CHROMEOS_EXPORT PowerManagerClient {
const std::string& name,
int level) {}
- // Called when power supply polling takes place. |status| is a data
- // structure that contains the current state of the power supply.
+ // Called when updated information about the power supply is available.
+ // The status is automatically updated periodically, but
+ // RequestStatusUpdate() can be used to trigger an immediate update.
virtual void PowerChanged(const PowerSupplyStatus& status) {}
// Called when we go idle for threshold time.
@@ -91,12 +92,6 @@ class CHROMEOS_EXPORT PowerManagerClient {
virtual void IdleActionDeferred() {}
};
- enum UpdateRequestType {
- UPDATE_INITIAL, // Initial update request.
- UPDATE_USER, // User initialted update request.
- UPDATE_POLL // Update requested by poll signal.
- };
-
// Adds and removes the observer.
virtual void AddObserver(Observer* observer) = 0;
virtual void RemoveObserver(Observer* observer) = 0;
@@ -124,8 +119,9 @@ class CHROMEOS_EXPORT PowerManagerClient {
// Increases the keyboard brightness.
virtual void IncreaseKeyboardBrightness() = 0;
- // Request for power supply status update.
- virtual void RequestStatusUpdate(UpdateRequestType update_type) = 0;
+ // Requests an updated copy of the power status. Observer::PowerChanged()
+ // will be called asynchronously.
+ virtual void RequestStatusUpdate() = 0;
// Requests restart of the system.
virtual void RequestRestart() = 0;