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

Side by Side Diff: chromeos/dbus/power_manager_client.h

Issue 240343004: chromeos: Update IdleActionImminent and SuspendDone handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 5 #ifndef CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 6 #define CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 // Called when the system is about to suspend. Suspend is deferred until 60 // Called when the system is about to suspend. Suspend is deferred until
61 // all observers' implementations of this method have finished running. 61 // all observers' implementations of this method have finished running.
62 // 62 //
63 // If an observer wishes to asynchronously delay suspend, 63 // If an observer wishes to asynchronously delay suspend,
64 // PowerManagerClient::GetSuspendReadinessCallback() may be called from 64 // PowerManagerClient::GetSuspendReadinessCallback() may be called from
65 // within SuspendImminent(). The returned callback must be called once 65 // within SuspendImminent(). The returned callback must be called once
66 // the observer is ready for suspend. 66 // the observer is ready for suspend.
67 virtual void SuspendImminent() {} 67 virtual void SuspendImminent() {}
68 68
69 // Called when a suspend attempt (previously announced via
70 // SuspendImminent()) has completed. The system may not have actually
71 // suspended (if e.g. the user canceled the suspend attempt).
72 virtual void SuspendDone(const base::TimeDelta& sleep_duration) {}
73
69 // Called when the power button is pressed or released. 74 // Called when the power button is pressed or released.
70 virtual void PowerButtonEventReceived(bool down, 75 virtual void PowerButtonEventReceived(bool down,
71 const base::TimeTicks& timestamp) {} 76 const base::TimeTicks& timestamp) {}
72 77
73 // Called when the device's lid is opened or closed. 78 // Called when the device's lid is opened or closed.
74 virtual void LidEventReceived(bool open, 79 virtual void LidEventReceived(bool open,
75 const base::TimeTicks& timestamp) {} 80 const base::TimeTicks& timestamp) {}
76 81
77 // Called when the system resumes from sleep. 82 // Called when the idle action will be performed after
78 virtual void SystemResumed(const base::TimeDelta& sleep_duration) {} 83 // |time_until_idle_action|.
79 84 virtual void IdleActionImminent(
80 // Called when the idle action will be performed soon. 85 const base::TimeDelta& time_until_idle_action) {}
81 virtual void IdleActionImminent() {}
82 86
83 // Called after IdleActionImminent() when the inactivity timer is reset 87 // Called after IdleActionImminent() when the inactivity timer is reset
84 // before the idle action has been performed. 88 // before the idle action has been performed.
85 virtual void IdleActionDeferred() {} 89 virtual void IdleActionDeferred() {}
86 }; 90 };
87 91
88 // Adds and removes the observer. 92 // Adds and removes the observer.
89 virtual void AddObserver(Observer* observer) = 0; 93 virtual void AddObserver(Observer* observer) = 0;
90 virtual void RemoveObserver(Observer* observer) = 0; 94 virtual void RemoveObserver(Observer* observer) = 0;
91 virtual bool HasObserver(Observer* observer) = 0; 95 virtual bool HasObserver(Observer* observer) = 0;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 // Create() should be used instead. 160 // Create() should be used instead.
157 PowerManagerClient(); 161 PowerManagerClient();
158 162
159 private: 163 private:
160 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); 164 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient);
161 }; 165 };
162 166
163 } // namespace chromeos 167 } // namespace chromeos
164 168
165 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ 169 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698