Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(749)

Unified Diff: chrome/browser/chromeos/dbus/power_manager_client.h

Issue 8566024: chromeos: call GetIdleTime from power manager client (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Updated comments, made callback ptr -> const reference Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 11ecf90dac6c65f750ebb0c7f35544c30a34a427..b613d520d4cc96e56c8c1b4ef6ffc46242bf5c7a 100644
--- a/chrome/browser/chromeos/dbus/power_manager_client.h
+++ b/chrome/browser/chromeos/dbus/power_manager_client.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
#define CHROME_BROWSER_CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
+#include "base/basictypes.h"
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "base/observer_list.h"
@@ -36,6 +38,10 @@ struct PowerSupplyStatus {
const std::string& ToString() const;
};
+// Callback used for processing the idle time. The int64 param is the number of
+// milliseconds the user has been idle.
+typedef base::Callback<void(int64)> CalculateIdleTimeCallback;
+
// PowerManagerClient is used to communicate with the power manager.
class PowerManagerClient {
public:
@@ -72,6 +78,11 @@ class PowerManagerClient {
// Requests shutdown of the system.
virtual void RequestShutdown() = 0;
+ // Calculates idle time asynchronously, after the idle time request has
+ // replied. It passes the idle time in seconds to |callback|. If it
satorux1 2011/11/15 02:07:12 seconds -> milliseconds? The comment above says it
Simon Que 2011/11/15 02:47:44 Done. Actually the other way around.
+ // encounters some error, it passes -1 to |callback|.
+ virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0;
+
// Creates the instance.
static PowerManagerClient* Create(dbus::Bus* bus);

Powered by Google App Engine
This is Rietveld 408576698