Chromium Code Reviews| Index: chrome/browser/interstitials/security_interstitial_metrics_helper.h |
| diff --git a/chrome/browser/interstitials/security_interstitial_uma_helper.h b/chrome/browser/interstitials/security_interstitial_metrics_helper.h |
| similarity index 51% |
| rename from chrome/browser/interstitials/security_interstitial_uma_helper.h |
| rename to chrome/browser/interstitials/security_interstitial_metrics_helper.h |
| index ffb465d4d6e50fb77348b2a44d28b97b5b092bfc..2831fac58be6ac1d975861d218916a3e51c28fe6 100644 |
| --- a/chrome/browser/interstitials/security_interstitial_uma_helper.h |
| +++ b/chrome/browser/interstitials/security_interstitial_metrics_helper.h |
| @@ -2,8 +2,10 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_ |
| -#define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_ |
| +#ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_METRICS_HELPER_H_ |
| +#define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_METRICS_HELPER_H_ |
| + |
| +#include <string> |
| #include "base/task/cancelable_task_tracker.h" |
| #include "base/time/time.h" |
| @@ -18,9 +20,10 @@ 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. |
| -class SecurityInterstitialUmaHelper { |
| +// choices. SecurityInterstitialMetricsHelper is intended to help the security |
| +// interstitials record user choices in a common way via METRICS histograms |
| +// and RAPPOR metrics. |
| +class SecurityInterstitialMetricsHelper { |
| public: |
| // These enums are used for histograms. Don't reorder, delete, or insert |
| // elements. New elements should be added at the end (right before the max). |
| @@ -42,13 +45,23 @@ class SecurityInterstitialUmaHelper { |
| MAX_INTERACTION |
| }; |
| - SecurityInterstitialUmaHelper(content::WebContents* web_contents, |
| - const GURL& url, |
| - const std::string& histogram_prefix, |
| - const std::string& sampling_event_name); |
| - ~SecurityInterstitialUmaHelper(); |
| + // Args: |
| + // url: URL of page that triggered the interstitial. Only origin is used. |
| + // uma_prefix: Histogram prefix for UMA. |
| + // examples: "phishing", "ssl_overridable" |
| + // rappor_prefix: Metric prefix for Rappor. Leave empty to skip Rappor. |
| + // examples: "phishing", "ssl" |
|
felt
2015/02/03 07:28:04
I'm a little uncomfortable about using a string st
Alexei Svitkine (slow)
2015/02/03 14:58:25
Actually that's a good point.
If the prefixes wil
Nathan Parker
2015/02/03 21:01:00
That would just muddle the reports in this case (r
Nathan Parker
2015/02/03 21:01:00
Sounds good. I've made it far more explicit.
|
| + // sampling_event_name: Event name for Experience Sampling. |
| + // e.g. "phishing_interstitial_" |
| + SecurityInterstitialMetricsHelper(content::WebContents* web_contents, |
| + const GURL& url, |
| + const std::string& uma_prefix, |
| + const std::string& rappor_prefix, |
| + const std::string& sampling_event_name); |
| + ~SecurityInterstitialMetricsHelper(); |
| - // 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_; |
| @@ -66,7 +80,7 @@ class SecurityInterstitialUmaHelper { |
| scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_; |
| #endif |
| - DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialUmaHelper); |
| + DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialMetricsHelper); |
| }; |
| -#endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_ |
| +#endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_METRICS_HELPER_H_ |