summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-26 23:35:22 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-26 23:35:22 +0000
commit7b0aeeaf4647dca4d00c954ec13e8f20f587358e (patch)
tree814f2c17aef71577fc0df699c4ed2dc044946da8 /chrome/browser/safe_browsing
parent0ccee20c7964bc39cc60df1b5cf534ca773109ff (diff)
downloadchromium_src-7b0aeeaf4647dca4d00c954ec13e8f20f587358e.zip
chromium_src-7b0aeeaf4647dca4d00c954ec13e8f20f587358e.tar.gz
chromium_src-7b0aeeaf4647dca4d00c954ec13e8f20f587358e.tar.bz2
Add some histograms to see how often users click through blocking pages.
R=jar Review URL: http://codereview.chromium.org/99020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14569 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
index fd07b9d6..1bf0a97 100644
--- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
+++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc
@@ -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 kLearnMoreCommand = "learnMore";
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);
+ histogram.SetFlags(kUmaTargetedHistogramFlag);
+ histogram.Add(event);
+}
+
+} // namespace
// static
SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL;
@@ -83,6 +99,7 @@ SafeBrowsingBlockingPage::SafeBrowsingBlockingPage(
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::CommandReceived(const std::string& cmd) {
}
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::Proceed() {
}
void SafeBrowsingBlockingPage::DontProceed() {
+ RecordSafeBrowsingBlockingPageStats(DONT_PROCEED);
+
NotifySafeBrowsingService(sb_service_, unsafe_resources_, false);
// The user does not want to proceed, clear the queued unsafe resources