| 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 7004abe1238e6abad6897604ecbf05a43e78b256..ca95923e5107fef6eb823af168810854236d1a1b 100644
|
| --- a/ios/web/web_state/ui/crw_web_controller.mm
|
| +++ b/ios/web/web_state/ui/crw_web_controller.mm
|
| @@ -4361,11 +4361,17 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| NSString* referrer = [self referrerFromNavigationAction:action];
|
| GURL openerURL =
|
| referrer ? GURL(base::SysNSStringToUTF8(referrer)) : _documentURL;
|
| - CRWWebController* child = [_delegate webController:self
|
| - createWebControllerForURL:requestURL
|
| - openerURL:openerURL
|
| - initiatedByUser:[self userIsInteracting]];
|
| - DCHECK(!child || child.sessionController.openedByDOM);
|
| +
|
| + WebState* childWebState = _webStateImpl->CreateNewWebState(
|
| + requestURL, openerURL, [self userIsInteracting]);
|
| + if (!childWebState)
|
| + return nil;
|
| +
|
| + CRWWebController* childWebController =
|
| + static_cast<WebStateImpl*>(childWebState)->GetWebController();
|
| +
|
| + DCHECK(!childWebController ||
|
| + childWebController.sessionController.openedByDOM);
|
|
|
| // WKWebView requires WKUIDelegate to return a child view created with
|
| // exactly the same |configuration| object (exception is raised if config is
|
| @@ -4373,8 +4379,8 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
|
| // WKWebViewConfigurationProvider are different objects because WKWebView
|
| // makes a shallow copy of the config inside init, so every WKWebView
|
| // owns a separate shallow copy of WKWebViewConfiguration.
|
| - [child ensureWebViewCreatedWithConfiguration:configuration];
|
| - return child.webView;
|
| + [childWebController ensureWebViewCreatedWithConfiguration:configuration];
|
| + return childWebController.webView;
|
| }
|
|
|
| - (void)webViewDidClose:(WKWebView*)webView {
|
|
|