| Index: ios/web/web_state/ui/crw_web_controller.mm
|
| diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
|
| index b87fdca8210473345a426bd70ff40bb71fa3feaf..1e7c47326955a1b846d668542693cd7c5a13dfed 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -563,7 +563,7 @@ NSError* WKWebViewErrorWithSource(NSError* error, WKWebViewErrorSource source) {
|
| // Returns |YES| if |url| should be loaded in a native view.
|
| - (BOOL)shouldLoadURLInNativeView:(const GURL&)url;
|
| // Loads the request into the |webView|.
|
| -- (void)loadRequest:(NSMutableURLRequest*)request;
|
| +- (WKNavigation*)loadRequest:(NSMutableURLRequest*)request;
|
| // Loads POST request with body in |_wkWebView| by constructing an HTML page
|
| // that executes the request through JavaScript and replaces document with the
|
| // result.
|
| @@ -571,7 +571,7 @@ NSError* WKWebViewErrorWithSource(NSError* error, WKWebViewErrorSource source) {
|
| // the data is passed to |_wkWebView| on main thread.
|
| // This is necessary because WKWebView ignores POST request body.
|
| // Workaround for https://bugs.webkit.org/show_bug.cgi?id=145410
|
| -- (void)loadPOSTRequest:(NSMutableURLRequest*)request;
|
| +- (WKNavigation*)loadPOSTRequest:(NSMutableURLRequest*)request;
|
| // Loads the HTML into the page at the given URL.
|
| - (void)loadHTML:(NSString*)html forURL:(const GURL&)url;
|
|
|
| @@ -4043,12 +4043,14 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| return web::WKWebViewConfigurationProvider::FromBrowserState(browserState);
|
| }
|
|
|
| -- (void)loadRequest:(NSMutableURLRequest*)request {
|
| +- (WKNavigation*)loadRequest:(NSMutableURLRequest*)request {
|
| + WKNavigation* navigation = [_webView loadRequest:request];
|
| [_navigationStates setState:web::WKNavigationState::REQUESTED
|
| - forNavigation:[_webView loadRequest:request]];
|
| + forNavigation:navigation];
|
| + return navigation;
|
| }
|
|
|
| -- (void)loadPOSTRequest:(NSMutableURLRequest*)request {
|
| +- (WKNavigation*)loadPOSTRequest:(NSMutableURLRequest*)request {
|
| if (!_POSTRequestLoader) {
|
| _POSTRequestLoader.reset([[CRWJSPOSTRequestLoader alloc] init]);
|
| }
|
| @@ -4056,17 +4058,16 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| CRWWKScriptMessageRouter* messageRouter =
|
| [self webViewConfigurationProvider].GetScriptMessageRouter();
|
|
|
| - [_POSTRequestLoader loadPOSTRequest:request
|
| - inWebView:_webView
|
| - messageRouter:messageRouter
|
| - completionHandler:^(NSError* loadError) {
|
| - if (loadError)
|
| - [self handleLoadError:loadError
|
| - inMainFrame:YES
|
| - forNavigation:nil];
|
| - else
|
| - self.webStateImpl->SetContentsMimeType("text/html");
|
| - }];
|
| + return [_POSTRequestLoader
|
| + loadPOSTRequest:request
|
| + inWebView:_webView
|
| + messageRouter:messageRouter
|
| + completionHandler:^(NSError* loadError) {
|
| + if (loadError)
|
| + [self handleLoadError:loadError inMainFrame:YES forNavigation:nil];
|
| + else
|
| + self.webStateImpl->SetContentsMimeType("text/html");
|
| + }];
|
| }
|
|
|
| - (void)loadHTML:(NSString*)HTML forURL:(const GURL&)URL {
|
|
|