| Index: ios/web_view/internal/cwv_web_view.mm
|
| diff --git a/ios/web_view/internal/cwv_web_view.mm b/ios/web_view/internal/cwv_web_view.mm
|
| index 6df0d2ac3845f06ea52ed5ef58bf542b43f1dcb7..383dc77f8393615b4037bc136e64198f19423f04 100644
|
| --- a/ios/web_view/internal/cwv_web_view.mm
|
| +++ b/ios/web_view/internal/cwv_web_view.mm
|
| @@ -20,6 +20,7 @@
|
| #import "ios/web/public/web_state/web_state_delegate_bridge.h"
|
| #import "ios/web/public/web_state/web_state_observer_bridge.h"
|
| #import "ios/web_view/internal/cwv_html_element_internal.h"
|
| +#import "ios/web_view/internal/cwv_navigation_action_internal.h"
|
| #import "ios/web_view/internal/cwv_web_view_configuration_internal.h"
|
| #import "ios/web_view/internal/translate/web_view_translate_client.h"
|
| #include "ios/web_view/internal/web_view_browser_state.h"
|
| @@ -227,6 +228,38 @@
|
| return YES;
|
| }
|
|
|
| +- (web::WebState*)webState:(web::WebState*)webState
|
| + createNewWebStateForURL:(const GURL&)URL
|
| + openerURL:(const GURL&)openerURL
|
| + initiatedByUser:(BOOL)initiatedByUser {
|
| + SEL selector =
|
| + @selector(webView:createWebViewWithConfiguration:forNavigationAction:);
|
| + if (![_UIDelegate respondsToSelector:selector]) {
|
| + return nullptr;
|
| + }
|
| +
|
| + NSURLRequest* request =
|
| + [[NSURLRequest alloc] initWithURL:net::NSURLWithGURL(URL)];
|
| + CWVNavigationAction* navigationAction =
|
| + [[CWVNavigationAction alloc] initWithRequest:request
|
| + userInitiated:initiatedByUser];
|
| + // TODO(crbug.com/702298): Window created by CWVUIDelegate should be closable.
|
| + CWVWebView* webView = [_UIDelegate webView:self
|
| + createWebViewWithConfiguration:_configuration
|
| + forNavigationAction:navigationAction];
|
| + if (!webView) {
|
| + return nullptr;
|
| + }
|
| + return webView->_webState.get();
|
| +}
|
| +
|
| +- (void)closeWebState:(web::WebState*)webState {
|
| + SEL selector = @selector(webViewDidClose:);
|
| + if ([_UIDelegate respondsToSelector:selector]) {
|
| + [_UIDelegate webViewDidClose:self];
|
| + }
|
| +}
|
| +
|
| - (web::JavaScriptDialogPresenter*)javaScriptDialogPresenterForWebState:
|
| (web::WebState*)webState {
|
| return _javaScriptDialogPresenter.get();
|
|
|