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 |