| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_POLICY_CONTROLLER_H_ | 5 #ifndef CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ |
| 6 #define CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | 6 #define CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 // Returns a string describing |policy|. Useful for tests. | 62 // Returns a string describing |policy|. Useful for tests. |
| 63 static std::string GetPolicyDebugString( | 63 static std::string GetPolicyDebugString( |
| 64 const power_manager::PowerManagementPolicy& policy); | 64 const power_manager::PowerManagementPolicy& policy); |
| 65 | 65 |
| 66 // Delay in milliseconds between the screen being turned off and the | 66 // Delay in milliseconds between the screen being turned off and the |
| 67 // screen being locked. Used if the |enable_screen_lock| pref is set but | 67 // screen being locked. Used if the |enable_screen_lock| pref is set but |
| 68 // |*_screen_lock_delay_ms| are unset or set to higher values than what | 68 // |*_screen_lock_delay_ms| are unset or set to higher values than what |
| 69 // this constant would imply. | 69 // this constant would imply. |
| 70 static const int kScreenLockAfterOffDelayMs; | 70 static const int kScreenLockAfterOffDelayMs; |
| 71 | 71 |
| 72 PowerPolicyController(DBusThreadManager* manager, PowerManagerClient* client); | 72 PowerPolicyController(); |
| 73 virtual ~PowerPolicyController(); | 73 virtual ~PowerPolicyController(); |
| 74 | 74 |
| 75 void Init(DBusThreadManager* manager); |
| 76 |
| 75 // Updates |prefs_policy_| with |values| and sends an updated policy. | 77 // Updates |prefs_policy_| with |values| and sends an updated policy. |
| 76 void ApplyPrefs(const PrefValues& values); | 78 void ApplyPrefs(const PrefValues& values); |
| 77 | 79 |
| 78 // Resets |prefs_policy_| to its defaults and sends an updated policy. | 80 // Resets |prefs_policy_| to its defaults and sends an updated policy. |
| 79 void ClearPrefs(); | 81 void ClearPrefs(); |
| 80 | 82 |
| 81 // Registers a request to temporarily prevent the screen from getting | 83 // Registers a request to temporarily prevent the screen from getting |
| 82 // dimmed or turned off or the system from suspending in response to user | 84 // dimmed or turned off or the system from suspending in response to user |
| 83 // inactivity and sends an updated policy. |reason| is a human-readable | 85 // inactivity and sends an updated policy. |reason| is a human-readable |
| 84 // description of the reason the lock was created. Returns a unique ID | 86 // description of the reason the lock was created. Returns a unique ID |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 131 |
| 130 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). | 132 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). |
| 131 int next_wake_lock_id_; | 133 int next_wake_lock_id_; |
| 132 | 134 |
| 133 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); | 135 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); |
| 134 }; | 136 }; |
| 135 | 137 |
| 136 } // namespace chromeos | 138 } // namespace chromeos |
| 137 | 139 |
| 138 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | 140 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ |
| OLD | NEW |