| OLD | NEW |
| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 virtual void SystemResumed() {} | 67 virtual void SystemResumed() {} |
| 68 | 68 |
| 69 // Called when the power button is pressed or released. | 69 // Called when the power button is pressed or released. |
| 70 virtual void PowerButtonStateChanged(bool down, | 70 virtual void PowerButtonStateChanged(bool down, |
| 71 const base::TimeTicks& timestamp) {} | 71 const base::TimeTicks& timestamp) {} |
| 72 | 72 |
| 73 // Called when the lock button is pressed or released. | 73 // Called when the lock button is pressed or released. |
| 74 virtual void LockButtonStateChanged(bool down, | 74 virtual void LockButtonStateChanged(bool down, |
| 75 const base::TimeTicks& timestamp) {} | 75 const base::TimeTicks& timestamp) {} |
| 76 | 76 |
| 77 // Called when the screen is locked. | |
| 78 virtual void LockScreen() {} | |
| 79 | |
| 80 // Called when the screen is unlocked. | |
| 81 virtual void UnlockScreen() {} | |
| 82 | |
| 83 // Called when we go idle for threshold time. | 77 // Called when we go idle for threshold time. |
| 84 virtual void IdleNotify(int64 threshold_secs) {} | 78 virtual void IdleNotify(int64 threshold_secs) {} |
| 85 | 79 |
| 86 // Called when we go from idle to active. | 80 // Called when we go from idle to active. |
| 87 virtual void ActiveNotify() {} | 81 virtual void ActiveNotify() {} |
| 88 | 82 |
| 89 // Called when a request is received to dim or undim the screen in software | 83 // Called when a request is received to dim or undim the screen in software |
| 90 // (as opposed to the more-common method of adjusting the backlight). | 84 // (as opposed to the more-common method of adjusting the backlight). |
| 91 virtual void ScreenDimmingRequested(ScreenDimmingState state) {} | 85 virtual void ScreenDimmingRequested(ScreenDimmingState state) {} |
| 92 }; | 86 }; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 | 121 |
| 128 // Request for power supply status update. | 122 // Request for power supply status update. |
| 129 virtual void RequestStatusUpdate(UpdateRequestType update_type) = 0; | 123 virtual void RequestStatusUpdate(UpdateRequestType update_type) = 0; |
| 130 | 124 |
| 131 // Requests restart of the system. | 125 // Requests restart of the system. |
| 132 virtual void RequestRestart() = 0; | 126 virtual void RequestRestart() = 0; |
| 133 | 127 |
| 134 // Requests shutdown of the system. | 128 // Requests shutdown of the system. |
| 135 virtual void RequestShutdown() = 0; | 129 virtual void RequestShutdown() = 0; |
| 136 | 130 |
| 137 // Notifies PowerManager that a user requested to lock the screen. | |
| 138 virtual void NotifyScreenLockRequested() = 0; | |
| 139 | |
| 140 // Notifies PowerManager that screen lock has been completed. | 131 // Notifies PowerManager that screen lock has been completed. |
| 141 virtual void NotifyScreenLockCompleted() = 0; | 132 virtual void NotifyScreenLockCompleted() = 0; |
| 142 | 133 |
| 143 // Notifies PowerManager that a user unlocked the screen. | |
| 144 virtual void NotifyScreenUnlockRequested() = 0; | |
| 145 | |
| 146 // Notifies PowerManager that screen is unlocked. | 134 // Notifies PowerManager that screen is unlocked. |
| 147 virtual void NotifyScreenUnlockCompleted() = 0; | 135 virtual void NotifyScreenUnlockCompleted() = 0; |
| 148 | 136 |
| 149 // Return whether or not the screen is locked. Implementation should cache | |
| 150 // this state so that it can return immediately. Useful for observers that | |
| 151 // need to know the current screen lock state when they are added. | |
| 152 virtual bool GetIsScreenLocked() = 0; | |
| 153 | |
| 154 // Idle management functions: | 137 // Idle management functions: |
| 155 | 138 |
| 156 // Calculates idle time asynchronously, after the idle time request has | 139 // Calculates idle time asynchronously, after the idle time request has |
| 157 // replied. It passes the idle time in seconds to |callback|. If it | 140 // replied. It passes the idle time in seconds to |callback|. If it |
| 158 // encounters some error, it passes -1 to |callback|. | 141 // encounters some error, it passes -1 to |callback|. |
| 159 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0; | 142 virtual void CalculateIdleTime(const CalculateIdleTimeCallback& callback) = 0; |
| 160 | 143 |
| 161 // Requests notification for Idle at a certain threshold. | 144 // Requests notification for Idle at a certain threshold. |
| 162 // NOTE: This notification is one shot, once the machine has been idle for | 145 // NOTE: This notification is one shot, once the machine has been idle for |
| 163 // threshold time, a notification will be sent and then that request will be | 146 // threshold time, a notification will be sent and then that request will be |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // Create() should be used instead. | 185 // Create() should be used instead. |
| 203 PowerManagerClient(); | 186 PowerManagerClient(); |
| 204 | 187 |
| 205 private: | 188 private: |
| 206 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 189 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 207 }; | 190 }; |
| 208 | 191 |
| 209 } // namespace chromeos | 192 } // namespace chromeos |
| 210 | 193 |
| 211 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 194 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |