shill: On Service::Connect, connect the modem device to the network.

Also, uncouple the DBusProperties signal callbacks from Modem to make the proxy
implementation more consistent with the other proxies.

BUG=chromium-os:18727
TEST=unit tests

Change-Id: Icdddea8d2a30803150f2a159fdc5a719e960f95d
Reviewed-on: http://gerrit.chromium.org/gerrit/5444
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
diff --git a/modem_proxy.cc b/modem_proxy.cc
index 3328667..1eb1b0c 100644
--- a/modem_proxy.cc
+++ b/modem_proxy.cc
@@ -10,10 +10,11 @@
 
 namespace shill {
 
-ModemProxy::ModemProxy(DBus::Connection *connection,
+ModemProxy::ModemProxy(ModemProxyListener *listener,
+                       DBus::Connection *connection,
                        const string &path,
                        const string &service)
-    : proxy_(connection, path, service) {}
+    : proxy_(listener, connection, path, service) {}
 
 ModemProxy::~ModemProxy() {}
 
@@ -25,19 +26,20 @@
   return proxy_.GetInfo();
 }
 
-ModemProxy::Proxy::Proxy(DBus::Connection *connection,
+ModemProxy::Proxy::Proxy(ModemProxyListener *listener,
+                         DBus::Connection *connection,
                          const string &path,
                          const string &service)
-    : DBus::ObjectProxy(*connection, path, service.c_str()) {}
+    : DBus::ObjectProxy(*connection, path, service.c_str()),
+      listener_(listener) {}
 
 ModemProxy::Proxy::~Proxy() {}
 
 void ModemProxy::Proxy::StateChanged(const uint32 &old,
                                      const uint32 &_new,
                                      const uint32 &reason) {
-  VLOG(2) << __func__;
-  // TODO(petkov): Implement this.
-  NOTIMPLEMENTED();
+  VLOG(2) << __func__ << "(" << old << ", " << _new << ", " << reason << ")";
+  listener_->OnModemStateChanged(old, _new, reason);
 }
 
 }  // namespace shill