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

Unified Diff: components/page_load_metrics/browser/metrics_web_contents_observer.h

Issue 1441393002: Add UMA to count the number of Google CAPTCHA pages shown and solved by users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Change histogram name and add helper function Created 5 years, 1 month 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: components/page_load_metrics/browser/metrics_web_contents_observer.h
diff --git a/components/page_load_metrics/browser/metrics_web_contents_observer.h b/components/page_load_metrics/browser/metrics_web_contents_observer.h
index 4a9e061a00a94cdb55701d37ebe20d12e894aca1..9f1a184518551e7be259b016724162161d2bc7df 100644
--- a/components/page_load_metrics/browser/metrics_web_contents_observer.h
+++ b/components/page_load_metrics/browser/metrics_web_contents_observer.h
@@ -33,6 +33,9 @@ class RapporService;
namespace page_load_metrics {
+// Returns true if the given URL matches a Google CAPTCHA page.
+bool IsGoogleCaptcha(const GURL& url);
+
// These constants are for keeping the tests in sync.
const char kHistogramNameFirstLayout[] =
"PageLoad.Timing2.NavigationToFirstLayout";
@@ -60,6 +63,8 @@ const char kErrorEvents[] = "PageLoad.Events.InternalError";
const char kRapporMetricsNameCoarseTiming[] =
"PageLoad.CoarseTiming.NavigationToFirstContentfulPaint";
+const char kHistogramNameGoogleCaptcha[] = "PageLoad.Events.GoogleCaptcha";
+
// NOTE: Some of these histograms are separated into a separate histogram
// specified by the ".Background" suffix. For these events, we put them into the
// background histogram if the web contents was ever in the background from
@@ -158,6 +163,16 @@ enum InternalErrorLoadEvent {
ERR_LAST_ENTRY
};
+// Values of the UMA PageLoad.Events.GoogleCaptcha histogram.
+enum GoogleCaptchaEvent {
+ // A Google CAPTCHA page was shown to the user.
+ GOOGLE_CAPTCHA_SHOWN,
+ // A Google CAPTCHA page was solved by the user.
+ GOOGLE_CAPTCHA_SOLVED,
+ // Add new values before this final count.
+ GOOGLE_CAPTCHA_EVENT_BOUNDARY,
+};
+
// This class tracks a given page load, starting from navigation start /
// provisional load, until a new navigation commits or the navigation fails. It
// also records RAPPOR/UMA about the page load.
@@ -239,6 +254,8 @@ class MetricsWebContentsObserver
content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
+ void DidRedirectNavigation(
+ content::NavigationHandle* navigation_handle) override;
void WasShown() override;
void WasHidden() override;

Powered by Google App Engine
This is Rietveld 408576698