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

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 99020: Add some histograms to see how often users click through blocking pages.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_blocking_page.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (revision 14518)
+++ chrome/browser/safe_browsing/safe_browsing_blocking_page.cc (working copy)
@@ -6,6 +6,7 @@
#include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h"
+#include "base/histogram.h"
#include "base/string_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/dom_operation_notification_details.h"
@@ -49,6 +50,21 @@
static const char* const kProceedCommand = "proceed";
static const char* const kTakeMeBackCommand = "takeMeBack";
+namespace {
+
+enum SafeBrowsingBlockingPageEvent {
+ SHOW,
+ PROCEED,
+ DONT_PROCEED,
+};
+
+void RecordSafeBrowsingBlockingPageStats(SafeBrowsingBlockingPageEvent event) {
+ static LinearHistogram histogram("interstial.safe_browsing", 0, 2, 4);
jar (doing other things) 2009/04/27 00:20:49 Looking at the unit test, and other examples, the
+ histogram.SetFlags(kUmaTargetedHistogramFlag);
+ histogram.Add(event);
+}
+
+} // namespace
// static
SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
@@ -83,6 +99,7 @@
sb_service_(sb_service),
is_main_frame_(IsMainPage(unsafe_resources)),
unsafe_resources_(unsafe_resources) {
+ RecordSafeBrowsingBlockingPageStats(SHOW);
if (!is_main_frame_) {
navigation_entry_index_to_remove_ =
tab()->controller().last_committed_entry_index();
@@ -362,6 +379,8 @@
}
void SafeBrowsingBlockingPage::Proceed() {
+ RecordSafeBrowsingBlockingPageStats(PROCEED);
+
NotifySafeBrowsingService(sb_service_, unsafe_resources_, true);
// Check to see if some new notifications of unsafe resources have been
@@ -387,6 +406,8 @@
}
void SafeBrowsingBlockingPage::DontProceed() {
+ RecordSafeBrowsingBlockingPageStats(DONT_PROCEED);
+
NotifySafeBrowsingService(sb_service_, unsafe_resources_, false);
// The user does not want to proceed, clear the queued unsafe resources
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_blocking_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698