Commit 80f57046 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[iOS] Make BrowserViewWrangler ivar a property.

This just makes _browserViewWrangler a property and updates calls.
This will allow for cleaner CLs moving code to SceneController.

Bug: none
Change-Id: Ic3118c54ac0799a0089a0e5a159d68d672b899c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2003854Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#732880}
parent 2024afbd
...@@ -286,11 +286,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -286,11 +286,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// The object that drives the Chrome startup/shutdown logic. // The object that drives the Chrome startup/shutdown logic.
std::unique_ptr<IOSChromeMain> _chromeMain; std::unique_ptr<IOSChromeMain> _chromeMain;
// Wrangler to handle BVC and tab model creation, access, and related logic.
// Implements faetures exposed from this object through the
// BrowserViewInformation protocol.
BrowserViewWrangler* _browserViewWrangler;
// TabSwitcher object -- the tab grid. // TabSwitcher object -- the tab grid.
id<TabSwitcher> _tabSwitcher; id<TabSwitcher> _tabSwitcher;
...@@ -337,6 +332,11 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -337,6 +332,11 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
BOOL _animationDisabled; BOOL _animationDisabled;
} }
// Wrangler to handle BVC and tab model creation, access, and related logic.
// Implements faetures exposed from this object through the
// BrowserViewInformation protocol.
@property(nonatomic, strong) BrowserViewWrangler* browserViewWrangler;
// The ChromeBrowserState associated with the main (non-OTR) browsing mode. // The ChromeBrowserState associated with the main (non-OTR) browsing mode.
@property(nonatomic, assign) @property(nonatomic, assign)
ios::ChromeBrowserState* mainBrowserState; // Weak. ios::ChromeBrowserState* mainBrowserState; // Weak.
...@@ -600,8 +600,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -600,8 +600,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// Initialize and set the main browser state. // Initialize and set the main browser state.
[self initializeBrowserState:chromeBrowserState]; [self initializeBrowserState:chromeBrowserState];
self.mainBrowserState = chromeBrowserState; self.mainBrowserState = chromeBrowserState;
[_browserViewWrangler shutdown]; [self.browserViewWrangler shutdown];
_browserViewWrangler = [[BrowserViewWrangler alloc] self.browserViewWrangler = [[BrowserViewWrangler alloc]
initWithBrowserState:self.mainBrowserState initWithBrowserState:self.mainBrowserState
webStateListObserver:self webStateListObserver:self
applicationCommandEndpoint:self.sceneController applicationCommandEndpoint:self.sceneController
...@@ -625,7 +625,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -625,7 +625,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
->NotifyEvent(feature_engagement::events::kChromeOpened); ->NotifyEvent(feature_engagement::events::kChromeOpened);
// Ensure the main tab model is created. This also creates the BVC. // Ensure the main tab model is created. This also creates the BVC.
[_browserViewWrangler createMainBrowser]; [self.browserViewWrangler createMainBrowser];
_spotlightManager = _spotlightManager =
[SpotlightManager spotlightManagerWithBrowserState:self.mainBrowserState]; [SpotlightManager spotlightManagerWithBrowserState:self.mainBrowserState];
...@@ -671,7 +671,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -671,7 +671,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[self scheduleLowPriorityStartupTasks]; [self scheduleLowPriorityStartupTasks];
[_browserViewWrangler updateDeviceSharingManager]; [self.browserViewWrangler updateDeviceSharingManager];
[self.sceneController openTabFromLaunchOptions:_launchOptions [self.sceneController openTabFromLaunchOptions:_launchOptions
startupInformation:self startupInformation:self
...@@ -758,7 +758,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -758,7 +758,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// be destroyed. // be destroyed.
[_tabSwitcher setOtrBrowser:nil]; [_tabSwitcher setOtrBrowser:nil];
[_browserViewWrangler destroyAndRebuildIncognitoBrowser]; [self.browserViewWrangler destroyAndRebuildIncognitoBrowser];
if (otrBVCIsCurrent) { if (otrBVCIsCurrent) {
[self activateBVCAndMakeCurrentBVCPrimary]; [self activateBVCAndMakeCurrentBVCPrimary];
...@@ -791,7 +791,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -791,7 +791,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
#pragma mark - Property implementation. #pragma mark - Property implementation.
- (id<BrowserInterfaceProvider>)interfaceProvider { - (id<BrowserInterfaceProvider>)interfaceProvider {
return _browserViewWrangler; return self.browserViewWrangler;
} }
- (TabGridCoordinator*)mainCoordinator { - (TabGridCoordinator*)mainCoordinator {
...@@ -856,8 +856,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -856,8 +856,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// Invariant: The UI is stopped before the model is shutdown. // Invariant: The UI is stopped before the model is shutdown.
DCHECK(!_mainCoordinator); DCHECK(!_mainCoordinator);
[_browserViewWrangler shutdown]; [self.browserViewWrangler shutdown];
_browserViewWrangler = nil; self.browserViewWrangler = nil;
_extensionSearchEngineDataUpdater = nullptr; _extensionSearchEngineDataUpdater = nullptr;
...@@ -1735,7 +1735,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1735,7 +1735,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
} }
- (DeviceSharingManager*)deviceSharingManager { - (DeviceSharingManager*)deviceSharingManager {
return [_browserViewWrangler deviceSharingManager]; return [self.browserViewWrangler deviceSharingManager];
} }
- (void)setTabSwitcher:(id<TabSwitcher>)switcher { - (void)setTabSwitcher:(id<TabSwitcher>)switcher {
......
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