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

Side by Side Diff: components/signin/core/browser/signin_header_helper.cc

Issue 2655443003: Unify the "get" and "set" cookie access settings. (Closed)
Patch Set: rebase Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/signin/core/browser/signin_header_helper.h" 5 #include "components/signin/core/browser/signin_header_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 ManageAccountsParams::ManageAccountsParams(const ManageAccountsParams& other) = 159 ManageAccountsParams::ManageAccountsParams(const ManageAccountsParams& other) =
160 default; 160 default;
161 161
162 bool SettingsAllowSigninCookies( 162 bool SettingsAllowSigninCookies(
163 const content_settings::CookieSettings* cookie_settings) { 163 const content_settings::CookieSettings* cookie_settings) {
164 GURL gaia_url = GaiaUrls::GetInstance()->gaia_url(); 164 GURL gaia_url = GaiaUrls::GetInstance()->gaia_url();
165 GURL google_url = GaiaUrls::GetInstance()->google_url(); 165 GURL google_url = GaiaUrls::GetInstance()->google_url();
166 return cookie_settings && 166 return cookie_settings &&
167 cookie_settings->IsSettingCookieAllowed(gaia_url, gaia_url) && 167 cookie_settings->IsCookieAccessAllowed(gaia_url, gaia_url) &&
168 cookie_settings->IsSettingCookieAllowed(google_url, google_url); 168 cookie_settings->IsCookieAccessAllowed(google_url, google_url);
169 } 169 }
170 170
171 std::string BuildMirrorRequestCookieIfPossible( 171 std::string BuildMirrorRequestCookieIfPossible(
172 const GURL& url, 172 const GURL& url,
173 const std::string& account_id, 173 const std::string& account_id,
174 const content_settings::CookieSettings* cookie_settings, 174 const content_settings::CookieSettings* cookie_settings,
175 int profile_mode_mask) { 175 int profile_mode_mask) {
176 return BuildMirrorRequestIfPossible(false /* is_header_request */, url, 176 return BuildMirrorRequestIfPossible(false /* is_header_request */, url,
177 account_id, cookie_settings, 177 account_id, cookie_settings,
178 profile_mode_mask); 178 profile_mode_mask);
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 url, google_util::ALLOW_SUBDOMAIN, 273 url, google_util::ALLOW_SUBDOMAIN,
274 google_util::DISALLOW_NON_STANDARD_PORTS) || 274 google_util::DISALLOW_NON_STANDARD_PORTS) ||
275 google_util::IsYoutubeDomainUrl( 275 google_util::IsYoutubeDomainUrl(
276 url, google_util::ALLOW_SUBDOMAIN, 276 url, google_util::ALLOW_SUBDOMAIN,
277 google_util::DISALLOW_NON_STANDARD_PORTS)); 277 google_util::DISALLOW_NON_STANDARD_PORTS));
278 return is_google_url || IsDriveOrigin(origin) || 278 return is_google_url || IsDriveOrigin(origin) ||
279 gaia::IsGaiaSignonRealm(origin); 279 gaia::IsGaiaSignonRealm(origin);
280 } 280 }
281 281
282 } // namespace signin 282 } // namespace signin
OLDNEW
« no previous file with comments | « components/content_settings/core/browser/cookie_settings_unittest.cc ('k') | content/shell/browser/shell_network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698