| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 bool allow_screen_wake_locks; | 54 bool allow_screen_wake_locks; |
| 55 bool enable_screen_lock; | 55 bool enable_screen_lock; |
| 56 double presentation_idle_delay_factor; | 56 double presentation_idle_delay_factor; |
| 57 double user_activity_screen_dim_delay_factor; | 57 double user_activity_screen_dim_delay_factor; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 // Returns a string describing |policy|. Useful for tests. | 60 // Returns a string describing |policy|. Useful for tests. |
| 61 static std::string GetPolicyDebugString( | 61 static std::string GetPolicyDebugString( |
| 62 const power_manager::PowerManagementPolicy& policy); | 62 const power_manager::PowerManagementPolicy& policy); |
| 63 | 63 |
| 64 // Delay in milliseconds between the screen being turned off and the |
| 65 // screen being locked. Used if the |enable_screen_lock| pref is set but |
| 66 // |*_screen_lock_delay_ms| are unset or set to higher values than what |
| 67 // this constant would imply. |
| 68 const static int kScreenLockAfterOffDelayMs; |
| 69 |
| 64 PowerPolicyController(DBusThreadManager* manager, PowerManagerClient* client); | 70 PowerPolicyController(DBusThreadManager* manager, PowerManagerClient* client); |
| 65 virtual ~PowerPolicyController(); | 71 virtual ~PowerPolicyController(); |
| 66 | 72 |
| 67 // Updates |prefs_policy_| with |values| and sends an updated policy. | 73 // Updates |prefs_policy_| with |values| and sends an updated policy. |
| 68 void ApplyPrefs(const PrefValues& values); | 74 void ApplyPrefs(const PrefValues& values); |
| 69 | 75 |
| 70 // Registers a request to temporarily prevent the screen from getting | 76 // Registers a request to temporarily prevent the screen from getting |
| 71 // dimmed or turned off or the system from suspending in response to user | 77 // dimmed or turned off or the system from suspending in response to user |
| 72 // inactivity and sends an updated policy. |reason| is a human-readable | 78 // inactivity and sends an updated policy. |reason| is a human-readable |
| 73 // description of the reason the lock was created. Returns a unique ID | 79 // description of the reason the lock was created. Returns a unique ID |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 122 |
| 117 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). | 123 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). |
| 118 int next_wake_lock_id_; | 124 int next_wake_lock_id_; |
| 119 | 125 |
| 120 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); | 126 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); |
| 121 }; | 127 }; |
| 122 | 128 |
| 123 } // namespace chromeos | 129 } // namespace chromeos |
| 124 | 130 |
| 125 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | 131 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ |
| OLD | NEW |