Report Enum metrics from CertificateChecker.

The certificate checker was reporting a "user action" whenever an
update check HTTPS connection or HTTPS payload download had an invalid
HTTPS certificate or a valid one that was changed since the last
connection to the same server.

This patch sends an Enum metric for every HTTPS connection to check for
and update or download the payload with one of the three options: an
invalid certificate, a valid one already seen or a valid but different
certificate.

This patch also moves these metrics to the metrics.{h,cc} module, where
all the other metrics are reported, using an observer pattern in the
CertificateChecker, needed to remove the dependency on the metrics
library from the libpayload_consumer.

Bug: 25818567
TEST=FEATURES=test emerge-link update_engine; mma;

Change-Id: Ia1b6eb799e13b439b520ba14549d8973e18bcbfa
diff --git a/omaha_request_action.h b/omaha_request_action.h
index 36d233c..1aeaf8a 100644
--- a/omaha_request_action.h
+++ b/omaha_request_action.h
@@ -25,12 +25,15 @@
 #include <string>
 #include <vector>
 
+#include <gtest/gtest_prod.h>  // for FRIEND_TEST
+
 #include <brillo/secure_blob.h>
 #include <curl/curl.h>
 
 #include "update_engine/common/action.h"
 #include "update_engine/common/http_fetcher.h"
 #include "update_engine/omaha_response.h"
+#include "update_engine/system_state.h"
 
 // The Omaha Request action makes a request to Omaha and can output
 // the response on the output ActionPipe.
@@ -143,7 +146,7 @@
   // OmahaRequestAction(..., nullptr, new WhateverHttpFetcher);
   OmahaRequestAction(SystemState* system_state,
                      OmahaEvent* event,
-                     HttpFetcher* http_fetcher,
+                     std::unique_ptr<HttpFetcher> http_fetcher,
                      bool ping_only);
   ~OmahaRequestAction() override;
   typedef ActionTraits<OmahaRequestAction>::InputObjectType InputObjectType;