summaryrefslogtreecommitdiff
path: root/dbus_properties_proxy.h
diff options
context:
space:
mode:
authorJason Glasgow <jglasgow@chromium.org>2012-04-18 15:16:29 -0400
committerGerrit <chrome-bot@google.com>2012-04-26 09:00:11 -0700
commit9c09e36db2eb2de8f1433b88438ea53eb1be986a (patch)
tree841a1bbe46c0c90510241471bd0d5ccba360e9a6 /dbus_properties_proxy.h
parentcb71529cc0432935aff005726c81df109d1dc710 (diff)
downloadshill-9c09e36db2eb2de8f1433b88438ea53eb1be986a.tar.gz
shill: dbus_properties: Convert to callbacks instead of delegates
Use callbacks instead of proxies on the DBusPropertiesProxyInterface. This makes the class consistent with the other proxies used for cellular support, and in subsequent CLs will allow access to the GetAll function without having to implement the Delegate interface. Add a GetStrings method to dbus_properties. BUG=none TEST=run unit tests, run on a machine validate that changes in signal strength are noticed. Change-Id: I23e47f011c39a23f406ef62a52a5a613e55c55ed Reviewed-on: https://gerrit.chromium.org/gerrit/20640 Reviewed-by: Jason Glasgow <jglasgow@chromium.org> Tested-by: Jason Glasgow <jglasgow@chromium.org> Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Diffstat (limited to 'dbus_properties_proxy.h')
-rw-r--r--dbus_properties_proxy.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/dbus_properties_proxy.h b/dbus_properties_proxy.h
index 415f9019..38866d1d 100644
--- a/dbus_properties_proxy.h
+++ b/dbus_properties_proxy.h
@@ -14,8 +14,7 @@ namespace shill {
class DBusPropertiesProxy : public DBusPropertiesProxyInterface {
public:
- DBusPropertiesProxy(DBusPropertiesProxyDelegate *delegate,
- DBus::Connection *connection,
+ DBusPropertiesProxy(DBus::Connection *connection,
const std::string &path,
const std::string &service);
virtual ~DBusPropertiesProxy();
@@ -23,16 +22,25 @@ class DBusPropertiesProxy : public DBusPropertiesProxyInterface {
// Inherited from DBusPropertiesProxyInterface.
virtual DBusPropertiesMap GetAll(const std::string &interface_name);
+ virtual void set_properties_changed_callback(
+ const PropertiesChangedCallback &callback);
+ virtual void set_modem_manager_properties_changed_callback(
+ const ModemManagerPropertiesChangedCallback &callback);
+
private:
class Proxy : public org::freedesktop::DBus::Properties_proxy,
public DBus::ObjectProxy {
public:
- Proxy(DBusPropertiesProxyDelegate *delegate,
- DBus::Connection *connection,
+ Proxy(DBus::Connection *connection,
const std::string &path,
const std::string &service);
virtual ~Proxy();
+ virtual void set_properties_changed_callback(
+ const PropertiesChangedCallback &callback);
+ virtual void set_modem_manager_properties_changed_callback(
+ const ModemManagerPropertiesChangedCallback &callback);
+
private:
// Signal callbacks inherited from DBusProperties_proxy.
virtual void MmPropertiesChanged(const std::string &interface,
@@ -43,7 +51,8 @@ class DBusPropertiesProxy : public DBusPropertiesProxyInterface {
const DBusPropertiesMap &changed_properties,
const std::vector<std::string> &invalidated_properties);
- DBusPropertiesProxyDelegate *delegate_;
+ PropertiesChangedCallback properties_changed_callback_;
+ ModemManagerPropertiesChangedCallback mm_properties_changed_callback_;
DISALLOW_COPY_AND_ASSIGN(Proxy);
};