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

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: Move media_router_metrics_unittest to non_android 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
« no previous file with comments | « chrome/browser/media/router/media_router.gypi ('k') | chrome/browser/media/router/media_router_metrics.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9eda482a2852af5a9284def8f04ac3cc8a351e37 100644
--- a/chrome/browser/media/router/media_router_metrics.h
+++ b/chrome/browser/media/router/media_router_metrics.h
@@ -5,8 +5,19 @@
#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
+
+#if !defined(OS_ANDROID)
+namespace extensions {
+class Extension;
+} // namespace extensions
+#endif // !defined(OS_ANDROID)
+
namespace media_router {
// NOTE: Do not renumber enums as that would confuse interpretation of
@@ -24,6 +35,30 @@ enum class MediaRouterDialogOpenOrigin {
TOTAL_COUNT = 4
};
+// The possible outcomes from a route creation response.
+enum class MediaRouterRouteCreationOutcome {
+ SUCCESS = 0,
+ FAILURE_NO_ROUTE = 1,
+ FAILURE_INVALID_SINK = 2,
+
+ // Note: Add entries only immediately above this line.
+ TOTAL_COUNT = 3,
+};
+
+// The possible actions a user can take while interacting with the Media Router
+// dialog.
+enum class MediaRouterUserAction {
+ CHANGE_MODE = 0,
+ START_LOCAL = 1,
+ STOP_LOCAL = 2,
+ CLOSE = 3,
+ STATUS_REMOTE = 4,
+
+ // Note: Add entries only immediately above this line.
+ TOTAL_COUNT = 5
+};
+
+#if !defined(OS_ANDROID)
// Why the Media Route Provider process was woken up.
enum class MediaRouteProviderWakeReason {
CREATE_ROUTE = 0,
@@ -46,28 +81,31 @@ enum class MediaRouteProviderWakeReason {
TOTAL_COUNT = 15
};
-// The possible outcomes from a route creation response.
-enum class MediaRouterRouteCreationOutcome {
- SUCCESS = 0,
- FAILURE_NO_ROUTE = 1,
- FAILURE_INVALID_SINK = 2,
-
+// 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 = 3,
+ TOTAL_COUNT = 4
};
-// The possible actions a user can take while interacting with the Media Router
-// dialog.
-enum class MediaRouterUserAction {
- CHANGE_MODE = 0,
- START_LOCAL = 1,
- STOP_LOCAL = 2,
- CLOSE = 3,
- STATUS_REMOTE = 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 = 5
+ TOTAL_COUNT = 3
};
+#endif // !defined(OS_ANDROID)
class MediaRouterMetrics {
public:
@@ -75,10 +113,6 @@ class MediaRouterMetrics {
static void RecordMediaRouterDialogOrigin(
MediaRouterDialogOpenOrigin origin);
- // Records why the media route provider extension was woken up.
- static void RecordMediaRouteProviderWakeReason(
- MediaRouteProviderWakeReason reason);
-
// Records the duration it takes for the Media Router dialog to open and
// finish painting after a user clicks to open the dialog.
static void RecordMediaRouterDialogPaint(
@@ -97,6 +131,29 @@ class MediaRouterMetrics {
// Records the outcome in a create route response.
static void RecordRouteCreationOutcome(
MediaRouterRouteCreationOutcome outcome);
+
+#if !defined(OS_ANDROID)
+ // Records the installed version of the Media Router component extension.
+ static void RecordMediaRouteProviderVersion(
+ const extensions::Extension& extension);
+
+ // Records why the media route provider extension was woken up.
+ static void RecordMediaRouteProviderWakeReason(
+ MediaRouteProviderWakeReason reason);
+
+ // 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);
+#endif // !defined(OS_ANDROID)
};
} // namespace media_router
« no previous file with comments | « chrome/browser/media/router/media_router.gypi ('k') | chrome/browser/media/router/media_router_metrics.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698