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

Unified Diff: chrome/browser/interstitials/security_interstitial_uma_helper.h

Issue 872813003: Add Rappor metrics for Safe Browsing and SSL interstitials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/interstitials/security_interstitial_uma_helper.h
diff --git a/chrome/browser/interstitials/security_interstitial_uma_helper.h b/chrome/browser/interstitials/security_interstitial_uma_helper.h
index ffb465d4d6e50fb77348b2a44d28b97b5b092bfc..fa24d367d2dd498a456b7eee671a6319fef1ab26 100644
--- a/chrome/browser/interstitials/security_interstitial_uma_helper.h
+++ b/chrome/browser/interstitials/security_interstitial_uma_helper.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_
#define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_
+#include <string>
+
#include "base/task/cancelable_task_tracker.h"
#include "base/time/time.h"
#include "url/gurl.h"
@@ -19,7 +21,9 @@ class ExperienceSamplingEvent;
// Most of the security interstitials share a common layout and set of
// choices. SecurityInterstitialUmaHelper is intended to help the security
-// interstitials record user choices in a common way via UMA histograms.
+// interstitials record user choices in a common way via UMA histograms
+// and RAPPOR metrics.
+// TODO(nparker): Rename *UmaHelper to *MetricsHelper
class SecurityInterstitialUmaHelper {
public:
// These enums are used for histograms. Don't reorder, delete, or insert
@@ -42,13 +46,22 @@ class SecurityInterstitialUmaHelper {
MAX_INTERACTION
};
+ // Args:
+ // url: Full URL of page that triggered the interstitial
felt 2015/01/28 19:19:17 Does it matter whether it's the full URL or just t
Nathan Parker 2015/01/29 01:36:02 Not currently, no, but I'd rather this code decide
felt 2015/01/29 06:18:36 The history manager lookup only works on a per-ori
Nathan Parker 2015/01/30 00:39:51 Ah, interesting point. So to accurately report (l
+ // uma_prefix: Histogram prefix. e.g. "phishing"
+ // rappor_prefix: Metric prefix. e.g. "SafeBrowsing.Phishing"
+ // If empty, no data will be reported to Rappor.
+ // sampling_event_name: Event name for Experience Sampling.
+ // e.g. "phishing_interstitial_"
SecurityInterstitialUmaHelper(content::WebContents* web_contents,
const GURL& url,
- const std::string& histogram_prefix,
+ const std::string& uma_prefix,
+ const std::string& rappor_prefix,
const std::string& sampling_event_name);
~SecurityInterstitialUmaHelper();
- // Record a user decision or interaction to the appropriate UMA histogram.
+ // Record a user decision or interaction to the appropriate UMA histogram
+ // and potentially in a RAPPOR metric.
void RecordUserDecision(SecurityInterstitialDecision decision);
void RecordUserInteraction(SecurityInterstitialInteraction interaction);
@@ -58,7 +71,8 @@ class SecurityInterstitialUmaHelper {
content::WebContents* web_contents_;
const GURL request_url_;
- const std::string histogram_prefix_;
+ const std::string uma_prefix_;
+ const std::string rappor_prefix_;
const std::string sampling_event_name_;
int num_visits_;
base::CancelableTaskTracker request_tracker_;

Powered by Google App Engine
This is Rietveld 408576698