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_FAKE_POWER_MANAGER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 void SendDarkSuspendImminent(); | 80 void SendDarkSuspendImminent(); |
81 | 81 |
82 // Notifies observers that the power button has been pressed or released. | 82 // Notifies observers that the power button has been pressed or released. |
83 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); | 83 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); |
84 | 84 |
85 // Updates |props_| and notifies observers of its changes. | 85 // Updates |props_| and notifies observers of its changes. |
86 void UpdatePowerProperties( | 86 void UpdatePowerProperties( |
87 const power_manager::PowerSupplyProperties& power_props); | 87 const power_manager::PowerSupplyProperties& power_props); |
88 | 88 |
89 private: | 89 private: |
| 90 // Emulates the power manager announcing that the system is changing |
| 91 // brightness to |level|. |
| 92 void SendBrightnessChanged(int level, bool user_initiated); |
| 93 |
90 // Callback that will be run by asynchronous suspend delays to report | 94 // Callback that will be run by asynchronous suspend delays to report |
91 // readiness. | 95 // readiness. |
92 void HandleSuspendReadiness(); | 96 void HandleSuspendReadiness(); |
93 | 97 |
94 // Notifies |observers_| that |props_| has been updated. | 98 // Notifies |observers_| that |props_| has been updated. |
95 void NotifyObservers(); | 99 void NotifyObservers(); |
96 | 100 |
97 base::ObserverList<Observer> observers_; | 101 base::ObserverList<Observer> observers_; |
98 | 102 |
99 // Last policy passed to SetPolicy(). | 103 // Last policy passed to SetPolicy(). |
(...skipping 28 matching lines...) Expand all Loading... |
128 // Note: This should remain the last member so it'll be destroyed and | 132 // Note: This should remain the last member so it'll be destroyed and |
129 // invalidate its weak pointers before any other members are destroyed. | 133 // invalidate its weak pointers before any other members are destroyed. |
130 base::WeakPtrFactory<FakePowerManagerClient> weak_ptr_factory_; | 134 base::WeakPtrFactory<FakePowerManagerClient> weak_ptr_factory_; |
131 | 135 |
132 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); | 136 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); |
133 }; | 137 }; |
134 | 138 |
135 } // namespace chromeos | 139 } // namespace chromeos |
136 | 140 |
137 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ | 141 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ |
OLD | NEW |