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

Unified Diff: chrome/browser/extensions/extension_content_settings_api.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 4 months 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
Index: chrome/browser/extensions/extension_content_settings_api.cc
diff --git a/chrome/browser/extensions/extension_content_settings_api.cc b/chrome/browser/extensions/extension_content_settings_api.cc
index b76024e6c056c08b04ecee1ecb09b3a3e19ef729..eea7451fed28c54297bc7aa98c661d23e2b69b46 100644
--- a/chrome/browser/extensions/extension_content_settings_api.cc
+++ b/chrome/browser/extensions/extension_content_settings_api.cc
@@ -128,6 +128,7 @@ bool GetContentSettingFunction::RunImpl() {
}
HostContentSettingsMap* map;
+ CookieContentSettings* cookie_content_settings;
if (incognito) {
if (!profile()->HasOffTheRecordProfile()) {
// TODO(bauerb): Allow reading incognito content settings
@@ -136,16 +137,24 @@ bool GetContentSettingFunction::RunImpl() {
return false;
}
map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap();
+ cookie_content_settings =
+ profile()->GetOffTheRecordProfile()->GetCookieContentSettings();
} else {
map = profile()->GetHostContentSettingsMap();
+ cookie_content_settings =
+ profile()->GetOffTheRecordProfile()->GetCookieContentSettings();
}
ContentSetting setting;
if (content_type == CONTENT_SETTINGS_TYPE_COOKIES) {
// TODO(jochen): Do we return the value for setting or for reading cookies?
bool setting_cookie = false;
- setting = map->GetCookieContentSetting(primary_url, secondary_url,
- setting_cookie);
+ if (cookie_content_settings->Allow(primary_url, secondary_url,
+ setting_cookie)) {
+ setting = CONTENT_SETTING_ALLOW;
+ } else {
+ setting = CONTENT_SETTING_BLOCK;
+ }
} else {
setting = map->GetContentSetting(primary_url, secondary_url, content_type,
resource_identifier);

Powered by Google App Engine
This is Rietveld 408576698