blob: 8c2ea7d9efe6e3c741f2f6a35981ec4df5f68384 [file] [log] [blame]
Ben Chanfad4a0b2012-04-18 15:49:59 -07001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Darin Petkov5c97ac52011-07-19 16:30:49 -07002// 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
Ben Chanfad4a0b2012-04-18 15:49:59 -07007#include "shill/scope_logger.h"
Darin Petkov5c97ac52011-07-19 16:30:49 -07008
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 Petkov580c7af2011-10-24 12:32:50 +020014DBusPropertiesProxy::DBusPropertiesProxy(DBusPropertiesProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070015 DBus::Connection *connection,
Darin Petkov5c97ac52011-07-19 16:30:49 -070016 const string &path,
17 const string &service)
Darin Petkov580c7af2011-10-24 12:32:50 +020018 : proxy_(delegate, 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 Petkov580c7af2011-10-24 12:32:50 +020026DBusPropertiesProxy::Proxy::Proxy(DBusPropertiesProxyDelegate *delegate,
Darin Petkovc5f56562011-08-06 16:40:05 -070027 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 Petkov580c7af2011-10-24 12:32:50 +020031 delegate_(delegate) {}
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) {
Ben Chanfad4a0b2012-04-18 15:49:59 -070038 SLOG(DBus, 2) << __func__ << "(" << interface << ")";
Darin Petkov580c7af2011-10-24 12:32:50 +020039 delegate_->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) {
Ben Chanfad4a0b2012-04-18 15:49:59 -070046 SLOG(DBus, 2) << __func__ << "(" << interface << ")";
Darin Petkov580c7af2011-10-24 12:32:50 +020047 delegate_->OnDBusPropertiesChanged(
Darin Petkovc5f56562011-08-06 16:40:05 -070048 interface, changed_properties, invalidated_properties);
Darin Petkov5c97ac52011-07-19 16:30:49 -070049}
50
51} // namespace shill