Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5202)

Unified Diff: chromeos/dbus/fake_power_manager_client.h

Issue 2768543002: chromeos: Add PowerManagerClient::GetSwitchStates(). (Closed)
Patch Set: document that callbacks aren't run on error Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/BUILD.gn ('k') | chromeos/dbus/fake_power_manager_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/fake_power_manager_client.h
diff --git a/chromeos/dbus/fake_power_manager_client.h b/chromeos/dbus/fake_power_manager_client.h
index 6cd57a5e04063939d1f4e7f4c3795a68c4fe49d4..d408729a125a8e065c7f7d3bbbd45129539756a8 100644
--- a/chromeos/dbus/fake_power_manager_client.h
+++ b/chromeos/dbus/fake_power_manager_client.h
@@ -43,6 +43,9 @@ class CHROMEOS_EXPORT FakePowerManagerClient : public PowerManagerClient {
return num_set_backlights_forced_off_calls_;
}
+ void set_lid_state(LidState state) { lid_state_ = state; }
+ void set_tablet_mode(TabletMode mode) { tablet_mode_ = mode; }
+
// PowerManagerClient overrides
void Init(dbus::Bus* bus) override;
void AddObserver(Observer* observer) override;
@@ -69,6 +72,7 @@ class CHROMEOS_EXPORT FakePowerManagerClient : public PowerManagerClient {
void SetBacklightsForcedOff(bool forced_off) override;
void GetBacklightsForcedOff(
const GetBacklightsForcedOffCallback& callback) override;
+ void GetSwitchStates(const GetSwitchStatesCallback& callback) override;
base::Closure GetSuspendReadinessCallback() override;
int GetNumPendingSuspendReadinessCallbacks() override;
@@ -110,21 +114,25 @@ class CHROMEOS_EXPORT FakePowerManagerClient : public PowerManagerClient {
power_manager::PowerSupplyProperties props_;
// Number of times that various methods have been called.
- int num_request_restart_calls_;
- int num_request_shutdown_calls_;
- int num_set_policy_calls_;
- int num_set_is_projecting_calls_;
- int num_set_backlights_forced_off_calls_;
+ int num_request_restart_calls_ = 0;
+ int num_request_shutdown_calls_ = 0;
+ int num_set_policy_calls_ = 0;
+ int num_set_is_projecting_calls_ = 0;
+ int num_set_backlights_forced_off_calls_ = 0;
// Number of pending suspend readiness callbacks.
- int num_pending_suspend_readiness_callbacks_;
+ int num_pending_suspend_readiness_callbacks_ = 0;
// Last projecting state set in SetIsProjecting().
- bool is_projecting_;
+ bool is_projecting_ = false;
// Display and keyboard backlights (if present) forced off state set in
// SetBacklightsForcedOff().
- bool backlights_forced_off_;
+ bool backlights_forced_off_ = false;
+
+ // States returned by GetSwitchStates().
+ LidState lid_state_ = LidState::OPEN;
+ TabletMode tablet_mode_ = TabletMode::UNSUPPORTED;
// Video activity reports that we were requested to send, in the order they
// were requested. True if fullscreen.
« no previous file with comments | « chromeos/BUILD.gn ('k') | chromeos/dbus/fake_power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698