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

Unified Diff: chrome/browser/cookies_tree_model.cc

Issue 7713034: HostContentSettingsMap refactoring. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixing the previous 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/cookies_tree_model.cc
diff --git a/chrome/browser/cookies_tree_model.cc b/chrome/browser/cookies_tree_model.cc
index b2660ec852bd9e74151437ebe6205018cdccdf6b..350c6eaf3e292ec7e16d7015af64d425e45c3d7e 100644
--- a/chrome/browser/cookies_tree_model.cc
+++ b/chrome/browser/cookies_tree_model.cc
@@ -14,6 +14,8 @@
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browsing_data_cookie_helper.h"
+#include "chrome/browser/content_settings/content_settings_pattern.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/extensions/extension_service.h"
#include "content/browser/in_process_webkit/webkit_context.h"
@@ -454,11 +456,20 @@ CookieTreeQuotaNode* CookieTreeOriginNode::UpdateOrCreateQuotaNode(
void CookieTreeOriginNode::CreateContentException(
HostContentSettingsMap* content_settings, ContentSetting setting) const {
if (CanCreateContentException()) {
- content_settings->AddExceptionForURL(url_,
- url_,
- CONTENT_SETTINGS_TYPE_COOKIES,
- "",
- setting);
+ CookieSettings* cookie_settings = content_settings->GetCookieSettings();
+ cookie_settings->ResetCookieAllowed(
+ ContentSettingsPattern::FromURLNoWildcard(url_),
+ ContentSettingsPattern::Wildcard());
+ cookie_settings->ResetCookieSessionOnly(
+ ContentSettingsPattern::FromURLNoWildcard(url_));
+ bool allow = (setting == CONTENT_SETTING_ALLOW ||
+ setting == CONTENT_SETTING_SESSION_ONLY);
+ bool session_only = (setting == CONTENT_SETTING_SESSION_ONLY);
+ cookie_settings->SetCookieAllowed(ContentSettingsPattern::FromURL(url_),
+ ContentSettingsPattern::Wildcard(),
+ allow);
+ cookie_settings->SetCookieSessionOnly(ContentSettingsPattern::FromURL(url_),
+ session_only);
}
}

Powered by Google App Engine
This is Rietveld 408576698