blob: c8a19e3f2df8c21b8f9b9851d4ba04162be1f251 [file] [log] [blame]
Darin Petkov5c97ac52011-07-19 16:30:49 -07001// 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/dbus_properties_proxy.h"
6
7#include <base/logging.h>
8
Darin Petkov5c97ac52011-07-19 16:30:49 -07009namespace shill {
10
Darin Petkov5c97ac52011-07-19 16:30:49 -070011using std::string;
12using std::vector;
13
Darin Petkovc5f56562011-08-06 16:40:05 -070014DBusPropertiesProxy::DBusPropertiesProxy(DBusPropertiesProxyListener *listener,
15 DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070016 const string &path,
17 const string &service)
Darin Petkovc5f56562011-08-06 16:40:05 -070018 : proxy_(listener, connection, path, service) {}
Darin Petkov5c97ac52011-07-19 16:30:49 -070019
20DBusPropertiesProxy::~DBusPropertiesProxy() {}
21
Darin Petkove0a312e2011-07-20 13:45:28 -070022DBusPropertiesMap DBusPropertiesProxy::GetAll(const string &interface_name) {
Darin Petkov5c97ac52011-07-19 16:30:49 -070023 return proxy_.GetAll(interface_name);
24}
25
Darin Petkovc5f56562011-08-06 16:40:05 -070026DBusPropertiesProxy::Proxy::Proxy(DBusPropertiesProxyListener *listener,
27 DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070028 const string &path,
29 const string &service)
30 : DBus::ObjectProxy(*connection, path, service.c_str()),
Darin Petkovc5f56562011-08-06 16:40:05 -070031 listener_(listener) {}
Darin Petkov5c97ac52011-07-19 16:30:49 -070032
33DBusPropertiesProxy::Proxy::~Proxy() {}
34
35void DBusPropertiesProxy::Proxy::MmPropertiesChanged(
36 const string &interface,
Darin Petkove0a312e2011-07-20 13:45:28 -070037 const DBusPropertiesMap &properties) {
Darin Petkovc5f56562011-08-06 16:40:05 -070038 VLOG(2) << __func__ << "(" << interface << ")";
39 listener_->OnModemManagerPropertiesChanged(interface, properties);
Darin Petkov5c97ac52011-07-19 16:30:49 -070040}
41
42void DBusPropertiesProxy::Proxy::PropertiesChanged(
43 const string &interface,
Darin Petkove0a312e2011-07-20 13:45:28 -070044 const DBusPropertiesMap &changed_properties,
Darin Petkov5c97ac52011-07-19 16:30:49 -070045 const vector<string> &invalidated_properties) {
Darin Petkovc5f56562011-08-06 16:40:05 -070046 VLOG(2) << __func__ << "(" << interface << ")";
47 listener_->OnDBusPropertiesChanged(
48 interface, changed_properties, invalidated_properties);
Darin Petkov5c97ac52011-07-19 16:30:49 -070049}
50
51} // namespace shill