OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chromeos/dbus/power_manager_client.h" | 5 #include "chromeos/dbus/power_manager_client.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 340 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
341 dbus::ObjectProxy::EmptyResponseCallback()); | 341 dbus::ObjectProxy::EmptyResponseCallback()); |
342 } | 342 } |
343 | 343 |
344 void NameOwnerChangedReceived(const std::string& old_owner, | 344 void NameOwnerChangedReceived(const std::string& old_owner, |
345 const std::string& new_owner) { | 345 const std::string& new_owner) { |
346 VLOG(1) << "Power manager restarted (old owner was " | 346 VLOG(1) << "Power manager restarted (old owner was " |
347 << (old_owner.empty() ? "[none]" : old_owner.c_str()) | 347 << (old_owner.empty() ? "[none]" : old_owner.c_str()) |
348 << ", new owner is " | 348 << ", new owner is " |
349 << (new_owner.empty() ? "[none]" : new_owner.c_str()) << ")"; | 349 << (new_owner.empty() ? "[none]" : new_owner.c_str()) << ")"; |
| 350 suspend_is_pending_ = false; |
| 351 pending_suspend_id_ = -1; |
| 352 suspending_from_dark_resume_ = false; |
350 if (!new_owner.empty()) { | 353 if (!new_owner.empty()) { |
351 VLOG(1) << "Sending initial state to power manager"; | 354 VLOG(1) << "Sending initial state to power manager"; |
352 RegisterSuspendDelays(); | 355 RegisterSuspendDelays(); |
353 SetIsProjecting(last_is_projecting_); | 356 SetIsProjecting(last_is_projecting_); |
354 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); | 357 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); |
355 } | 358 } |
356 } | 359 } |
357 | 360 |
358 void BrightnessChangedReceived(dbus::Signal* signal) { | 361 void BrightnessChangedReceived(dbus::Signal* signal) { |
359 dbus::MessageReader reader(signal); | 362 dbus::MessageReader reader(signal); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 // static | 954 // static |
952 PowerManagerClient* PowerManagerClient::Create( | 955 PowerManagerClient* PowerManagerClient::Create( |
953 DBusClientImplementationType type) { | 956 DBusClientImplementationType type) { |
954 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 957 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
955 return new PowerManagerClientImpl(); | 958 return new PowerManagerClientImpl(); |
956 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 959 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
957 return new PowerManagerClientStubImpl(); | 960 return new PowerManagerClientStubImpl(); |
958 } | 961 } |
959 | 962 |
960 } // namespace chromeos | 963 } // namespace chromeos |
OLD | NEW |