| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 // events). | 159 // events). |
| 156 virtual void NotifyUserActivity( | 160 virtual void NotifyUserActivity( |
| 157 const base::TimeTicks& last_activity_time) = 0; | 161 const base::TimeTicks& last_activity_time) = 0; |
| 158 | 162 |
| 159 // Notifies the power manager that a video is currently playing. It also | 163 // Notifies the power manager that a video is currently playing. It also |
| 160 // includes whether or not the containing window for the video is fullscreen. | 164 // includes whether or not the containing window for the video is fullscreen. |
| 161 virtual void NotifyVideoActivity( | 165 virtual void NotifyVideoActivity( |
| 162 const base::TimeTicks& last_activity_time, | 166 const base::TimeTicks& last_activity_time, |
| 163 bool is_fullscreen) = 0; | 167 bool is_fullscreen) = 0; |
| 164 | 168 |
| 169 // Tells the power manager to begin using |policy|. |
| 170 virtual void SetPolicy( |
| 171 const power_manager::PowerManagementPolicy& policy) = 0; |
| 172 |
| 165 // Override the current power state on the machine. The overrides will be | 173 // Override the current power state on the machine. The overrides will be |
| 166 // applied to the request ID specified. To specify a new request; use 0 as the | 174 // applied to the request ID specified. To specify a new request; use 0 as the |
| 167 // request id and the method will call the provided callback with the new | 175 // request id and the method will call the provided callback with the new |
| 168 // request ID for use with further calls. |duration| will be rounded down to | 176 // request ID for use with further calls. |duration| will be rounded down to |
| 169 // the nearest second. The overrides parameter will & out the | 177 // the nearest second. The overrides parameter will & out the |
| 170 // PowerStateOverrideType types to allow specific selection of overrides. For | 178 // PowerStateOverrideType types to allow specific selection of overrides. For |
| 171 // example, to override just dim and suspending but leaving blanking in, set | 179 // example, to override just dim and suspending but leaving blanking in, set |
| 172 // overrides to, DISABLE_IDLE_DIM | DISABLE_IDLE_SUSPEND. | 180 // overrides to, DISABLE_IDLE_DIM | DISABLE_IDLE_SUSPEND. |
| 173 virtual void RequestPowerStateOverrides( | 181 virtual void RequestPowerStateOverrides( |
| 174 uint32 request_id, | 182 uint32 request_id, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 198 // Create() should be used instead. | 206 // Create() should be used instead. |
| 199 PowerManagerClient(); | 207 PowerManagerClient(); |
| 200 | 208 |
| 201 private: | 209 private: |
| 202 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); | 210 DISALLOW_COPY_AND_ASSIGN(PowerManagerClient); |
| 203 }; | 211 }; |
| 204 | 212 |
| 205 } // namespace chromeos | 213 } // namespace chromeos |
| 206 | 214 |
| 207 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ | 215 #endif // CHROMEOS_DBUS_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |