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

Unified Diff: chromeos/dbus/power_manager_client.cc

Issue 15969004: chromeos: Resend projecting state to powerd on restart. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: resend projecting state from PowerManagerClient Created 7 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/power_manager_client.cc
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index ccf75a72ca188a19bf315793c9a787a43574ca7e..f6c8bac968a1d63ae64d4f61f51a9877f5a60c7e 100644
--- a/chromeos/dbus/power_manager_client.cc
+++ b/chromeos/dbus/power_manager_client.cc
@@ -49,6 +49,7 @@ class PowerManagerClientImpl : public PowerManagerClient {
pending_suspend_id_(-1),
suspend_is_pending_(false),
num_pending_suspend_readiness_callbacks_(0),
+ last_is_projecting_(false),
weak_ptr_factory_(this) {
power_manager_proxy_ = bus->GetObjectProxy(
power_manager::kPowerManagerServiceName,
@@ -299,6 +300,7 @@ class PowerManagerClientImpl : public PowerManagerClient {
&method_call,
dbus::ObjectProxy::TIMEOUT_USE_DEFAULT,
dbus::ObjectProxy::EmptyResponseCallback());
+ last_is_projecting_ = is_projecting;
}
virtual base::Closure GetSuspendReadinessCallback() OVERRIDE {
@@ -336,6 +338,7 @@ class PowerManagerClientImpl : public PowerManagerClient {
void NameOwnerChangedReceived(dbus::Signal* signal) {
VLOG(1) << "Power manager restarted";
RegisterSuspendDelay();
+ SetIsProjecting(last_is_projecting_);
FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted());
}
@@ -690,6 +693,9 @@ class PowerManagerClientImpl : public PowerManagerClient {
// suspend to memory.
base::Time last_suspend_wall_time_;
+ // Last state passed to SetIsProjecting().
+ bool last_is_projecting_;
+
// Note: This should remain the last member so it'll be destroyed and
// invalidate its weak pointers before any other members are destroyed.
base::WeakPtrFactory<PowerManagerClientImpl> weak_ptr_factory_;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698