| 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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 return web_view_.get(); | 289 return web_view_.get(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void GaiaAuthFetcherIOSBridge::ResetWKWebView() { | 292 void GaiaAuthFetcherIOSBridge::ResetWKWebView() { |
| 293 [web_view_ setNavigationDelegate:nil]; | 293 [web_view_ setNavigationDelegate:nil]; |
| 294 [web_view_ stopLoading]; | 294 [web_view_ stopLoading]; |
| 295 web_view_.reset(); | 295 web_view_.reset(); |
| 296 navigation_delegate_.reset(); | 296 navigation_delegate_.reset(); |
| 297 } | 297 } |
| 298 | 298 |
| 299 WKWebView* GaiaAuthFetcherIOSBridge::CreateWKWebView() { | 299 WKWebView* GaiaAuthFetcherIOSBridge::CreateWKWebView() NS_RETURNS_RETAINED { |
| 300 return web::CreateWKWebView(CGRectZero, browser_state_); | 300 return web::CreateWKWebView(CGRectZero, browser_state_); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void GaiaAuthFetcherIOSBridge::OnActive() { | 303 void GaiaAuthFetcherIOSBridge::OnActive() { |
| 304 // |browser_state_| is now active. If there is a pending request, restart it. | 304 // |browser_state_| is now active. If there is a pending request, restart it. |
| 305 FetchPendingRequest(); | 305 FetchPendingRequest(); |
| 306 } | 306 } |
| 307 | 307 |
| 308 void GaiaAuthFetcherIOSBridge::OnInactive() { | 308 void GaiaAuthFetcherIOSBridge::OnInactive() { |
| 309 // |browser_state_| is now inactive. Stop using |web_view_| and don't create | 309 // |browser_state_| is now inactive. Stop using |web_view_| and don't create |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 } | 374 } |
| 375 | 375 |
| 376 void GaiaAuthFetcherIOS::SetShouldUseGaiaAuthFetcherIOSForTesting( | 376 void GaiaAuthFetcherIOS::SetShouldUseGaiaAuthFetcherIOSForTesting( |
| 377 bool use_gaia_fetcher_ios) { | 377 bool use_gaia_fetcher_ios) { |
| 378 g_should_use_gaia_auth_fetcher_ios = use_gaia_fetcher_ios; | 378 g_should_use_gaia_auth_fetcher_ios = use_gaia_fetcher_ios; |
| 379 } | 379 } |
| 380 | 380 |
| 381 bool GaiaAuthFetcherIOS::ShouldUseGaiaAuthFetcherIOS() { | 381 bool GaiaAuthFetcherIOS::ShouldUseGaiaAuthFetcherIOS() { |
| 382 return g_should_use_gaia_auth_fetcher_ios; | 382 return g_should_use_gaia_auth_fetcher_ios; |
| 383 } | 383 } |
| OLD | NEW |