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

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: fixed omission of callback.h 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 272d6088cfbe993873c88a60ff0a70df40e65e94..9b4323162e63467c6a8720958ad33f5190c27594 100644
--- a/chrome/browser/chromeos/dbus/power_manager_client.h
+++ b/chrome/browser/chromeos/dbus/power_manager_client.h
@@ -8,6 +8,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/callback.h"
namespace dbus {
class Bus;
@@ -32,6 +33,10 @@ struct PowerSupplyStatus {
const std::string& ToString() const;
};
+// Callback used for processing the idle time. The int64 param is the number of
+// seconds the user has been idle.
+typedef base::Callback<void(int64)> CalculateIdleTimeCallback;
+
// PowerManagerClient is used to communicate with the power manager.
class PowerManagerClient {
public:
@@ -68,6 +73,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
+ // encounters some error, it passes -1 to |callback|.
+ virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0;
+
// Creates the instance.
static PowerManagerClient* Create(dbus::Bus* bus);
« no previous file with comments | « chrome/browser/chromeos/dbus/mock_power_manager_client.h ('k') | chrome/browser/chromeos/dbus/power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698