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" |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "chromeos/chromeos_export.h" | 13 #include "chromeos/chromeos_export.h" |
14 #include "chromeos/dbus/dbus_client_implementation_type.h" | 14 #include "chromeos/dbus/dbus_client_implementation_type.h" |
15 | 15 |
16 #include "chromeos/dbus/power_supply_status.h" | 16 #include "chromeos/dbus/power_supply_status.h" |
17 | 17 |
18 namespace dbus { | 18 namespace dbus { |
19 class Bus; | 19 class Bus; |
20 } | 20 } |
21 | 21 |
| 22 namespace power_manager { |
| 23 class PowerManagementPolicy; |
| 24 } |
| 25 |
22 namespace chromeos { | 26 namespace chromeos { |
23 | 27 |
24 // Callback used for processing the idle time. The int64 param is the number of | 28 // Callback used for processing the idle time. The int64 param is the number of |
25 // seconds the user has been idle. | 29 // seconds the user has been idle. |
26 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; | 30 typedef base::Callback<void(int64)> CalculateIdleTimeCallback; |
27 typedef base::Callback<void(void)> IdleNotificationCallback; | 31 typedef base::Callback<void(void)> IdleNotificationCallback; |
28 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback; | 32 typedef base::Callback<void(uint32)> PowerStateRequestIdCallback; |
29 | 33 |
30 // Callback used for getting the current screen brightness. The param is in the | 34 // Callback used for getting the current screen brightness. The param is in the |
31 // range [0.0, 100.0]. | 35 // range [0.0, 100.0]. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // events). | 162 // events). |
159 virtual void NotifyUserActivity( | 163 virtual void NotifyUserActivity( |
160 const base::TimeTicks& last_activity_time) = 0; | 164 const base::TimeTicks& last_activity_time) = 0; |
161 | 165 |
162 // Notifies the power manager that a video is currently playing. It also | 166 // Notifies the power manager that a video is currently playing. It also |
163 // includes whether or not the containing window for the video is fullscreen. | 167 // includes whether or not the containing window for the video is fullscreen. |
164 virtual void NotifyVideoActivity( | 168 virtual void NotifyVideoActivity( |
165 const base::TimeTicks& last_activity_time, | 169 const base::TimeTicks& last_activity_time, |
166 bool is_fullscreen) = 0; | 170 bool is_fullscreen) = 0; |
167 | 171 |
| 172 // Tells the power manager to begin using |policy|. |
| 173 virtual void SetPolicy( |
| 174 const power_manager::PowerManagementPolicy& policy) = 0; |
| 175 |
168 // Override the current power state on the machine. The overrides will be | 176 // Override the current power state on the machine. The overrides will be |
169 // applied to the request ID specified. To specify a new request; use 0 as the | 177 // applied to the request ID specified. To specify a new request; use 0 as the |
170 // request id and the method will call the provided callback with the new | 178 // request id and the method will call the provided callback with the new |
171 // request ID for use with further calls. |duration| will be rounded down to | 179 // request ID for use with further calls. |duration| will be rounded down to |
172 // the nearest second. The overrides parameter will & out the | 180 // the nearest second. The overrides parameter will & out the |
173 // PowerStateOverrideType types to allow specific selection of overrides. For | 181 // PowerStateOverrideType types to allow specific selection of overrides. For |
174 // example, to override just dim and suspending but leaving blanking in, set | 182 // example, to override just dim and suspending but leaving blanking in, set |
175 // overrides to, DISABLE_IDLE_DIM | DISABLE_IDLE_SUSPEND. | 183 // overrides to, DISABLE_IDLE_DIM | DISABLE_IDLE_SUSPEND. |
176 virtual void RequestPowerStateOverrides( | 184 virtual void RequestPowerStateOverrides( |
177 uint32 request_id, | 185 uint32 request_id, |
(...skipping 23 matching lines...) Expand all Loading... |
201 // Create() should be used instead. | 209 // Create() should be used instead. |
202 PowerManagerClient(); | 210 PowerManagerClient(); |
203 | 211 |
204 private: | 212 private: |
205 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 213 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
206 }; | 214 }; |
207 | 215 |
208 } // namespace chromeos | 216 } // namespace chromeos |
209 | 217 |
210 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 218 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
OLD | NEW |