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

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

Issue 9265026: Implement restart on Idle for Kiosk Mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments. Created 8 years, 10 months 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 d5eb2022b14d88702c3b02681fb319edb13f63a6..ff6c655bfcefb6b2f5b951ba79776474aafdea22 100644
--- a/chrome/browser/chromeos/dbus/power_manager_client.h
+++ b/chrome/browser/chromeos/dbus/power_manager_client.h
@@ -39,6 +39,7 @@ struct PowerSupplyStatus {
// 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;
+typedef base::Callback<void(void)> IdleNotificationCallback;
// PowerManagerClient is used to communicate with the power manager.
class PowerManagerClient {
@@ -76,6 +77,12 @@ class PowerManagerClient {
// Called when the screen fails to unlock.
virtual void UnlockScreenFailed() {}
+
+ // Called when we go idle for threshold time.
+ virtual void IdleNotify(int64 threshold_secs) {}
+
+ // Called when we go from idle to active.
+ virtual void ActiveNotify() {}
};
// Adds and removes the observer.
@@ -99,11 +106,6 @@ 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;
-
// Notifies PowerManager that a user requested to lock the screen.
virtual void NotifyScreenLockRequested() = 0;
@@ -116,6 +118,24 @@ class PowerManagerClient {
// Notifies PowerManager that screen is unlocked.
virtual void NotifyScreenUnlockCompleted() = 0;
+ // Idle management function:
+
+ // 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;
+
+ // Request notification for Idle at a certain threshold
+ // NOTE: This notification is one shot, once the machine has been idle for
+ // threshold time, a notification will be sent and then that request will be
+ // removed from the notification queue. If you wish notifications the next
+ // time the machine goes idle for that much time, request again.
+ virtual void RequestIdleNotification(int64 threshold_secs) = 0;
+
+ // Requests that the observers be notified in case of an Idle->Active event.
+ // NOTE: Like the previous request, this will also get triggered exactly once.
+ virtual void RequestActiveNotification() = 0;
+
// Creates the instance.
static PowerManagerClient* Create(dbus::Bus* bus);

Powered by Google App Engine
This is Rietveld 408576698