Chromium Code Reviews| 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_; |