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

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2737943003: Moved window opening callback to WebStateDelegate. (Closed)
Patch Set: Self review 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
Index: ios/chrome/browser/tabs/tab.mm
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm
index 7d91c95341b789c32f64aca09e4026dc68e685ea..8d5e58e7f866d5763145ea8875c9b6f9d2e629b4 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -2002,39 +2002,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
[delegate_ discardPrerender];
}
-- (CRWWebController*)webController:(CRWWebController*)webController
- createWebControllerForURL:(const GURL&)URL
- openerURL:(const GURL&)openerURL
- initiatedByUser:(BOOL)initiatedByUser {
- // Check if requested web controller is a popup and block it if necessary.
- if (!initiatedByUser) {
- web::WebState* webState = webController.webState;
- auto* helper = BlockedPopupTabHelper::FromWebState(webState);
- if (helper->ShouldBlockPopup(openerURL)) {
- web::NavigationItem* item =
- webState->GetNavigationManager()->GetLastCommittedItem();
- web::Referrer referrer(openerURL, item->GetReferrer().policy);
- helper->HandlePopup(URL, referrer);
- return nil;
- }
- }
-
- // Requested web controller should not be blocked from opening.
- [self updateSnapshotWithOverlay:YES visibleFrameOnly:YES];
-
- // Tabs open by DOM are always renderer initiated.
- web::NavigationManager::WebLoadParams params(GURL{});
- params.transition_type = ui::PAGE_TRANSITION_LINK;
- params.is_renderer_initiated = YES;
- Tab* tab = [parentTabModel_
- insertTabWithLoadParams:params
- opener:self
- openedByDOM:YES
- atIndex:TabModelConstants::kTabPositionAutomatically
- inBackground:NO];
- return tab.webController;
-}
-
- (CGFloat)headerHeightForWebController:(CRWWebController*)webController {
return [self.tabHeadersDelegate headerHeightForTab:self];
}
« no previous file with comments | « no previous file | ios/chrome/browser/ui/browser_view_controller.mm » ('j') | ios/web/public/test/fakes/test_web_state_delegate.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698