shill: Keeps track of successful wifi connection frequencies.

Saves the connection frequencies (and counts therefor) in the default
profile.  Sends number of frequencies on which successful connections
have been made to an UMA stat.

BUG=chromium:222081
TEST=unittests and manual (look for UMA stat
     'Network.Shill.Wifi.FrequenciesConnectedEver', disconnect from
     wifi, reconnect, verify that the UMA stat went up by 1).

Change-Id: I1e3c75b82ac387dd01066c4da4ebfce2c4b2ddc0
Reviewed-on: https://gerrit.chromium.org/gerrit/47154
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
diff --git a/metrics.h b/metrics.h
index d1af070..614cf86 100644
--- a/metrics.h
+++ b/metrics.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef SHILL_METRICS_
-#define SHILL_METRICS_
+#ifndef SHILL_METRICS_H_
+#define SHILL_METRICS_H_
 
 #include <list>
 
@@ -303,6 +303,12 @@
   // The result of the portal detection.
   static const char kMetricPortalResult[];
 
+  // Wifi connection frequencies.
+  static const char kMetricFrequenciesConnectedEver[];
+  static const int kMetricFrequenciesConnectedMax;
+  static const int kMetricFrequenciesConnectedMin;
+  static const int kMetricFrequenciesConnectedNumBuckets;
+
   static const char kMetricPowerManagerKey[];
 
   // LinkMonitor statistics.
@@ -584,7 +590,7 @@
                                            Service::ConnectState new_state);
   void SendServiceFailure(const Service *service);
 
-  DeviceMetrics *GetDeviceMetrics (int interface_index) const;
+  DeviceMetrics *GetDeviceMetrics(int interface_index) const;
   void AutoConnectMetricsReset(DeviceMetrics *device_metrics);
 
   void HourlyTimeoutHandler();
@@ -632,4 +638,4 @@
 
 }  // namespace shill
 
-#endif  // SHILL_METRICS_
+#endif  // SHILL_METRICS_H_