summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 00:03:49 +0000
committerabarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-01 00:03:49 +0000
commit49f3d5598a091569e15102770ffb1a50732d2fc4 (patch)
tree9251a1b292e702f910ff85ff74bd493009846fe3 /chrome
parent558b6591982ff3f66538d1c5388cf4b84ccaad98 (diff)
downloadchromium_src-49f3d5598a091569e15102770ffb1a50732d2fc4.zip
chromium_src-49f3d5598a091569e15102770ffb1a50732d2fc4.tar.gz
chromium_src-49f3d5598a091569e15102770ffb1a50732d2fc4.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@15018 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/safe_browsing/safe_browsing_blocking_page.cc21
-rw-r--r--chrome/browser/ssl/ssl_blocking_page.cc23
2 files changed, 43 insertions, 1 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..b285b05 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, 3);
+ 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
diff --git a/chrome/browser/ssl/ssl_blocking_page.cc b/chrome/browser/ssl/ssl_blocking_page.cc
index ce9d9da..5e1e2fd 100644
--- a/chrome/browser/ssl/ssl_blocking_page.cc
+++ b/chrome/browser/ssl/ssl_blocking_page.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ssl/ssl_blocking_page.h"
+#include "base/histogram.h"
#include "base/string_piece.h"
#include "base/values.h"
#include "chrome/browser/browser.h"
@@ -22,6 +23,22 @@
#include "grit/browser_resources.h"
#include "grit/generated_resources.h"
+namespace {
+
+enum SSLBlockingPageEvent {
+ SHOW,
+ PROCEED,
+ DONT_PROCEED,
+};
+
+void RecordSSLBlockingPageStats(SSLBlockingPageEvent event) {
+ static LinearHistogram histogram("interstial.ssl", 0, 2, 3);
+ histogram.SetFlags(kUmaTargetedHistogramFlag);
+ histogram.Add(event);
+}
+
+} // namespace
+
// Note that we always create a navigation entry with SSL errors.
// No error happening loading a sub-resource triggers an interstitial so far.
SSLBlockingPage::SSLBlockingPage(SSLManager::CertError* error,
@@ -30,6 +47,7 @@ SSLBlockingPage::SSLBlockingPage(SSLManager::CertError* error,
error_(error),
delegate_(delegate),
delegate_has_been_notified_(false) {
+ RecordSSLBlockingPageStats(SHOW);
}
SSLBlockingPage::~SSLBlockingPage() {
@@ -94,6 +112,8 @@ void SSLBlockingPage::CommandReceived(const std::string& command) {
}
void SSLBlockingPage::Proceed() {
+ RecordSSLBlockingPageStats(PROCEED);
+
// Accepting the certificate resumes the loading of the page.
NotifyAllowCertificate();
@@ -102,11 +122,12 @@ void SSLBlockingPage::Proceed() {
}
void SSLBlockingPage::DontProceed() {
+ RecordSSLBlockingPageStats(DONT_PROCEED);
+
NotifyDenyCertificate();
InterstitialPage::DontProceed();
}
-
void SSLBlockingPage::NotifyDenyCertificate() {
DCHECK(!delegate_has_been_notified_);