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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // Emulates the power manager announcing that the system is starting or | 60 // Emulates the power manager announcing that the system is starting or |
61 // completing a suspend attempt. | 61 // completing a suspend attempt. |
62 void SendSuspendImminent(); | 62 void SendSuspendImminent(); |
63 void SendSuspendDone(); | 63 void SendSuspendDone(); |
64 void SendDarkSuspendImminent(); | 64 void SendDarkSuspendImminent(); |
65 | 65 |
66 // Notifies observers that the power button has been pressed or released. | 66 // Notifies observers that the power button has been pressed or released. |
67 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); | 67 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); |
68 | 68 |
69 private: | 69 private: |
| 70 // Callback that will be run by asynchronous suspend delays to report |
| 71 // readiness. |
| 72 void HandleSuspendReadiness(); |
| 73 |
70 ObserverList<Observer> observers_; | 74 ObserverList<Observer> observers_; |
71 | 75 |
72 // Last policy passed to SetPolicy(). | 76 // Last policy passed to SetPolicy(). |
73 power_manager::PowerManagementPolicy policy_; | 77 power_manager::PowerManagementPolicy policy_; |
74 | 78 |
75 // Number of times that various methods have been called. | 79 // Number of times that various methods have been called. |
76 int num_request_restart_calls_; | 80 int num_request_restart_calls_; |
77 int num_request_shutdown_calls_; | 81 int num_request_shutdown_calls_; |
78 int num_set_policy_calls_; | 82 int num_set_policy_calls_; |
79 int num_set_is_projecting_calls_; | 83 int num_set_is_projecting_calls_; |
80 | 84 |
| 85 // Number of pending suspend readiness callbacks. |
| 86 int num_pending_suspend_readiness_callbacks_; |
| 87 |
81 // Last projecting state set in SetIsProjecting(). | 88 // Last projecting state set in SetIsProjecting(). |
82 bool is_projecting_; | 89 bool is_projecting_; |
83 | 90 |
84 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); | 91 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); |
85 }; | 92 }; |
86 | 93 |
87 } // namespace chromeos | 94 } // namespace chromeos |
88 | 95 |
89 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ | 96 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ |
OLD | NEW |