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

Unified Diff: chrome/browser/content_settings/tab_specific_content_settings.cc

Issue 659573003: Log mixed script shield events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Give the MixedScriptAction enum a name. Created 6 years, 2 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/content_settings/tab_specific_content_settings.cc
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index d52e41d19b0c58e9e29c09dab70820ce11dffb55..5196ef6971a61c2c5b6e61b100929209fe58c768 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/browsing_data/browsing_data_appcache_helper.h"
@@ -63,6 +64,14 @@ STATIC_CONST_MEMBER_DEFINITION const
TabSpecificContentSettings::MicrophoneCameraState
TabSpecificContentSettings::CAMERA_BLOCKED;
+
+void TabSpecificContentSettings::RecordMixedScriptAction(
+ MixedScriptAction action) {
+ UMA_HISTOGRAM_ENUMERATION("ContentSettings.MixedScript",
+ action,
+ MIXEDSCRIPT_NUM_ACTIONS);
+}
+
TabSpecificContentSettings::SiteDataObserver::SiteDataObserver(
TabSpecificContentSettings* tab_specific_content_settings)
: tab_specific_content_settings_(tab_specific_content_settings) {
@@ -324,6 +333,10 @@ void TabSpecificContentSettings::OnContentBlocked(ContentSettingsType type) {
chrome::NOTIFICATION_WEB_CONTENT_SETTINGS_CHANGED,
content::Source<WebContents>(web_contents()),
content::NotificationService::NoDetails());
+
+ if (type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) {
+ RecordMixedScriptAction(MIXEDSCRIPT_DISPLAYED_SHIELD);
+ }
}
}

Powered by Google App Engine
This is Rietveld 408576698