Darin Petkov | 394b7d4 | 2011-11-03 15:48:02 +0100 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/power_manager_proxy.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | #include <chromeos/dbus/service_constants.h> |
| 9 | |
| 10 | namespace shill { |
| 11 | |
| 12 | PowerManagerProxy::PowerManagerProxy(PowerManagerProxyDelegate *delegate, |
| 13 | DBus::Connection *connection) |
| 14 | : proxy_(delegate, connection) {} |
| 15 | |
| 16 | PowerManagerProxy::~PowerManagerProxy() {} |
| 17 | |
| 18 | void PowerManagerProxy::RegisterSuspendDelay(uint32 delay_ms) { |
| 19 | proxy_.RegisterSuspendDelay(delay_ms); |
| 20 | } |
| 21 | |
| 22 | PowerManagerProxy::Proxy::Proxy(PowerManagerProxyDelegate *delegate, |
| 23 | DBus::Connection *connection) |
| 24 | : DBus::ObjectProxy(*connection, |
| 25 | power_manager::kPowerManagerServicePath, |
| 26 | power_manager::kPowerManagerServiceName), |
| 27 | delegate_(delegate) {} |
| 28 | |
| 29 | PowerManagerProxy::Proxy::~Proxy() {} |
| 30 | |
| 31 | void PowerManagerProxy::Proxy::SuspendDelay(const uint32_t &sequence_number) { |
| 32 | VLOG(2) << __func__ << "(" << sequence_number << ")"; |
| 33 | delegate_->OnSuspendDelay(sequence_number); |
| 34 | } |
| 35 | |
| 36 | } // namespace shill |