Measure and send update time to UMA.

BUG=4852
TEST=unit tests, gmerged, force update, looked at about:histograms.

Review URL: http://codereview.chromium.org/2868061
diff --git a/update_attempter.h b/update_attempter.h
index 711c8ea..5eda43f 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -15,6 +15,7 @@
 #include "update_engine/omaha_request_params.h"
 #include "update_engine/omaha_response_handler_action.h"
 
+class MetricsLibraryInterface;
 struct UpdateEngineService;
 
 namespace chromeos_update_engine {
@@ -36,12 +37,14 @@
 class UpdateAttempter : public ActionProcessorDelegate,
                         public DownloadActionDelegate {
  public:
-  UpdateAttempter() : dbus_service_(NULL),
-                      status_(UPDATE_STATUS_IDLE),
-                      download_progress_(0.0),
-                      last_checked_time_(0),
-                      new_version_("0.0.0.0"),
-                      new_size_(0) {
+  UpdateAttempter(MetricsLibraryInterface* metrics_lib)
+      : dbus_service_(NULL),
+        metrics_lib_(metrics_lib),
+        status_(UPDATE_STATUS_IDLE),
+        download_progress_(0.0),
+        last_checked_time_(0),
+        new_version_("0.0.0.0"),
+        new_size_(0) {
     last_notify_time_.tv_sec = 0;
     last_notify_time_.tv_nsec = 0;
     if (utils::FileExists(kUpdateCompletedMarker))
@@ -96,6 +99,9 @@
   // pointer to the OmahaResponseHandlerAction in the actions_ vector;
   std::tr1::shared_ptr<OmahaResponseHandlerAction> response_handler_action_;
 
+  // Pointer to the UMA metrics collection library.
+  MetricsLibraryInterface* metrics_lib_;
+
   // For status:
   UpdateStatus status_;
   double download_progress_;