summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cookie_modal_dialog.cc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 07:32:14 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-26 07:32:14 +0000
commitdecdd511099c41390b0cfc8859bf93bc1a628e0a (patch)
treecd5ba0ec818289b57b76bdebf51bd78c0f87a49c /chrome/browser/cookie_modal_dialog.cc
parenta7a7735b1c0b8a4b1c9d40ede057e9081ef3c6a1 (diff)
downloadchromium_src-decdd511099c41390b0cfc8859bf93bc1a628e0a.zip
chromium_src-decdd511099c41390b0cfc8859bf93bc1a628e0a.tar.gz
chromium_src-decdd511099c41390b0cfc8859bf93bc1a628e0a.tar.bz2
Clear non-wildcard content settings before setting from bubble or prompt.
BUG=42359 TEST=manual Review URL: http://codereview.chromium.org/1707011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45571 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookie_modal_dialog.cc')
-rw-r--r--chrome/browser/cookie_modal_dialog.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/browser/cookie_modal_dialog.cc b/chrome/browser/cookie_modal_dialog.cc
index 0135fad..ed86178 100644
--- a/chrome/browser/cookie_modal_dialog.cc
+++ b/chrome/browser/cookie_modal_dialog.cc
@@ -101,6 +101,11 @@ void CookiePromptModalDialog::AllowSiteData(bool remember,
bool session_expire) {
DCHECK(!remember || DecisionPersistable());
if (remember && DecisionPersistable()) {
+ // Make sure there is no entry that would override the pattern we are about
+ // to insert for exactly this URL.
+ host_content_settings_map_->SetContentSetting(
+ HostContentSettingsMap::Pattern::FromURLNoWildcard(origin_),
+ CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_DEFAULT);
host_content_settings_map_->SetContentSetting(
HostContentSettingsMap::Pattern::FromURL(origin_),
CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_ALLOW);
@@ -115,6 +120,11 @@ void CookiePromptModalDialog::AllowSiteData(bool remember,
void CookiePromptModalDialog::BlockSiteData(bool remember) {
DCHECK(!remember || DecisionPersistable());
if (remember && DecisionPersistable()) {
+ // Make sure there is no entry that would override the pattern we are about
+ // to insert for exactly this URL.
+ host_content_settings_map_->SetContentSetting(
+ HostContentSettingsMap::Pattern::FromURLNoWildcard(origin_),
+ CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_DEFAULT);
host_content_settings_map_->SetContentSetting(
HostContentSettingsMap::Pattern::FromURL(origin_),
CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK);