| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/signin/gaia_auth_fetcher_ios.h" | 5 #include "ios/chrome/browser/signin/gaia_auth_fetcher_ios.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 | 8 |
| 9 #include "base/json/string_escape.h" | 9 #include "base/json/string_escape.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 } | 313 } |
| 314 | 314 |
| 315 #pragma mark - GaiaAuthFetcherIOS definition | 315 #pragma mark - GaiaAuthFetcherIOS definition |
| 316 | 316 |
| 317 GaiaAuthFetcherIOS::GaiaAuthFetcherIOS(GaiaAuthConsumer* consumer, | 317 GaiaAuthFetcherIOS::GaiaAuthFetcherIOS(GaiaAuthConsumer* consumer, |
| 318 const std::string& source, | 318 const std::string& source, |
| 319 net::URLRequestContextGetter* getter, | 319 net::URLRequestContextGetter* getter, |
| 320 web::BrowserState* browser_state) | 320 web::BrowserState* browser_state) |
| 321 : GaiaAuthFetcher(consumer, source, getter), | 321 : GaiaAuthFetcher(consumer, source, getter), |
| 322 bridge_(new GaiaAuthFetcherIOSBridge(this, browser_state)), | 322 bridge_(new GaiaAuthFetcherIOSBridge(this, browser_state)), |
| 323 browser_state_(browser_state) {} | 323 browser_state_(browser_state) { |
| 324 // Account Consistency needs to be disabled for the Logout call. There is a |
| 325 // race with the cookie clearing request (handled by |
| 326 // AccountConsistencyService), so we invalidate the cookie for the call. |
| 327 SetLogoutHeaders("Cookie: X-CHROME-CONNECTED=EXPIRED;"); |
| 328 } |
| 324 | 329 |
| 325 GaiaAuthFetcherIOS::~GaiaAuthFetcherIOS() { | 330 GaiaAuthFetcherIOS::~GaiaAuthFetcherIOS() { |
| 326 } | 331 } |
| 327 | 332 |
| 328 void GaiaAuthFetcherIOS::CreateAndStartGaiaFetcher(const std::string& body, | 333 void GaiaAuthFetcherIOS::CreateAndStartGaiaFetcher(const std::string& body, |
| 329 const std::string& headers, | 334 const std::string& headers, |
| 330 const GURL& gaia_gurl, | 335 const GURL& gaia_gurl, |
| 331 int load_flags) { | 336 int load_flags) { |
| 332 DCHECK(!HasPendingFetch()) << "Tried to fetch two things at once!"; | 337 DCHECK(!HasPendingFetch()) << "Tried to fetch two things at once!"; |
| 333 | 338 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 371 | 376 |
| 372 void GaiaAuthFetcherIOS::SetShouldUseGaiaAuthFetcherIOSForTesting( | 377 void GaiaAuthFetcherIOS::SetShouldUseGaiaAuthFetcherIOSForTesting( |
| 373 bool use_gaia_fetcher_ios) { | 378 bool use_gaia_fetcher_ios) { |
| 374 g_should_use_gaia_auth_fetcher_ios = use_gaia_fetcher_ios; | 379 g_should_use_gaia_auth_fetcher_ios = use_gaia_fetcher_ios; |
| 375 } | 380 } |
| 376 | 381 |
| 377 bool GaiaAuthFetcherIOS::ShouldUseGaiaAuthFetcherIOS() { | 382 bool GaiaAuthFetcherIOS::ShouldUseGaiaAuthFetcherIOS() { |
| 378 return experimental_flags::IsWKWebViewEnabled() && | 383 return experimental_flags::IsWKWebViewEnabled() && |
| 379 g_should_use_gaia_auth_fetcher_ios; | 384 g_should_use_gaia_auth_fetcher_ios; |
| 380 } | 385 } |
| OLD | NEW |