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

Unified Diff: chromeos/dbus/fake_power_manager_client.h

Issue 1206733002: ChromeOs Power Emulation Impl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Unittest Created 5 years, 6 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 d6cd0429f975b899ec2a64fc8f8158dce391a83d..b083452d5ed48cb4ee065c673186d7c3e34ecd5b 100644
--- a/chromeos/dbus/fake_power_manager_client.h
+++ b/chromeos/dbus/fake_power_manager_client.h
@@ -7,10 +7,9 @@
#include <string>
-#include "base/basictypes.h"
-#include "base/macros.h"
#include "base/observer_list.h"
#include "chromeos/dbus/power_manager/policy.pb.h"
+#include "chromeos/dbus/power_manager/power_supply_properties.pb.h"
#include "chromeos/dbus/power_manager/suspend.pb.h"
#include "chromeos/dbus/power_manager_client.h"
@@ -67,16 +66,32 @@ class FakePowerManagerClient : public PowerManagerClient {
// Notifies observers that the power button has been pressed or released.
void SendPowerButtonEvent(bool down, const base::TimeTicks& timestamp);
+ // Updates the PowerSupplyProperties and NotifyObservers of its changes.
Daniel Erat 2015/07/06 14:28:14 "NotifyObservers" -> "notifies observers"
mozartalouis 2015/07/06 20:49:42 Done.
+ void UpdatePowerProperties(
+ int battery_percent,
+ bool is_calculating_battery_time,
+ power_manager::PowerSupplyProperties::BatteryState battery_state,
+ power_manager::PowerSupplyProperties::ExternalPower external_power);
+
+ const power_manager::PowerSupplyProperties& props() { return props_; }
Daniel Erat 2015/07/06 14:28:14 please move props() up to where all the other acce
mozartalouis 2015/07/06 20:49:42 Done.
+
private:
// Callback that will be run by asynchronous suspend delays to report
// readiness.
void HandleSuspendReadiness();
+ // Tells TrayPower to update its contents to the Updated
Daniel Erat 2015/07/06 14:28:14 "Updated" -> "updated" this comment also shouldn'
mozartalouis 2015/07/06 20:49:42 Done.
+ // PowerSupplyProperties.
+ void NotifyObservers();
+
base::ObserverList<Observer> observers_;
// Last policy passed to SetPolicy().
power_manager::PowerManagementPolicy policy_;
+ // The power properties set for for the UI.
Daniel Erat 2015/07/06 14:28:14 this class doesn't know anything about the UI. how
mozartalouis 2015/07/06 20:49:42 Done.
+ power_manager::PowerSupplyProperties props_;
+
// Number of times that various methods have been called.
int num_request_restart_calls_;
int num_request_shutdown_calls_;

Powered by Google App Engine
This is Rietveld 408576698