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

Unified Diff: chrome/browser/content_settings/host_content_settings_map.cc

Issue 8462003: Exempt chrome-extension:// from third-party cookie rules, but not from regular content settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/content_settings/host_content_settings_map.cc
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 3b4d4db3938734034237b0864253ffec3cf0a266..fcb1001ee343673b446820ed3ec608143b53caa4 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(secondary_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& first_party_url,
Bernhard Bauer 2011/11/04 12:12:42 I think we should swap these parameters, no? IIRC
jochen (gone - plz use gerrit) 2011/11/04 12:24:25 I still don't like this primary/secondary naming s
const GURL& url,
ContentSettingsType content_type) {
if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS)
return false;
+ if (url.SchemeIs(chrome::kExtensionScheme)) {
+ return content_type != CONTENT_SETTINGS_TYPE_COOKIES ||
+ first_party_url.SchemeIs(chrome::kExtensionScheme);
+ }
return url.SchemeIs(chrome::kChromeDevToolsScheme) ||
url.SchemeIs(chrome::kChromeInternalScheme) ||
- url.SchemeIs(chrome::kChromeUIScheme) ||
- url.SchemeIs(chrome::kExtensionScheme);
+ url.SchemeIs(chrome::kChromeUIScheme);
}
« no previous file with comments | « chrome/browser/content_settings/host_content_settings_map.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698