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 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); |