Commit 06c422de authored by Nazerke's avatar Nazerke Committed by Commit Bot

[iOS][tabmodel] Complete deprecation of TabModel in SceneController.

This CL updates  beginDismissingTabSwitcherWithCurrentModel to use
Browser instead of tabModel in SceneController.

Change-Id: Ie96f04c7480cb93e5f97556b26caf3719fb594f5
Bug: 1049846, 1045575
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167861
Commit-Queue: Nazerke Kalidolda <nazerke@google.com>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#769563}
parent 59e20c43
......@@ -59,7 +59,6 @@ source_set("scene") {
"//ios/chrome/browser/ntp_snippets:ntp_snippets",
"//ios/chrome/browser/signin",
"//ios/chrome/browser/snapshots",
"//ios/chrome/browser/tabs:tabs",
"//ios/chrome/browser/ui:feature_flags",
"//ios/chrome/browser/ui/authentication",
"//ios/chrome/browser/ui/authentication/signin",
......
......@@ -40,7 +40,6 @@
#include "ios/chrome/browser/signin/identity_manager_factory.h"
#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h"
#include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/tabs/tab_model.h"
#import "ios/chrome/browser/ui/authentication/signed_in_accounts_view_controller.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_coordinator.h"
#import "ios/chrome/browser/ui/authentication/signin/signin_utils.h"
......@@ -428,7 +427,8 @@ const NSTimeInterval kDisplayPromoDelay = 0.1;
if (self.tabSwitcherIsActive) {
DCHECK(!self.dismissingTabSwitcher);
[self beginDismissingTabSwitcherWithCurrentModel:self.mainInterface.tabModel
[self
beginDismissingTabSwitcherWithCurrentBrowser:self.mainInterface.browser
focusOmnibox:NO];
[self finishDismissingTabSwitcher];
}
......@@ -1071,8 +1071,8 @@ const NSTimeInterval kDisplayPromoDelay = 0.1;
- (void)tabSwitcher:(id<TabSwitcher>)tabSwitcher
shouldFinishWithBrowser:(Browser*)browser
focusOmnibox:(BOOL)focusOmnibox {
[self beginDismissingTabSwitcherWithCurrentModel:browser->GetTabModel()
focusOmnibox:focusOmnibox];
[self beginDismissingTabSwitcherWithCurrentBrowser:browser
focusOmnibox:focusOmnibox];
}
- (void)tabSwitcherDismissTransitionDidEnd:(id<TabSwitcher>)tabSwitcher {
......@@ -1083,13 +1083,13 @@ const NSTimeInterval kDisplayPromoDelay = 0.1;
// model, switching which BVC is suspended if necessary, but not updating the
// UI. The omnibox will be focused after the tab switcher dismissal is
// completed if |focusOmnibox| is YES.
- (void)beginDismissingTabSwitcherWithCurrentModel:(TabModel*)tabModel
focusOmnibox:(BOOL)focusOmnibox {
DCHECK(tabModel == self.mainInterface.tabModel ||
tabModel == self.incognitoInterface.tabModel);
- (void)beginDismissingTabSwitcherWithCurrentBrowser:(Browser*)browser
focusOmnibox:(BOOL)focusOmnibox {
DCHECK(browser == self.mainInterface.browser ||
browser == self.incognitoInterface.browser);
self.dismissingTabSwitcher = YES;
ApplicationMode mode = (tabModel == self.mainInterface.tabModel)
ApplicationMode mode = (browser == self.mainInterface.browser)
? ApplicationMode::NORMAL
: ApplicationMode::INCOGNITO;
[self setCurrentInterfaceForMode:mode];
......
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