Chromium Code Reviews| Index: chrome/browser/media/router/media_router_metrics.h |
| diff --git a/chrome/browser/media/router/media_router_metrics.h b/chrome/browser/media/router/media_router_metrics.h |
| index ce3e2d252136b7f20ad80a43ff428df0372fa5a7..5b4a0a46fc5413d922e766cf40cdab120c99d92b 100644 |
| --- a/chrome/browser/media/router/media_router_metrics.h |
| +++ b/chrome/browser/media/router/media_router_metrics.h |
| @@ -5,7 +5,10 @@ |
| #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_METRICS_H_ |
| #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_METRICS_H_ |
| +#include <memory> |
| + |
| #include "base/gtest_prod_util.h" |
| +#include "base/time/clock.h" |
| #include "base/time/time.h" |
| namespace media_router { |
| @@ -54,7 +57,12 @@ enum class MediaRouterUserAction { |
| class MediaRouterMetrics { |
| public: |
| + MediaRouterMetrics(); |
| + ~MediaRouterMetrics(); |
| + |
| // UMA histogram names. |
| + static const char kDialAvailableDeviceCount[]; |
|
mark a. foltz
2017/06/06 23:45:00
kHistogramDialAvailableDeviceCount (and similarly
zhaobin
2017/06/07 02:05:59
Done.
|
| + static const char kDialKnownDeviceCount[]; |
| static const char kHistogramIconClickLocation[]; |
| static const char kHistogramUiDialogPaint[]; |
| static const char kHistogramUiDialogLoadedWithData[]; |
| @@ -83,6 +91,18 @@ class MediaRouterMetrics { |
| // Records the outcome in a create route response. |
| static void RecordRouteCreationOutcome( |
| MediaRouterRouteCreationOutcome outcome); |
| + |
| + // Records device counts. |
| + void RecordDialDeviceCounts(size_t available_device_count, |
| + size_t known_device_count); |
| + |
| + // Allows tests to swap in a fake clock. |
| + void SetClockForTest(std::unique_ptr<base::Clock> clock); |
| + |
| + private: |
| + base::Time device_count_metrics_record_time_; |
| + |
| + std::unique_ptr<base::Clock> clock_; |
| }; |
| } // namespace media_router |