[shill] Use ref-counted pointers more, break unneeded header deps

1) Replace more bare pointers with ref-counted pointers.
2) Move declarations of *RefPtr into a header file with fwd-declared classes
3) Make class headers include that, move inclusion of real headers to .cc files.

BUG=None
TEST=unit tests

Change-Id: I8208c82377c6dbefe6903561a503b8db63f063d6
Reviewed-on: http://gerrit.chromium.org/gerrit/3177
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
diff --git a/ipconfig.h b/ipconfig.h
index 6708b12..f6ac640 100644
--- a/ipconfig.h
+++ b/ipconfig.h
@@ -13,12 +13,10 @@
 #include <base/memory/scoped_ptr.h>
 #include <gtest/gtest_prod.h>  // for FRIEND_TEST
 
+#include "shill/refptr_types.h"
+
 namespace shill {
 
-class IPConfig;
-
-typedef scoped_refptr<IPConfig> IPConfigRefPtr;
-
 // IPConfig superclass. Individual IP configuration types will inherit from this
 // class.
 class IPConfig : public base::RefCounted<IPConfig> {
@@ -56,7 +54,8 @@
   // configuration instance allowing clients to more easily manage multiple IP
   // configurations. The callback's second argument is set to false if IP
   // configuration failed.
-  void RegisterUpdateCallback(Callback2<IPConfigRefPtr, bool>::Type *callback);
+  void RegisterUpdateCallback(
+      Callback2<const IPConfigRefPtr&, bool>::Type *callback);
 
   const Properties &properties() const { return properties_; }
 
@@ -80,7 +79,7 @@
 
   const std::string device_name_;
   Properties properties_;
-  scoped_ptr<Callback2<IPConfigRefPtr, bool>::Type> update_callback_;
+  scoped_ptr<Callback2<const IPConfigRefPtr&, bool>::Type> update_callback_;
 
   DISALLOW_COPY_AND_ASSIGN(IPConfig);
 };