shill: Update WiMAX DBus proxy interfaces and classes.

Adds WiMaxManager.Network proxy. Creates WiMaxService objects based on
the available WiMax networks thus adding initial support for multiple
active WiMAX services. Adds a "Scanning" property to the WiMax device,
similar to WiFi and Cellular.

BUG=chrome-os-partner:9782
TEST=Build and run unit tests.
CQ-DEPEND=I97ce1351436afb3aeac0d2a48a8f51e1501e7466

Change-Id: Ie3f919846114f63414788c5b970fa0dff2e2d06a
Reviewed-on: https://gerrit.chromium.org/gerrit/23008
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
diff --git a/wimax_manager_proxy.cc b/wimax_manager_proxy.cc
index 9276e5a..9b93cfe 100644
--- a/wimax_manager_proxy.cc
+++ b/wimax_manager_proxy.cc
@@ -7,6 +7,7 @@
 #include <base/logging.h>
 #include <chromeos/dbus/service_constants.h>
 
+#include "shill/dbus_properties.h"
 #include "shill/error.h"
 #include "shill/scope_logger.h"
 
@@ -19,7 +20,12 @@
 
 WiMaxManagerProxy::~WiMaxManagerProxy() {}
 
-vector<RpcIdentifier> WiMaxManagerProxy::Devices(Error *error) {
+void WiMaxManagerProxy::set_devices_changed_callback(
+    const DevicesChangedCallback &callback) {
+  proxy_.set_devices_changed_callback(callback);
+}
+
+RpcIdentifiers WiMaxManagerProxy::Devices(Error *error) {
   SLOG(DBus, 2) << __func__;
   vector<DBus::Path> dbus_devices;
   try {
@@ -27,11 +33,8 @@
   } catch (const DBus::Error &e) {
     Error::PopulateAndLog(error, Error::kOperationFailed, e.what());
   }
-  vector<RpcIdentifier> devices;
-  for (vector<DBus::Path>::const_iterator it = dbus_devices.begin();
-       it != dbus_devices.end(); ++it) {
-    devices.push_back(*it);
-  }
+  RpcIdentifiers devices;
+  DBusProperties::ConvertPathsToRpcIdentifiers(dbus_devices, &devices);
   return devices;
 }
 
@@ -42,4 +45,20 @@
 
 WiMaxManagerProxy::Proxy::~Proxy() {}
 
+void WiMaxManagerProxy::Proxy::set_devices_changed_callback(
+    const DevicesChangedCallback &callback) {
+  devices_changed_callback_ = callback;
+}
+
+void WiMaxManagerProxy::Proxy::DevicesChanged(
+    const vector<DBus::Path> &devices) {
+  SLOG(DBus, 2) << __func__ << "(" << devices.size() << ")";
+  if (devices_changed_callback_.is_null()) {
+    return;
+  }
+  RpcIdentifiers rpc_devices;
+  DBusProperties::ConvertPathsToRpcIdentifiers(devices, &rpc_devices);
+  devices_changed_callback_.Run(rpc_devices);
+}
+
 }  // namespace shill