Commit 64175b90 authored by Rohit Rao's avatar Rohit Rao Committed by Commit Bot

[ios] Properly sets the Incognito Browser after closing the last incognito tab.

The code was incorrectly passing the main (non-Incognito) Browser to the
TabGrid.

BUG=1043935

Change-Id: I7c5348c4424a2c199194455b2286eec9efdaabe1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2012088
Commit-Queue: Rohit Rao <rohitrao@chromium.org>
Reviewed-by: default avatarMohammad Refaat <mrefaat@chromium.org>
Reviewed-by: default avatarMike Dougherty <michaeldo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733772}
parent a49864af
......@@ -1287,8 +1287,8 @@ enum class EnterTabSwitcherSnapshotResult {
BOOL otrBVCIsCurrent = (self.interfaceProvider.mainInterface.bvc ==
self.interfaceProvider.incognitoInterface.bvc);
// Clear the OTR tab model and notify the _tabSwitcher that its otrBVC will
// be destroyed.
// Clear the Incognito Browser and notify the _tabSwitcher that its otrBrowser
// will be destroyed.
[self.mainController.tabSwitcher setOtrBrowser:nil];
[self.mainController.browserViewWrangler destroyAndRebuildIncognitoBrowser];
......@@ -1297,9 +1297,10 @@ enum class EnterTabSwitcherSnapshotResult {
[self activateBVCAndMakeCurrentBVCPrimary];
}
// Always set the new otr tab model for the tablet or grid switcher.
// Notify the _tabSwitcher with the new otrBVC.
[self.mainController.tabSwitcher setOtrBrowser:self.mainInterface.browser];
// Always set the new otr Browser for the tablet or grid switcher.
// Notify the _tabSwitcher with the new Incognito Browser.
[self.mainController.tabSwitcher
setOtrBrowser:self.incognitoInterface.browser];
// This seems the best place to deem the destroying and rebuilding the
// incognito browser state to be completed.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment