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

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 7558024: Add UMA metrics for blocked plugins. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 9 years, 4 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/renderer/content_settings_observer.cc
diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
index 59f58df1d3100fa019cb41f96c239987591ac74e..5333cf0eff302e75ad5089a87b44007f7c1f1fb5 100644
--- a/chrome/renderer/content_settings_observer.cc
+++ b/chrome/renderer/content_settings_observer.cc
@@ -84,16 +84,11 @@ ContentSetting ContentSettingsObserver::GetContentSetting(
void ContentSettingsObserver::DidBlockContentType(
ContentSettingsType settings_type,
- const std::string& resource_identifier) {
- // Always send a message when |resource_identifier| is not empty, to tell the
- // browser which resource was blocked (otherwise the browser will only show
- // the first resource to be blocked, and none that are blocked at a later
- // time).
- if (!content_blocked_[settings_type] || !resource_identifier.empty()) {
- content_blocked_[settings_type] = true;
- Send(new ViewHostMsg_ContentBlocked(routing_id(), settings_type,
- resource_identifier));
- }
+ const std::string& resource_identifier,
+ ContentSetting setting) {
+ content_blocked_[settings_type] = true;
+ Send(new ViewHostMsg_ContentBlocked(routing_id(), settings_type,
+ resource_identifier, setting));
}
bool ContentSettingsObserver::OnMessageReceived(const IPC::Message& message) {
@@ -204,7 +199,8 @@ bool ContentSettingsObserver::AllowImages(WebFrame* frame,
if (IsWhitelistedForContentSettings(frame))
return true;
- DidBlockContentType(CONTENT_SETTINGS_TYPE_IMAGES, std::string());
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_IMAGES, std::string(),
+ CONTENT_SETTING_BLOCK);
return false; // Other protocols fall through here.
}
@@ -264,11 +260,13 @@ bool ContentSettingsObserver::AllowStorage(WebFrame* frame, bool local) {
}
void ContentSettingsObserver::DidNotAllowPlugins(WebFrame* frame) {
- DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, std::string());
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_PLUGINS, std::string(),
+ CONTENT_SETTING_BLOCK);
}
void ContentSettingsObserver::DidNotAllowScript(WebFrame* frame) {
- DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string());
+ DidBlockContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, std::string(),
+ CONTENT_SETTING_BLOCK);
}
void ContentSettingsObserver::OnSetContentSettingsForLoadingURL(

Powered by Google App Engine
This is Rietveld 408576698