Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1521)

Unified Diff: chrome/browser/media/router/media_router_metrics.h

Issue 1765143002: [Media Router] Add UMA histograms tracking component extension version/wakeups (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanups Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698