summaryrefslogtreecommitdiffstats
path: root/chrome/browser/content_settings/tab_specific_content_settings.cc
diff options
context:
space:
mode:
authormarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 11:56:56 +0000
committermarja@chromium.org <marja@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 11:56:56 +0000
commitedece2111f69da5328faa06ca23b760016a62bcd (patch)
tree7fe93400714773d399579a3fdfea22559e7490ce /chrome/browser/content_settings/tab_specific_content_settings.cc
parent2676cd5647572899d3672edf04bf48c65ced5b71 (diff)
downloadchromium_src-edece2111f69da5328faa06ca23b760016a62bcd.zip
chromium_src-edece2111f69da5328faa06ca23b760016a62bcd.tar.gz
chromium_src-edece2111f69da5328faa06ca23b760016a62bcd.tar.bz2
Take script URLs into account when applying script content settings.
Transmit script content settings to the renderer. Use the script URL as the secondary URL for the content setting rules. This CL contains the functionality of the following 2 CLs, hopefully without performance regressions: http://codereview.chromium.org/8409006 http://codereview.chromium.org/8498007 BUG=90840 TEST=ChromeRenderViewTest.ContentSettings(Allow|Block)Scripts Review URL: http://codereview.chromium.org/8538004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/tab_specific_content_settings.cc')
-rw-r--r--chrome/browser/content_settings/tab_specific_content_settings.cc22
1 files changed, 5 insertions, 17 deletions
diff --git a/chrome/browser/content_settings/tab_specific_content_settings.cc b/chrome/browser/content_settings/tab_specific_content_settings.cc
index 09735ce..3009f25 100644
--- a/chrome/browser/content_settings/tab_specific_content_settings.cc
+++ b/chrome/browser/content_settings/tab_specific_content_settings.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/browsing_data_indexed_db_helper.h"
#include "chrome/browser/browsing_data_local_storage_helper.h"
#include "chrome/browser/content_settings/content_settings_details.h"
+#include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/cookies_tree_model.h"
#include "chrome/browser/profiles/profile.h"
@@ -430,15 +431,6 @@ void TabSpecificContentSettings::DidNavigateMainFrame(
}
}
-void TabSpecificContentSettings::RenderViewCreated(
- RenderViewHost* render_view_host) {
- Profile* profile =
- Profile::FromBrowserContext(tab_contents()->browser_context());
- HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
- render_view_host->Send(new ChromeViewMsg_SetDefaultContentSettings(
- map->GetDefaultContentSettings()));
-}
-
void TabSpecificContentSettings::DidStartProvisionalLoadForFrame(
int64 frame_id,
bool is_main_frame,
@@ -485,14 +477,10 @@ void TabSpecificContentSettings::Observe(
settings_details.ptr()->primary_pattern().Matches(entry_url)) {
Profile* profile =
Profile::FromBrowserContext(tab_contents()->browser_context());
- HostContentSettingsMap* map = profile->GetHostContentSettingsMap();
- Send(new ChromeViewMsg_SetDefaultContentSettings(
- map->GetDefaultContentSettings()));
- Send(new ChromeViewMsg_SetContentSettingsForCurrentURL(
- entry_url, map->GetContentSettings(entry_url)));
- ContentSettingsForOneType settings;
- map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "", &settings);
- Send(new ChromeViewMsg_SetImageSettingRules(settings));
+ RendererContentSettingRules rules;
+ GetRendererContentSettingRules(profile->GetHostContentSettingsMap(),
+ &rules);
+ Send(new ChromeViewMsg_SetContentSettingRules(rules));
}
}