| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" | 5 #import "ios/web/web_state/ui/crw_wk_web_view_web_controller.h" |
| 6 | 6 |
| 7 #import <WebKit/WebKit.h> | 7 #import <WebKit/WebKit.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" | 52 #import "ios/web/web_state/ui/wk_web_view_configuration_provider.h" |
| 53 #import "ios/web/web_state/web_state_impl.h" | 53 #import "ios/web/web_state/web_state_impl.h" |
| 54 #import "ios/web/web_state/web_view_internal_creation_util.h" | 54 #import "ios/web/web_state/web_view_internal_creation_util.h" |
| 55 #import "ios/web/web_state/wk_web_view_security_util.h" | 55 #import "ios/web/web_state/wk_web_view_security_util.h" |
| 56 #import "ios/web/webui/crw_web_ui_manager.h" | 56 #import "ios/web/webui/crw_web_ui_manager.h" |
| 57 #import "net/base/mac/url_conversions.h" | 57 #import "net/base/mac/url_conversions.h" |
| 58 #include "net/cert/x509_certificate.h" | 58 #include "net/cert/x509_certificate.h" |
| 59 #include "net/ssl/ssl_info.h" | 59 #include "net/ssl/ssl_info.h" |
| 60 #include "url/url_constants.h" | 60 #include "url/url_constants.h" |
| 61 | 61 |
| 62 using web::NavigationManager; |
| 63 |
| 62 namespace { | 64 namespace { |
| 63 | 65 |
| 64 // Represents cert verification error, which happened inside | 66 // Represents cert verification error, which happened inside |
| 65 // |webView:didReceiveAuthenticationChallenge:completionHandler:| and should | 67 // |webView:didReceiveAuthenticationChallenge:completionHandler:| and should |
| 66 // be checked inside |webView:didFailProvisionalNavigation:withError:|. | 68 // be checked inside |webView:didFailProvisionalNavigation:withError:|. |
| 67 struct CertVerificationError { | 69 struct CertVerificationError { |
| 68 CertVerificationError(BOOL is_recoverable, net::CertStatus status) | 70 CertVerificationError(BOOL is_recoverable, net::CertStatus status) |
| 69 : is_recoverable(is_recoverable), status(status) {} | 71 : is_recoverable(is_recoverable), status(status) {} |
| 70 | 72 |
| 71 BOOL is_recoverable; | 73 BOOL is_recoverable; |
| (...skipping 1720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1792 // created by window.open (default is about::blank). | 1794 // created by window.open (default is about::blank). |
| 1793 if (self.lastRegisteredRequestURL != webViewURL || | 1795 if (self.lastRegisteredRequestURL != webViewURL || |
| 1794 self.loadPhase != web::LOAD_REQUESTED) { | 1796 self.loadPhase != web::LOAD_REQUESTED) { |
| 1795 // Reset current WebUI if one exists. | 1797 // Reset current WebUI if one exists. |
| 1796 [self clearWebUI]; | 1798 [self clearWebUI]; |
| 1797 // Restart app specific URL loads to properly capture state. | 1799 // Restart app specific URL loads to properly capture state. |
| 1798 // TODO(crbug.com/546347): Extract necessary tasks for app specific URL | 1800 // TODO(crbug.com/546347): Extract necessary tasks for app specific URL |
| 1799 // navigation rather than restarting the load. | 1801 // navigation rather than restarting the load. |
| 1800 if (web::GetWebClient()->IsAppSpecificURL(webViewURL)) { | 1802 if (web::GetWebClient()->IsAppSpecificURL(webViewURL)) { |
| 1801 [self abortWebLoad]; | 1803 [self abortWebLoad]; |
| 1802 web::WebLoadParams params(webViewURL); | 1804 NavigationManager::WebLoadParams params(webViewURL); |
| 1803 [self loadWithParams:params]; | 1805 [self loadWithParams:params]; |
| 1804 return; | 1806 return; |
| 1805 } else { | 1807 } else { |
| 1806 [self registerLoadRequest:webViewURL]; | 1808 [self registerLoadRequest:webViewURL]; |
| 1807 } | 1809 } |
| 1808 } | 1810 } |
| 1809 // Ensure the URL is registered and loadPhase is as expected. | 1811 // Ensure the URL is registered and loadPhase is as expected. |
| 1810 DCHECK(self.lastRegisteredRequestURL == webViewURL); | 1812 DCHECK(self.lastRegisteredRequestURL == webViewURL); |
| 1811 DCHECK(self.loadPhase == web::LOAD_REQUESTED); | 1813 DCHECK(self.loadPhase == web::LOAD_REQUESTED); |
| 1812 _latestWKNavigation.reset([navigation retain]); | 1814 _latestWKNavigation.reset([navigation retain]); |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2087 runJavaScriptTextInputPanelWithPrompt:prompt | 2089 runJavaScriptTextInputPanelWithPrompt:prompt |
| 2088 defaultText:defaultText | 2090 defaultText:defaultText |
| 2089 requestURL:requestURL | 2091 requestURL:requestURL |
| 2090 completionHandler:completionHandler]; | 2092 completionHandler:completionHandler]; |
| 2091 } else if (completionHandler) { | 2093 } else if (completionHandler) { |
| 2092 completionHandler(nil); | 2094 completionHandler(nil); |
| 2093 } | 2095 } |
| 2094 } | 2096 } |
| 2095 | 2097 |
| 2096 @end | 2098 @end |
| OLD | NEW |