Chromium Code Reviews| 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..9f036a80e20ddf851e0d4041f01ae9252d8ed9d9 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,25 @@ bool GetContentSettingFunction::RunImpl() { |
| return false; |
| } |
| map = profile()->GetOffTheRecordProfile()->GetHostContentSettingsMap(); |
| + cookie_settings = CookieSettings::GetForProfile( |
| + profile()->GetOffTheRecordProfile()); |
| } else { |
| map = profile()->GetHostContentSettingsMap(); |
| + cookie_settings = CookieSettings::GetForProfile(profile()); |
| } |
| + DCHECK(cookie_settings != NULL); |
| 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_settings->IsReadingCookieAllowed(primary_url, secondary_url)) { |
| + if (cookie_settings->IsCookieSessionOnly(primary_url)) |
|
Bernhard Bauer
2011/09/05 11:05:38
For the content settings extension API we can expo
marja
2011/09/06 08:30:15
Do you mean here we'd just return the raw setting
|
| + setting = CONTENT_SETTING_SESSION_ONLY; |
| + else |
| + setting = CONTENT_SETTING_ALLOW; |
| + } else { |
| + setting = CONTENT_SETTING_BLOCK; |
| + } |
| } else { |
| setting = map->GetContentSetting(primary_url, secondary_url, content_type, |
| resource_identifier); |