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

Unified Diff: chrome/browser/net/chrome_network_delegate.cc

Issue 2655443003: Unify the "get" and "set" cookie access settings. (Closed)
Patch Set: rebase Created 3 years, 11 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/net/chrome_network_delegate.cc
diff --git a/chrome/browser/net/chrome_network_delegate.cc b/chrome/browser/net/chrome_network_delegate.cc
index 0a2b6b5c0e6cedb37a8f3da56d420fc28ef0e6fc..7022b379dcc7cf045cf8ca95d8daf6ab1c1eb6ee 100644
--- a/chrome/browser/net/chrome_network_delegate.cc
+++ b/chrome/browser/net/chrome_network_delegate.cc
@@ -410,7 +410,7 @@ bool ChromeNetworkDelegate::OnCanGetCookies(
if (!cookie_settings_.get())
return true;
- bool allow = cookie_settings_->IsReadingCookieAllowed(
+ bool allow = cookie_settings_->IsCookieAccessAllowed(
request.url(), request.first_party_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
@@ -433,7 +433,7 @@ bool ChromeNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
if (!cookie_settings_.get())
return true;
- bool allow = cookie_settings_->IsSettingCookieAllowed(
+ bool allow = cookie_settings_->IsCookieAccessAllowed(
request.url(), request.first_party_for_cookies());
const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(&request);
@@ -525,13 +525,7 @@ bool ChromeNetworkDelegate::OnCanEnablePrivacyMode(
if (!cookie_settings_.get())
return false;
- bool reading_cookie_allowed = false;
- bool setting_cookie_allowed = false;
- cookie_settings_->GetReadingAndSettingCookieAllowed(
- url, first_party_for_cookies, &reading_cookie_allowed,
- &setting_cookie_allowed);
- bool privacy_mode = !(reading_cookie_allowed && setting_cookie_allowed);
- return privacy_mode;
+ return !cookie_settings_->IsCookieAccessAllowed(url, first_party_for_cookies);
}
bool ChromeNetworkDelegate::OnAreExperimentalCookieFeaturesEnabled() const {

Powered by Google App Engine
This is Rietveld 408576698