[ios] Remove extra -installDelegates call
-installDelegates does not need to be called from -didChangeActiveTab:
since the delegates were never removed.
This code was originally added in this CL:
https://chromereviews.googleplex.com/362387013/
This is removed because we want to change the code so that it is not
idempotent (i.e. cannot be called multiple times in a row).
Bug:
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I7c0aba2c89fb6da093b08a2244ccee03421c1bb1
Reviewed-on: https://chromium-review.googlesource.com/733866
Reviewed-by: Mark Cogan <[email protected]>
Reviewed-by: edchin <[email protected]>
Reviewed-by: Sylvain Defresne <[email protected]>
Commit-Queue: edchin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#511132}
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index c4cbbbb..eed0a936 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -2426,6 +2426,7 @@
}
- (void)installDelegatesForTab:(Tab*)tab {
+ DCHECK_NE(tab.webState->GetDelegate(), _webStateDelegate.get());
// Unregistration happens when the Tab is removed from the TabModel.
tab.iOSCaptivePortalBlockingPageDelegate = self;
tab.dispatcher = self.dispatcher;
@@ -2461,6 +2462,7 @@
}
- (void)uninstallDelegatesForTab:(Tab*)tab {
+ DCHECK_EQ(tab.webState->GetDelegate(), _webStateDelegate.get());
tab.iOSCaptivePortalBlockingPageDelegate = nil;
tab.dispatcher = nil;
tab.dialogDelegate = nil;
@@ -4755,8 +4757,6 @@
_sadTabCoordinator.webState = newTab.webState;
[self tabSelected:newTab];
- DCHECK_EQ(newTab, [model currentTab]);
- [self installDelegatesForTab:newTab];
}
// Observer method, tab changed.