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

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: Changed to using histogram, updated test 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..e154c29312f7a4d5062c9e2a80f8f06d6d8f1784 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";
@@ -158,6 +161,16 @@ enum InternalErrorLoadEvent {
ERR_LAST_ENTRY
};
+// Values of the UMA GoogleCaptcha.Event 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 +252,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