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

Unified Diff: ios/web/public/web_state/web_state_delegate_bridge.h

Issue 2737943003: Moved window opening callback to WebStateDelegate. (Closed)
Patch Set: Rebased 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/public/web_state/web_state_delegate.h ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_state/web_state_delegate_bridge.h
diff --git a/ios/web/public/web_state/web_state_delegate_bridge.h b/ios/web/public/web_state/web_state_delegate_bridge.h
index 62de0b8236bf90b74e69c1415a614aca5fa15016..11dae7c4cd7cde56725d2247b100d259e679126f 100644
--- a/ios/web/public/web_state/web_state_delegate_bridge.h
+++ b/ios/web/public/web_state/web_state_delegate_bridge.h
@@ -14,6 +14,16 @@
@protocol CRWWebStateDelegate<NSObject>
@optional
+// Called when |webState| wants to open a new window. |url| is the URL of
+// the new window; |opener_url| is the URL of the page which requested a
+// window to be open; |initiated_by_user| is true if action was caused by the
+// user. |webState| will not open a window if this method returns nil. This
+// method can not return |webState|.
+- (web::WebState*)webState:(web::WebState*)webState
+ createNewWebStateForURL:(const GURL&)URL
+ openerURL:(const GURL&)openerURL
+ initiatedByUser:(BOOL)initiatedByUser;
+
// Returns the WebState the URL is opened in, or nullptr if the URL wasn't
// opened immediately.
- (web::WebState*)webState:(web::WebState*)webState
@@ -57,6 +67,10 @@ class WebStateDelegateBridge : public web::WebStateDelegate {
~WebStateDelegateBridge() override;
// web::WebStateDelegate methods.
+ WebState* CreateNewWebState(WebState* source,
+ const GURL& url,
+ const GURL& opener_url,
+ bool initiated_by_user) override;
WebState* OpenURLFromWebState(WebState*,
const WebState::OpenURLParams&) override;
bool HandleContextMenu(WebState* source,
« no previous file with comments | « ios/web/public/web_state/web_state_delegate.h ('k') | ios/web/web_state/ui/crw_web_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698