Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [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/dbus_properties_proxy.h" |
| 6 | |
| 7 | #include <base/logging.h> |
| 8 | |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 9 | namespace shill { |
| 10 | |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 11 | using std::string; |
| 12 | using std::vector; |
| 13 | |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 14 | DBusPropertiesProxy::DBusPropertiesProxy(DBusPropertiesProxyListener *listener, |
| 15 | DBus::Connection *connection, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 16 | const string &path, |
| 17 | const string &service) |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 18 | : proxy_(listener, connection, path, service) {} |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 19 | |
| 20 | DBusPropertiesProxy::~DBusPropertiesProxy() {} |
| 21 | |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 22 | DBusPropertiesMap DBusPropertiesProxy::GetAll(const string &interface_name) { |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 23 | return proxy_.GetAll(interface_name); |
| 24 | } |
| 25 | |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 26 | DBusPropertiesProxy::Proxy::Proxy(DBusPropertiesProxyListener *listener, |
| 27 | DBus::Connection *connection, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 28 | const string &path, |
| 29 | const string &service) |
| 30 | : DBus::ObjectProxy(*connection, path, service.c_str()), |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 31 | listener_(listener) {} |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 32 | |
| 33 | DBusPropertiesProxy::Proxy::~Proxy() {} |
| 34 | |
| 35 | void DBusPropertiesProxy::Proxy::MmPropertiesChanged( |
| 36 | const string &interface, |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 37 | const DBusPropertiesMap &properties) { |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 38 | VLOG(2) << __func__ << "(" << interface << ")"; |
| 39 | listener_->OnModemManagerPropertiesChanged(interface, properties); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | void DBusPropertiesProxy::Proxy::PropertiesChanged( |
| 43 | const string &interface, |
Darin Petkov | e0a312e | 2011-07-20 13:45:28 -0700 | [diff] [blame] | 44 | const DBusPropertiesMap &changed_properties, |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 45 | const vector<string> &invalidated_properties) { |
Darin Petkov | c5f5656 | 2011-08-06 16:40:05 -0700 | [diff] [blame] | 46 | VLOG(2) << __func__ << "(" << interface << ")"; |
| 47 | listener_->OnDBusPropertiesChanged( |
| 48 | interface, changed_properties, invalidated_properties); |
Darin Petkov | 5c97ac5 | 2011-07-19 16:30:49 -0700 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | } // namespace shill |