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