summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 01:57:50 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 01:57:50 +0000
commit2d30a7a7a52b20401a386b5f76f09ebf9e9c72df (patch)
tree9dc3e8780f37613726ff3e44ea822d6c63025d0e
parentf9e8dbbf401d1ceada479461f6e9fb395eab6990 (diff)
downloadchromium_src-2d30a7a7a52b20401a386b5f76f09ebf9e9c72df.zip
chromium_src-2d30a7a7a52b20401a386b5f76f09ebf9e9c72df.tar.gz
chromium_src-2d30a7a7a52b20401a386b5f76f09ebf9e9c72df.tar.bz2
Fix RenderView::AllowContentType to work properly.
AllowContentType needs to return false when blocking content. The code to limit notifications to the UI was interfering with this. This CL also fixes the naming of "allowContentType" to follow google style. R=jochen BUG=none TEST=enable image blocking, and then load images.google.com. you should see more than just one image get blocked. Review URL: http://codereview.chromium.org/566039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38067 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/render_view.cc17
-rw-r--r--chrome/renderer/render_view.h2
2 files changed, 10 insertions, 9 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 268aa41..a11fe59 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -2038,11 +2038,11 @@ void RenderView::willClose(WebFrame* frame) {
}
bool RenderView::allowPlugins(WebFrame* frame, bool enabled_per_settings) {
- return allowContentType(CONTENT_SETTINGS_TYPE_PLUGINS, enabled_per_settings);
+ return AllowContentType(CONTENT_SETTINGS_TYPE_PLUGINS, enabled_per_settings);
}
bool RenderView::allowImages(WebFrame* frame, bool enabled_per_settings) {
- return allowContentType(CONTENT_SETTINGS_TYPE_IMAGES, enabled_per_settings);
+ return AllowContentType(CONTENT_SETTINGS_TYPE_IMAGES, enabled_per_settings);
}
void RenderView::loadURLExternally(
@@ -2676,7 +2676,7 @@ void RenderView::didRunInsecureContent(
bool RenderView::allowScript(WebFrame* frame, bool enabled_per_settings) {
if (enabled_per_settings) {
- return allowContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT,
+ return AllowContentType(CONTENT_SETTINGS_TYPE_JAVASCRIPT,
enabled_per_settings);
}
@@ -3177,15 +3177,16 @@ std::string RenderView::DetermineTextLanguage(const std::wstring& text) {
return language;
}
-bool RenderView::allowContentType(ContentSettingsType settings_type,
+bool RenderView::AllowContentType(ContentSettingsType settings_type,
bool enabled_per_settings) {
if (!enabled_per_settings)
return false;
// CONTENT_SETTING_ASK is only valid for cookies.
- if (current_content_settings_.settings[settings_type] == CONTENT_SETTING_BLOCK
- && !content_blocked_[settings_type]) {
- content_blocked_[settings_type] = true;
- Send(new ViewHostMsg_ContentBlocked(routing_id_, settings_type));
+ if (current_content_settings_.settings[settings_type] == CONTENT_SETTING_BLOCK) {
+ if (!content_blocked_[settings_type]) {
+ content_blocked_[settings_type] = true;
+ Send(new ViewHostMsg_ContentBlocked(routing_id_, settings_type));
+ }
return false;
}
return true;
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 3e8e213..c09bf32 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -836,7 +836,7 @@ class RenderView : public RenderWidget,
// Helper method that returns if the user wants to block content of type
// |content_type| and sends an IPC message to the browser if content will be
// blocked.
- bool allowContentType(ContentSettingsType settings_type,
+ bool AllowContentType(ContentSettingsType settings_type,
bool enabled_per_settings);
// Resets the |content_blocked_| array.