| 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 dbdeb1989ee74c1ff3e10d5c6a9631a4647dc8f3..0306cf939639bc5e7cacf570eaa2c352938e2007 100644
|
| --- a/chrome/browser/media/router/media_router_metrics.h
|
| +++ b/chrome/browser/media/router/media_router_metrics.h
|
| @@ -5,8 +5,17 @@
|
| #ifndef CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_METRICS_H_
|
| #define CHROME_BROWSER_MEDIA_ROUTER_MEDIA_ROUTER_METRICS_H_
|
|
|
| +#include "base/gtest_prod_util.h"
|
| #include "base/time/time.h"
|
|
|
| +namespace base {
|
| +class Version;
|
| +} // namespace base
|
| +
|
| +namespace extensions {
|
| +class Extension;
|
| +} // namespace extensions
|
| +
|
| namespace media_router {
|
|
|
| // NOTE: Do not renumber enums as that would confuse interpretation of
|
| @@ -69,6 +78,31 @@ enum class MediaRouterUserAction {
|
| TOTAL_COUNT = 5
|
| };
|
|
|
| +// The install status of the Media Router component extension.
|
| +enum class MediaRouteProviderVersion {
|
| + // Installed but version is invalid or cannot be determined.
|
| + UNKNOWN = 0,
|
| + // Installed and the extension version matches the browser version.
|
| + SAME_VERSION = 1,
|
| + // Installed and the extension version is one version behind the browser
|
| + // version.
|
| + PREVIOUS_VERSION = 2,
|
| + // Installed and the extension version is more than one version behind the
|
| + // browser version.
|
| + OUT_OF_DATE_VERSION = 3,
|
| + // Note: Add entries only immediately above this line.
|
| + TOTAL_COUNT = 4
|
| +};
|
| +
|
| +// The outcome of an attempt to wake the Media Router component event page.
|
| +enum class MediaRouteProviderWakeup {
|
| + SUCCESS = 0,
|
| + ERROR_UNKNOWN = 1,
|
| + ERROR_TOO_MANY_RETRIES = 2,
|
| + // Note: Add entries only immediately above this line.
|
| + TOTAL_COUNT = 3
|
| +};
|
| +
|
| class MediaRouterMetrics {
|
| public:
|
| // Records where the user clicked to open the Media Router dialog.
|
| @@ -97,6 +131,28 @@ class MediaRouterMetrics {
|
| // Records the outcome in a create route response.
|
| static void RecordRouteCreationOutcome(
|
| MediaRouterRouteCreationOutcome outcome);
|
| +
|
| + // Records the installed version of the Media Router component extension.
|
| + static void RecordMediaRouteProviderVersion(
|
| + const extensions::Extension& extension);
|
| +
|
| + // Records the outcome of an attempt to wake the Media Router component event
|
| + // page.
|
| + static void RecordMediaRouteProviderWakeup(MediaRouteProviderWakeup wakeup);
|
| +
|
| + private:
|
| + FRIEND_TEST_ALL_PREFIXES(MediaRouteProviderMetricsTest,
|
| + TestGetVersionDifference);
|
| +
|
| + // Records the install status of the Media Router component extension.
|
| + static void RecordMediaRouteProviderVersion(
|
| + MediaRouteProviderVersion version);
|
| +
|
| + // Returns the integer difference between the major versions of |first| and
|
| + // |second|, or std::numeric_limits<int>::min() if the difference cannot be
|
| + // determined.
|
| + static int GetVersionDifference(const base::Version& first,
|
| + const base::Version& second);
|
| };
|
|
|
| } // namespace media_router
|
|
|