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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // Make a method call to power manager with no arguments and no response. | 331 // Make a method call to power manager with no arguments and no response. |
332 void SimpleMethodCallToPowerManager(const std::string& method_name) { | 332 void SimpleMethodCallToPowerManager(const std::string& method_name) { |
333 dbus::MethodCall method_call(power_manager::kPowerManagerInterface, | 333 dbus::MethodCall method_call(power_manager::kPowerManagerInterface, |
334 method_name); | 334 method_name); |
335 power_manager_proxy_->CallMethod( | 335 power_manager_proxy_->CallMethod( |
336 &method_call, | 336 &method_call, |
337 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, | 337 dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, |
338 dbus::ObjectProxy::EmptyResponseCallback()); | 338 dbus::ObjectProxy::EmptyResponseCallback()); |
339 } | 339 } |
340 | 340 |
341 void NameOwnerChangedReceived(dbus::Signal* signal) { | 341 void NameOwnerChangedReceived(const std::string& old_owner, |
| 342 const std::string& new_owner) { |
342 VLOG(1) << "Power manager restarted"; | 343 VLOG(1) << "Power manager restarted"; |
343 RegisterSuspendDelay(); | 344 RegisterSuspendDelay(); |
344 SetIsProjecting(last_is_projecting_); | 345 SetIsProjecting(last_is_projecting_); |
345 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); | 346 FOR_EACH_OBSERVER(Observer, observers_, PowerManagerRestarted()); |
346 } | 347 } |
347 | 348 |
348 void BrightnessChangedReceived(dbus::Signal* signal) { | 349 void BrightnessChangedReceived(dbus::Signal* signal) { |
349 dbus::MessageReader reader(signal); | 350 dbus::MessageReader reader(signal); |
350 int32 brightness_level = 0; | 351 int32 brightness_level = 0; |
351 bool user_initiated = 0; | 352 bool user_initiated = 0; |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 // static | 862 // static |
862 PowerManagerClient* PowerManagerClient::Create( | 863 PowerManagerClient* PowerManagerClient::Create( |
863 DBusClientImplementationType type) { | 864 DBusClientImplementationType type) { |
864 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 865 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
865 return new PowerManagerClientImpl(); | 866 return new PowerManagerClientImpl(); |
866 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 867 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
867 return new PowerManagerClientStubImpl(); | 868 return new PowerManagerClientStubImpl(); |
868 } | 869 } |
869 | 870 |
870 } // namespace chromeos | 871 } // namespace chromeos |
OLD | NEW |