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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void IdleActionImminentReceived(dbus::Signal* signal) { | 496 void IdleActionImminentReceived(dbus::Signal* signal) { |
497 dbus::MessageReader reader(signal); | 497 dbus::MessageReader reader(signal); |
498 power_manager::IdleActionImminent proto; | 498 power_manager::IdleActionImminent proto; |
499 if (!reader.PopArrayOfBytesAsProto(&proto)) { | 499 if (!reader.PopArrayOfBytesAsProto(&proto)) { |
500 LOG(ERROR) << "Unable to decode protocol buffer from " | 500 LOG(ERROR) << "Unable to decode protocol buffer from " |
501 << power_manager::kIdleActionImminentSignal << " signal"; | 501 << power_manager::kIdleActionImminentSignal << " signal"; |
502 return; | 502 return; |
503 } | 503 } |
504 FOR_EACH_OBSERVER(Observer, observers_, | 504 FOR_EACH_OBSERVER(Observer, observers_, |
505 IdleActionImminent(base::TimeDelta::FromInternalValue( | 505 IdleActionImminent(base::TimeDelta::FromInternalValue( |
506 proto.time_until_idle_action()))); | 506 proto.time_until_idle_action()))); |
507 } | 507 } |
508 | 508 |
509 void IdleActionDeferredReceived(dbus::Signal* signal) { | 509 void IdleActionDeferredReceived(dbus::Signal* signal) { |
510 FOR_EACH_OBSERVER(Observer, observers_, IdleActionDeferred()); | 510 FOR_EACH_OBSERVER(Observer, observers_, IdleActionDeferred()); |
511 } | 511 } |
512 | 512 |
513 void InputEventReceived(dbus::Signal* signal) { | 513 void InputEventReceived(dbus::Signal* signal) { |
514 dbus::MessageReader reader(signal); | 514 dbus::MessageReader reader(signal); |
515 power_manager::InputEvent proto; | 515 power_manager::InputEvent proto; |
516 if (!reader.PopArrayOfBytesAsProto(&proto)) { | 516 if (!reader.PopArrayOfBytesAsProto(&proto)) { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 // static | 889 // static |
890 PowerManagerClient* PowerManagerClient::Create( | 890 PowerManagerClient* PowerManagerClient::Create( |
891 DBusClientImplementationType type) { | 891 DBusClientImplementationType type) { |
892 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) | 892 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) |
893 return new PowerManagerClientImpl(); | 893 return new PowerManagerClientImpl(); |
894 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); | 894 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); |
895 return new PowerManagerClientStubImpl(); | 895 return new PowerManagerClientStubImpl(); |
896 } | 896 } |
897 | 897 |
898 } // namespace chromeos | 898 } // namespace chromeos |
OLD | NEW |