summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 02:17:03 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 02:17:03 +0000
commit7c43b24e3a317af4dd6ddcf16d34742b88057571 (patch)
tree3a045c4b2170f8298ab12dea84f7fc26d67414f5
parent4b0bd9f84fa6876f2243318083b12cc10d080a64 (diff)
downloadchromium_src-7c43b24e3a317af4dd6ddcf16d34742b88057571.zip
chromium_src-7c43b24e3a317af4dd6ddcf16d34742b88057571.tar.gz
chromium_src-7c43b24e3a317af4dd6ddcf16d34742b88057571.tar.bz2
Merge 38067 - 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 TBR=jochen@chromium.org Review URL: http://codereview.chromium.org/562046 git-svn-id: svn://svn.chromium.org/chrome/branches/249/src@38072 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 8839917..bae9ffb 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1894,11 +1894,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(
@@ -2520,7 +2520,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);
}
@@ -3013,15 +3013,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 0889dfd..d6e6c13 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -767,7 +767,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.