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

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: Fit nit: Remove _MAX from enum 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
deleted file mode 100644
index ffb465d4d6e50fb77348b2a44d28b97b5b092bfc..0000000000000000000000000000000000000000
--- a/chrome/browser/interstitials/security_interstitial_uma_helper.h
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2014 The Chromium Authors. All rights reserved.
-// 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_
-
-#include "base/task/cancelable_task_tracker.h"
-#include "base/time/time.h"
-#include "url/gurl.h"
-
-namespace content {
-class WebContents;
-}
-
-namespace extensions {
-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 {
- 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).
- enum SecurityInterstitialDecision {
- SHOW,
- PROCEED,
- DONT_PROCEED,
- PROCEEDING_DISABLED,
- MAX_DECISION
- };
- enum SecurityInterstitialInteraction {
- TOTAL_VISITS,
- SHOW_ADVANCED,
- SHOW_PRIVACY_POLICY,
- SHOW_DIAGNOSTIC,
- SHOW_LEARN_MORE,
- RELOAD,
- OPEN_TIME_SETTINGS,
- MAX_INTERACTION
- };
-
- SecurityInterstitialUmaHelper(content::WebContents* web_contents,
- const GURL& url,
- const std::string& histogram_prefix,
- const std::string& sampling_event_name);
- ~SecurityInterstitialUmaHelper();
-
- // Record a user decision or interaction to the appropriate UMA histogram.
- void RecordUserDecision(SecurityInterstitialDecision decision);
- void RecordUserInteraction(SecurityInterstitialInteraction interaction);
-
- private:
- // Used to query the HistoryService to see if the URL is in history.
- void OnGotHistoryCount(bool success, int num_visits, base::Time first_visit);
-
- content::WebContents* web_contents_;
- const GURL request_url_;
- const std::string histogram_prefix_;
- const std::string sampling_event_name_;
- int num_visits_;
- base::CancelableTaskTracker request_tracker_;
-#if defined(ENABLE_EXTENSIONS)
- scoped_ptr<extensions::ExperienceSamplingEvent> sampling_event_;
-#endif
-
- DISALLOW_COPY_AND_ASSIGN(SecurityInterstitialUmaHelper);
-};
-
-#endif // CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_UMA_HELPER_H_

Powered by Google App Engine
This is Rietveld 408576698