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

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: Remove unnecessary #include 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..3b672a0a98367cb1e71bd55b6691f4a3b47df4c5 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_AS_CHROME = 1,
+ // Installed and the extension version is one version behind the browser
+ // version.
+ ONE_VERSION_BEHIND_CHROME = 2,
+ // Installed and the extension version is more than one version behind the
+ // browser version.
+ MULTIPLE_VERSIONS_BEHIND_CHROME = 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,23 @@ 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,
+ TestGetMediaRouteProviderVersion);
+
+ // Returns the version status of the Media Router component extension.
+ static MediaRouteProviderVersion GetMediaRouteProviderVersion(
+ const base::Version& extension_version,
+ const base::Version& browser_version);
};
} // namespace media_router

Powered by Google App Engine
This is Rietveld 408576698