diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 16:16:03 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-04 16:16:03 +0000 |
commit | eb1efc4f57535df05e213b6f27be9b7246621722 (patch) | |
tree | 14ae3ea57f08b4b3f2eefca44389470ebedd51d8 /chrome/browser/content_settings/host_content_settings_map.cc | |
parent | bf401520b51d6709da69021833d7797fb915c1c4 (diff) | |
download | chromium_src-eb1efc4f57535df05e213b6f27be9b7246621722.zip chromium_src-eb1efc4f57535df05e213b6f27be9b7246621722.tar.gz chromium_src-eb1efc4f57535df05e213b6f27be9b7246621722.tar.bz2 |
Exempt chrome-extension:// from third-party cookie rules, but not from regular content settings
BUG=99588
TEST=CookieSettingsTest
Review URL: http://codereview.chromium.org/8462003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/content_settings/host_content_settings_map.cc')
-rw-r--r-- | chrome/browser/content_settings/host_content_settings_map.cc | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 7f0c44a0..13da43c 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -184,7 +184,7 @@ base::Value* HostContentSettingsMap::GetContentSettingValue( resource_identifier.empty()); // Check if the scheme of the requesting url is whitelisted. - if (ShouldAllowAllContent(primary_url, content_type)) + if (ShouldAllowAllContent(primary_url, secondary_url, content_type)) return Value::CreateIntegerValue(CONTENT_SETTING_ALLOW); // The list of |content_settings_providers_| is ordered according to their @@ -405,12 +405,16 @@ void HostContentSettingsMap::AddSettingsForOneType( } bool HostContentSettingsMap::ShouldAllowAllContent( - const GURL& url, + const GURL& primary_url, + const GURL& secondary_url, ContentSettingsType content_type) { if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) return false; - return url.SchemeIs(chrome::kChromeDevToolsScheme) || - url.SchemeIs(chrome::kChromeInternalScheme) || - url.SchemeIs(chrome::kChromeUIScheme) || - url.SchemeIs(chrome::kExtensionScheme); + if (primary_url.SchemeIs(chrome::kExtensionScheme)) { + return content_type != CONTENT_SETTINGS_TYPE_COOKIES || + secondary_url.SchemeIs(chrome::kExtensionScheme); + } + return primary_url.SchemeIs(chrome::kChromeDevToolsScheme) || + primary_url.SchemeIs(chrome::kChromeInternalScheme) || + primary_url.SchemeIs(chrome::kChromeUIScheme); } |