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

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

Issue 8383004: Adding CookieSettings for storing cookie content settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing the rebase. Created 9 years, 2 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 82305d365975711a5d0b792ca270bd6abbd462a7..f6a76bd1c2260cf2db49f267f98758f6b3315500 100644
--- a/chrome/browser/extensions/extension_content_settings_api.cc
+++ b/chrome/browser/extensions/extension_content_settings_api.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/values.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/extensions/extension_content_settings_api_constants.h"
#include "chrome/browser/extensions/extension_content_settings_helpers.h"
@@ -128,6 +129,7 @@ bool GetContentSettingFunction::RunImpl() {
}
HostContentSettingsMap* map;
+ CookieSettings* cookie_settings;
if (incognito) {
if (!profile()->HasOffTheRecordProfile()) {
// TODO(bauerb): Allow reading incognito content settings
@@ -136,16 +138,19 @@ bool GetContentSettingFunction::RunImpl() {
return false;
}
map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap();
+ cookie_settings = CookieSettings::GetForProfile(
+ profile()->GetOffTheRecordProfile());
} else {
map = profile()->GetHostContentSettingsMap();
+ cookie_settings = CookieSettings::GetForProfile(profile());
}
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);
+ setting = cookie_settings->GetCookieSetting(primary_url, secondary_url,
+ setting_cookie);
} else {
setting = map->GetContentSetting(primary_url, secondary_url, content_type,
resource_identifier);
« no previous file with comments | « chrome/browser/cookies_tree_model_unittest.cc ('k') | chrome/browser/extensions/extension_content_settings_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698