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

Unified Diff: chromeos/dbus/fake_power_manager_client.h

Issue 129303003: Revert of Revert of chromeos: Don't send empty power management policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
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 ae1adc561ec155ad5536d3b37d90b101468aa3db..61ad67391d4747471c62f6b865f3b965a4816ec8 100644
--- a/chromeos/dbus/fake_power_manager_client.h
+++ b/chromeos/dbus/fake_power_manager_client.h
@@ -24,6 +24,14 @@
FakePowerManagerClient();
virtual ~FakePowerManagerClient();
+ power_manager::PowerManagementPolicy& policy() { return policy_; }
+ int num_request_restart_calls() const {
+ return num_request_restart_calls_;
+ }
+ int num_set_policy_calls() const {
+ return num_set_policy_calls_;
+ }
+
// PowerManagerClient overrides
virtual void Init(dbus::Bus* bus) OVERRIDE;
virtual void AddObserver(Observer* observer) OVERRIDE;
@@ -49,13 +57,6 @@
virtual base::Closure GetSuspendReadinessCallback() OVERRIDE;
virtual int GetNumPendingSuspendReadinessCallbacks() OVERRIDE;
- power_manager::PowerManagementPolicy& get_policy() { return policy_; }
-
- // Returns how many times RequestRestart() was called.
- int request_restart_call_count() const {
- return request_restart_call_count_;
- }
-
// Emulates that the dbus server sends a message "SuspendImminent" to the
// client.
void SendSuspendImminent();
@@ -66,10 +67,19 @@
const power_manager::SuspendState& suspend_state);
private:
+ ObserverList<Observer> observers_;
+
+ // Last policy passed to SetPolicy().
power_manager::PowerManagementPolicy policy_;
+
+ // Last time passed to a SUSPEND_TO_MEMORY call to SendSuspendStateChanged().
base::Time last_suspend_wall_time_;
- ObserverList<Observer> observers_;
- int request_restart_call_count_;
+
+ // Number of times that RequestRestart() has been called.
+ int num_request_restart_calls_;
+
+ // Number of times that SetPolicy() has been called.
+ int num_set_policy_calls_;
DISALLOW_COPY_AND_ASSIGN(FakePowerManagerClient);
};
« no previous file with comments | « chrome/browser/chromeos/system/automatic_reboot_manager_unittest.cc ('k') | chromeos/dbus/fake_power_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698