summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cookie_modal_dialog.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cookie_modal_dialog.cc')
-rw-r--r--chrome/browser/cookie_modal_dialog.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/cookie_modal_dialog.cc b/chrome/browser/cookie_modal_dialog.cc
index 1e1526c..0135fad 100644
--- a/chrome/browser/cookie_modal_dialog.cc
+++ b/chrome/browser/cookie_modal_dialog.cc
@@ -99,7 +99,8 @@ bool CookiePromptModalDialog::IsValid() {
void CookiePromptModalDialog::AllowSiteData(bool remember,
bool session_expire) {
- if (remember) {
+ DCHECK(!remember || DecisionPersistable());
+ if (remember && DecisionPersistable()) {
host_content_settings_map_->SetContentSetting(
HostContentSettingsMap::Pattern::FromURL(origin_),
CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_ALLOW);
@@ -112,7 +113,8 @@ void CookiePromptModalDialog::AllowSiteData(bool remember,
}
void CookiePromptModalDialog::BlockSiteData(bool remember) {
- if (remember) {
+ DCHECK(!remember || DecisionPersistable());
+ if (remember && DecisionPersistable()) {
host_content_settings_map_->SetContentSetting(
HostContentSettingsMap::Pattern::FromURL(origin_),
CONTENT_SETTINGS_TYPE_COOKIES, CONTENT_SETTING_BLOCK);
@@ -134,3 +136,7 @@ int CookiePromptModalDialog::GetDialogButtons() {
return MessageBoxFlags::DIALOGBUTTON_OK |
MessageBoxFlags::DIALOGBUTTON_CANCEL;
}
+
+bool CookiePromptModalDialog::DecisionPersistable() {
+ return !host_content_settings_map_->IsOffTheRecord();
+}