| Index: ios/chrome/app/main_controller.mm
|
| diff --git a/ios/chrome/app/main_controller.mm b/ios/chrome/app/main_controller.mm
|
| index 3aaa1d91363c5c936aa907bfb632ad2e3af81169..fa2f5539b3cdcb6a4837f8f32134481a27097d6a 100644
|
| --- a/ios/chrome/app/main_controller.mm
|
| +++ b/ios/chrome/app/main_controller.mm
|
| @@ -534,8 +534,6 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| // Initializes the application to INITIALIZATION_STAGE_FOREGROUND, which is
|
| // needed when application runs in foreground.
|
| - (void)startUpBrowserForegroundInitialization;
|
| -// Swaps the UI between Incognito and normal modes.
|
| -- (void)swapBrowserModes;
|
| @end
|
|
|
| @implementation MainController
|
| @@ -820,17 +818,13 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| - (void)deleteIncognitoBrowserState {
|
| BOOL otrBVCIsCurrent = (self.currentBVC == self.otrBVC);
|
|
|
| - const BOOL isOnIPadWithTabSwitcherEnabled =
|
| - IsIPadIdiom() && experimental_flags::IsTabSwitcherEnabled();
|
| -
|
| // If the current BVC is the otr BVC, then the user should be in the card
|
| // stack, this is not true for the iPad tab switcher.
|
| - DCHECK(isOnIPadWithTabSwitcherEnabled ||
|
| - (!otrBVCIsCurrent || _tabSwitcherIsActive));
|
| + DCHECK(IsIPadIdiom() || (!otrBVCIsCurrent || _tabSwitcherIsActive));
|
|
|
| // We always clear the otr tab model on iPad.
|
| // Notify the _tabSwitcherController that its otrBVC will be destroyed.
|
| - if (isOnIPadWithTabSwitcherEnabled || _tabSwitcherIsActive)
|
| + if (IsIPadIdiom() || _tabSwitcherIsActive)
|
| [_tabSwitcherController setOtrTabModel:nil];
|
|
|
| [_browserViewWrangler
|
| @@ -842,7 +836,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
|
|
| // Always set the new otr tab model on iPad with tab switcher enabled.
|
| // Notify the _tabSwitcherController with the new otrBVC.
|
| - if (isOnIPadWithTabSwitcherEnabled || _tabSwitcherIsActive)
|
| + if (IsIPadIdiom() || _tabSwitcherIsActive)
|
| [_tabSwitcherController setOtrTabModel:self.otrTabModel];
|
| }
|
|
|
| @@ -1442,10 +1436,6 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| case IDC_OPEN_URL:
|
| [self openUrl:base::mac::ObjCCast<OpenUrlCommand>(sender)];
|
| break;
|
| - case IDC_SWITCH_BROWSER_MODES:
|
| - DCHECK(IsIPadIdiom());
|
| - [self swapBrowserModes];
|
| - break;
|
| case IDC_OPTIONS:
|
| [self showSettings];
|
| break;
|
| @@ -1484,8 +1474,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| break;
|
| case IDC_TOGGLE_TAB_SWITCHER:
|
| DCHECK(!_tabSwitcherIsActive);
|
| - if ((!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled()) &&
|
| - !_isProcessingVoiceSearchCommand) {
|
| + if (!_isProcessingVoiceSearchCommand) {
|
| [self showTabSwitcher];
|
| _isProcessingTabSwitcherCommand = YES;
|
| dispatch_after(dispatch_time(DISPATCH_TIME_NOW,
|
| @@ -1702,12 +1691,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| }
|
|
|
| if (IsIPadIdiom()) {
|
| - if (experimental_flags::IsTabSwitcherEnabled()) {
|
| - [self showTabSwitcher];
|
| - } else {
|
| - // Mode switch if not in regular mode.
|
| - [self swapBrowserModes];
|
| - }
|
| + [self showTabSwitcher];
|
| } else {
|
| self.currentBVC = self.mainBVC;
|
| if ([self.currentTabModel count] == 0U) {
|
| @@ -1727,13 +1711,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| return;
|
| }
|
|
|
| - if (IsIPadIdiom()) {
|
| - if (experimental_flags::IsTabSwitcherEnabled()) {
|
| - [self showTabSwitcher];
|
| - }
|
| - } else {
|
| - [self showTabSwitcher];
|
| - }
|
| + [self showTabSwitcher];
|
| }
|
|
|
| #pragma mark - Mode Switching
|
| @@ -1775,17 +1753,6 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| return self.currentBVC.browserState;
|
| }
|
|
|
| -- (void)swapBrowserModes {
|
| - if (self.mainBVC == self.currentBVC)
|
| - self.currentBVC = self.otrBVC;
|
| - else
|
| - self.currentBVC = self.mainBVC;
|
| - // Make sure there is at least one tab open.
|
| - if ([self shouldOpenNTPTabOnActivationOfTabModel:[self currentTabModel]])
|
| - [self.currentBVC newTab:nil];
|
| - [_browserViewWrangler updateModeToggle];
|
| -}
|
| -
|
| // NOTE: If you change this function, it may have an effect on the performance
|
| // of opening the stack view. Please make sure you also change the corresponding
|
| // code in StackViewControllerPerfTest::MainControllerShowTabSwitcher().
|
| @@ -1804,8 +1771,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| [currentTab setSnapshotCoalescingEnabled:NO];
|
| }));
|
|
|
| - if (experimental_flags::IsTabSwitcherEnabled())
|
| - [currentBVC prepareToEnterTabSwitcher:nil];
|
| + [currentBVC prepareToEnterTabSwitcher:nil];
|
|
|
| if (!_tabSwitcherController.get()) {
|
| if (IsIPadIdiom()) {
|
| @@ -1831,7 +1797,7 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| }
|
| _tabSwitcherIsActive = YES;
|
| [_tabSwitcherController setDelegate:self];
|
| - if (IsIPadIdiom() && experimental_flags::IsTabSwitcherEnabled()) {
|
| + if (IsIPadIdiom()) {
|
| TabSwitcherTransitionContext* transitionContext =
|
| [TabSwitcherTransitionContext
|
| tabSwitcherTransitionContextWithCurrent:currentBVC
|
| @@ -1914,7 +1880,6 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| }
|
|
|
| - (void)beginDismissingStackViewWithCurrentModel:(TabModel*)tabModel {
|
| - DCHECK(experimental_flags::IsTabSwitcherEnabled() || !IsIPadIdiom());
|
| DCHECK(tabModel == self.mainTabModel || tabModel == self.otrTabModel);
|
|
|
| _dismissingStackView = YES;
|
| @@ -1927,7 +1892,6 @@ enum class StackViewDismissalMode { NONE, NORMAL, INCOGNITO };
|
| }
|
|
|
| - (void)finishDismissingStackView {
|
| - DCHECK(!IsIPadIdiom() || experimental_flags::IsTabSwitcherEnabled());
|
| DCHECK_EQ(self.mainViewController.activeViewController,
|
| _tabSwitcherController.get());
|
|
|
|
|