shill: WiFiService: Report EAP Authentication Type Metrics

When an 802.1x WiFi connection completes, report the inner and
outer authentication methods configured for this connection.

BUG=chromium-os:39424
TEST=Unit tests; Connect to a PEAP/MSCHAPv2 access point and look
at chrome://histograms.

Change-Id: Ic66b470cbd7019fe551e094c47782eb47bc1338f
Reviewed-on: https://gerrit.chromium.org/gerrit/44422
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
diff --git a/wifi_service.cc b/wifi_service.cc
index dbb4f6a..7f9f4f2 100644
--- a/wifi_service.cc
+++ b/wifi_service.cc
@@ -353,6 +353,24 @@
       security_uma,
       Metrics::kMetricNetworkSecurityMax);
 
+  if (Is8021x()) {
+    Metrics::EapOuterProtocol outer_protocol =
+        Metrics::EapOuterProtocolStringToEnum(eap().eap);
+    metrics()->SendEnumToUMA(
+        metrics()->GetFullMetricName(Metrics::kMetricNetworkEapOuterProtocol,
+                                     technology()),
+        outer_protocol,
+        Metrics::kMetricNetworkEapOuterProtocolMax);
+
+    Metrics::EapInnerProtocol inner_protocol =
+        Metrics::EapInnerProtocolStringToEnum(eap().inner_eap);
+    metrics()->SendEnumToUMA(
+        metrics()->GetFullMetricName(Metrics::kMetricNetworkEapInnerProtocol,
+                                     technology()),
+        inner_protocol,
+        Metrics::kMetricNetworkEapInnerProtocolMax);
+  }
+
   // We invert the sign of the signal strength value, since UMA histograms
   // cannot represent negative numbers (it stores them but cannot display
   // them), and dBm values of interest start at 0 and go negative from there.