| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // description of the reason the lock was created. Returns a unique ID | 83 // description of the reason the lock was created. Returns a unique ID |
| 84 // that can be passed to RemoveWakeLock() later. | 84 // that can be passed to RemoveWakeLock() later. |
| 85 int AddScreenWakeLock(const std::string& reason); | 85 int AddScreenWakeLock(const std::string& reason); |
| 86 int AddSystemWakeLock(const std::string& reason); | 86 int AddSystemWakeLock(const std::string& reason); |
| 87 | 87 |
| 88 // Unregisters a request previously created via AddScreenWakeLock() or | 88 // Unregisters a request previously created via AddScreenWakeLock() or |
| 89 // AddSystemWakeLock() and sends an updated policy. | 89 // AddSystemWakeLock() and sends an updated policy. |
| 90 void RemoveWakeLock(int id); | 90 void RemoveWakeLock(int id); |
| 91 | 91 |
| 92 // PowerManagerClient::Observer implementation: | 92 // PowerManagerClient::Observer implementation: |
| 93 virtual void PowerManagerRestarted() OVERRIDE; | 93 virtual void PowerManagerRestarted() override; |
| 94 | 94 |
| 95 private: | 95 private: |
| 96 friend class PowerPrefsTest; | 96 friend class PowerPrefsTest; |
| 97 | 97 |
| 98 typedef std::map<int, std::string> WakeLockMap; | 98 typedef std::map<int, std::string> WakeLockMap; |
| 99 | 99 |
| 100 // Sends a policy based on |prefs_policy_| to the power manager. | 100 // Sends a policy based on |prefs_policy_| to the power manager. |
| 101 void SendCurrentPolicy(); | 101 void SendCurrentPolicy(); |
| 102 | 102 |
| 103 PowerManagerClient* client_; // weak | 103 PowerManagerClient* client_; // weak |
| (...skipping 16 matching lines...) Expand all Loading... |
| 120 | 120 |
| 121 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). | 121 // Next ID to be used by AddScreenWakeLock() or AddSystemWakeLock(). |
| 122 int next_wake_lock_id_; | 122 int next_wake_lock_id_; |
| 123 | 123 |
| 124 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); | 124 DISALLOW_COPY_AND_ASSIGN(PowerPolicyController); |
| 125 }; | 125 }; |
| 126 | 126 |
| 127 } // namespace chromeos | 127 } // namespace chromeos |
| 128 | 128 |
| 129 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ | 129 #endif // CHROMEOS_DBUS_POWER_POLICY_CONTROLLER_H_ |
| OLD | NEW |