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

Unified Diff: chrome/browser/chrome_content_browser_client.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
« no previous file with comments | « no previous file | chrome/browser/chrome_worker_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index cd84fd2ae9d09aab250859e1c97adf1dd98f7761..9be88fca60e5b514d1698c66c5c15f27726730c6 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -14,7 +14,7 @@
#include "chrome/browser/chrome_plugin_message_filter.h"
#include "chrome/browser/chrome_quota_permission_context.h"
#include "chrome/browser/chrome_worker_message_filter.h"
-#include "chrome/browser/content_settings/host_content_settings_map.h"
+#include "chrome/browser/content_settings/cookie_settings.h"
#include "chrome/browser/content_settings/tab_specific_content_settings.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/extensions/extension_info_map.h"
@@ -584,10 +584,8 @@ bool ChromeContentBrowserClient::AllowAppCache(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(manifest_url, first_party, true);
- DCHECK(setting != CONTENT_SETTING_DEFAULT);
- return setting != CONTENT_SETTING_BLOCK;
+ return io_data->GetCookieSettings()->
+ IsSettingCookieAllowed(manifest_url, first_party);
}
bool ChromeContentBrowserClient::AllowGetCookie(
@@ -600,10 +598,8 @@ bool ChromeContentBrowserClient::AllowGetCookie(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(url, first_party, false);
- bool allow = setting == CONTENT_SETTING_ALLOW ||
- setting == CONTENT_SETTING_SESSION_ONLY;
+ bool allow = io_data->GetCookieSettings()->
+ IsReadingCookieAllowed(url, first_party);
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -624,14 +620,12 @@ bool ChromeContentBrowserClient::AllowSetCookie(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
ProfileIOData* io_data =
reinterpret_cast<ProfileIOData*>(context.GetUserData(NULL));
- ContentSetting setting = io_data->GetHostContentSettingsMap()->
- GetCookieContentSetting(url, first_party, true);
- if (setting == CONTENT_SETTING_SESSION_ONLY)
- options->set_force_session();
+ CookieSettings* cookie_settings = io_data->GetCookieSettings();
+ bool allow = cookie_settings->IsSettingCookieAllowed(url, first_party);
- bool allow = setting == CONTENT_SETTING_ALLOW ||
- setting == CONTENT_SETTING_SESSION_ONLY;
+ if (cookie_settings->IsCookieSessionOnly(url))
+ options->set_force_session();
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
« no previous file with comments | « no previous file | chrome/browser/chrome_worker_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698