Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Unified Diff: ios/web_view/shell/shell_view_controller.m

Issue 2760143002: Update ios/web_view/shell UIDelegate implementation. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/web_view/internal/cwv_web_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web_view/shell/shell_view_controller.m
diff --git a/ios/web_view/shell/shell_view_controller.m b/ios/web_view/shell/shell_view_controller.m
index f96b0997f2b6b3559b7067053d4bf90e519b0787..98e1bbb6d53f7bf8042623f2549f90adaca1ae29 100644
--- a/ios/web_view/shell/shell_view_controller.m
+++ b/ios/web_view/shell/shell_view_controller.m
@@ -8,6 +8,7 @@
#import "ios/web_view/public/cwv.h"
#import "ios/web_view/public/cwv_html_element.h"
+#import "ios/web_view/public/cwv_navigation_action.h"
#import "ios/web_view/public/cwv_navigation_delegate.h"
#import "ios/web_view/public/cwv_ui_delegate.h"
#import "ios/web_view/public/cwv_web_view.h"
@@ -139,6 +140,7 @@ NSString* const kWebViewShellJavaScriptDialogTextFieldAccessibiltyIdentifier =
self.webView = [CWV webViewWithFrame:[_containerView bounds]];
_webView.navigationDelegate = self;
+ _webView.UIDelegate = self;
_translateController = [[TranslateController alloc] init];
_webView.translationDelegate = _translateController;
@@ -194,6 +196,18 @@ NSString* const kWebViewShellJavaScriptDialogTextFieldAccessibiltyIdentifier =
#pragma mark CWVUIDelegate methods
+- (CWVWebView*)webView:(CWVWebView*)webView
+ createWebViewWithConfiguration:(CWVWebViewConfiguration*)configuration
+ forNavigationAction:(CWVNavigationAction*)action {
+ NSLog(@"Create new CWVWebView for %@. User initiated? %@", action.request.URL,
+ action.userInitiated ? @"Yes" : @"No");
+ return nil;
+}
+
+- (void)webViewDidClose:(CWVWebView*)webView {
+ NSLog(@"webViewDidClose");
+}
+
- (void)webView:(CWVWebView*)webView
runContextMenuWithTitle:(NSString*)menuTitle
forHTMLElement:(CWVHTMLElement*)element
« no previous file with comments | « ios/web_view/internal/cwv_web_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698