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

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: 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..118f63a34cec1890dcd650d18f91f3451b0e2a53 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"
@@ -102,6 +103,13 @@ TabSpecificContentSettings::~TabSpecificContentSettings() {
SiteDataObserver, observer_list_, ContentSettingsDestroyed());
}
+void TabSpecificContentSettings::RecordMixedScriptAction(
+ MixedScriptAction action) {
+ UMA_HISTOGRAM_ENUMERATION("ContentSettings.MixedScript",
+ action,
+ MIXED_SCRIPT_ACTION_COUNT);
+}
+
TabSpecificContentSettings* TabSpecificContentSettings::Get(
int render_process_id, int render_view_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -324,6 +332,9 @@ 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(MIXED_SCRIPT_ACTION_DISPLAYED_SHIELD);
}
}

Powered by Google App Engine
This is Rietveld 408576698