Chromium Code Reviews| 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 25 matching lines...) Expand all Loading... | |
| 36 return num_set_is_projecting_calls_; | 36 return num_set_is_projecting_calls_; |
| 37 } | 37 } |
| 38 bool is_projecting() const { return is_projecting_; } | 38 bool is_projecting() const { return is_projecting_; } |
| 39 bool have_video_activity_report() const { | 39 bool have_video_activity_report() const { |
| 40 return !video_activity_reports_.empty(); | 40 return !video_activity_reports_.empty(); |
| 41 } | 41 } |
| 42 int num_set_backlights_forced_off_calls() const { | 42 int num_set_backlights_forced_off_calls() const { |
| 43 return num_set_backlights_forced_off_calls_; | 43 return num_set_backlights_forced_off_calls_; |
| 44 } | 44 } |
| 45 | 45 |
| 46 void set_lid_state(LidState state) { lid_state_ = state; } | 46 void set_lid_state(LidState state) { lid_state_ = state; } |
|
Qiang(Joe) Xu
2017/04/13 04:14:18
set_lid_state is not used anywhere. Do we want to
Daniel Erat
2017/04/13 04:31:16
i think it's there so it can be used by future cod
Qiang(Joe) Xu
2017/04/13 04:49:40
Done.
| |
| 47 void set_tablet_mode(TabletMode mode) { tablet_mode_ = mode; } | 47 void set_tablet_mode(TabletMode mode) { tablet_mode_ = mode; } |
| 48 | 48 |
| 49 // PowerManagerClient overrides | 49 // PowerManagerClient overrides |
| 50 void Init(dbus::Bus* bus) override; | 50 void Init(dbus::Bus* bus) override; |
| 51 void AddObserver(Observer* observer) override; | 51 void AddObserver(Observer* observer) override; |
| 52 void RemoveObserver(Observer* observer) override; | 52 void RemoveObserver(Observer* observer) override; |
| 53 bool HasObserver(const Observer* observer) const override; | 53 bool HasObserver(const Observer* observer) const override; |
| 54 void SetRenderProcessManagerDelegate( | 54 void SetRenderProcessManagerDelegate( |
| 55 base::WeakPtr<RenderProcessManagerDelegate> delegate) override; | 55 base::WeakPtr<RenderProcessManagerDelegate> delegate) override; |
| 56 void DecreaseScreenBrightness(bool allow_off) override; | 56 void DecreaseScreenBrightness(bool allow_off) override; |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 86 void SendSuspendDone(); | 86 void SendSuspendDone(); |
| 87 void SendDarkSuspendImminent(); | 87 void SendDarkSuspendImminent(); |
| 88 | 88 |
| 89 // Emulates the power manager announcing that the system is changing | 89 // Emulates the power manager announcing that the system is changing |
| 90 // brightness to |level|. | 90 // brightness to |level|. |
| 91 void SendBrightnessChanged(int level, bool user_initiated); | 91 void SendBrightnessChanged(int level, bool user_initiated); |
| 92 | 92 |
| 93 // Notifies observers that the power button has been pressed or released. | 93 // Notifies observers that the power button has been pressed or released. |
| 94 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); | 94 void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp); |
| 95 | 95 |
| 96 // Notifies observers that LidState is switched to |state|. | |
| 97 void SendLidEvent(LidState state, const base::TimeTicks& timestamp); | |
|
Daniel Erat
2017/04/13 04:31:16
how about renaming this to SetLidState? that makes
Qiang(Joe) Xu
2017/04/13 04:49:40
agree. Done.
| |
| 98 | |
| 96 // Updates |props_| and notifies observers of its changes. | 99 // Updates |props_| and notifies observers of its changes. |
| 97 void UpdatePowerProperties( | 100 void UpdatePowerProperties( |
| 98 const power_manager::PowerSupplyProperties& power_props); | 101 const power_manager::PowerSupplyProperties& power_props); |
| 99 | 102 |
| 100 private: | 103 private: |
| 101 // Callback that will be run by asynchronous suspend delays to report | 104 // Callback that will be run by asynchronous suspend delays to report |
| 102 // readiness. | 105 // readiness. |
| 103 void HandleSuspendReadiness(); | 106 void HandleSuspendReadiness(); |
| 104 | 107 |
| 105 // Notifies |observers_| that |props_| has been updated. | 108 // Notifies |observers_| that |props_| has been updated. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // Note: This should remain the last member so it'll be destroyed and | 147 // Note: This should remain the last member so it'll be destroyed and |
| 145 // invalidate its weak pointers before any other members are destroyed. | 148 // invalidate its weak pointers before any other members are destroyed. |
| 146 base::WeakPtrFactory<FakePowerManagerClient> weak_ptr_factory_; | 149 base::WeakPtrFactory<FakePowerManagerClient> weak_ptr_factory_; |
| 147 | 150 |
| 148 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); | 151 DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient); |
| 149 }; | 152 }; |
| 150 | 153 |
| 151 } // namespace chromeos | 154 } // namespace chromeos |
| 152 | 155 |
| 153 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ | 156 #endif // CHROMEOS_DBUS_FAKE_POWER_MANAGER_CLIENT_H_ |
| OLD | NEW |