Commit 84d1f087 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Cleanup Scene/Main Controller Guts.

Cleans up the Guts protocols from things that are no longer used.
Uses interfaceProvider everywhere instead of alternative accessors.

Bug: 1045659, 1045660
Change-Id: Ib3355505686c6b034e98373d380330dff256d8af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087675
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748190}
parent db0eaaec
...@@ -1164,7 +1164,10 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1164,7 +1164,10 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
} }
- (ChromeBrowserState*)currentBrowserState { - (ChromeBrowserState*)currentBrowserState {
return self.currentBVC.browserState; if (!self.interfaceProvider.currentInterface.browser) {
return nullptr;
}
return self.interfaceProvider.currentInterface.browser->GetBrowserState();
} }
- (bool)mustShowRestoreInfobar { - (bool)mustShowRestoreInfobar {
...@@ -1206,12 +1209,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1206,12 +1209,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
#pragma mark - SceneController plumbing
- (BOOL)currentPageIsIncognito {
return [self currentBrowserState] -> IsOffTheRecord();
}
#pragma mark - BrowsingDataCommands #pragma mark - BrowsingDataCommands
- (void)removeBrowsingDataForBrowserState:(ChromeBrowserState*)browserState - (void)removeBrowsingDataForBrowserState:(ChromeBrowserState*)browserState
......
...@@ -16,10 +16,7 @@ ...@@ -16,10 +16,7 @@
#import "ios/chrome/browser/ui/commands/browsing_data_commands.h" #import "ios/chrome/browser/ui/commands/browsing_data_commands.h"
@class AppState; @class AppState;
@class BrowserViewController;
class ChromeBrowserState; class ChromeBrowserState;
@class TabGridCoordinator;
@protocol BrowserInterfaceProvider;
// TODO(crbug.com/1012697): Remove this protocol when SceneController is // TODO(crbug.com/1012697): Remove this protocol when SceneController is
// operational. Move the private internals back into MainController, and pass // operational. Move the private internals back into MainController, and pass
...@@ -40,13 +37,7 @@ class ChromeBrowserState; ...@@ -40,13 +37,7 @@ class ChromeBrowserState;
// Keeps track of the restore state during startup. // Keeps track of the restore state during startup.
@property(nonatomic, strong) CrashRestoreHelper* restoreHelper; @property(nonatomic, strong) CrashRestoreHelper* restoreHelper;
- (TabModel*)currentTabModel;
- (ChromeBrowserState*)mainBrowserState; - (ChromeBrowserState*)mainBrowserState;
- (ChromeBrowserState*)currentBrowserState;
- (BrowserViewController*)currentBVC;
- (BrowserViewController*)mainBVC;
- (BrowserViewController*)otrBVC;
- (id<BrowserInterfaceProvider>)interfaceProvider;
- (UIWindow*)window; - (UIWindow*)window;
- (NSDictionary*)launchOptions; - (NSDictionary*)launchOptions;
- (AppState*)appState; - (AppState*)appState;
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
class ChromeBrowserState; class ChromeBrowserState;
@class BrowserViewWrangler; @class BrowserViewWrangler;
@class TabModel;
@protocol SceneControllerGuts <WebStateListObserving> @protocol SceneControllerGuts <WebStateListObserving>
...@@ -26,24 +25,9 @@ class ChromeBrowserState; ...@@ -26,24 +25,9 @@ class ChromeBrowserState;
// BrowserViewInformation protocol. // BrowserViewInformation protocol.
@property(nonatomic, strong) BrowserViewWrangler* browserViewWrangler; @property(nonatomic, strong) BrowserViewWrangler* browserViewWrangler;
// The scene level component for url loading. Is passed down to
// browser state level UrlLoadingService instances.
@property(nonatomic, assign) AppUrlLoadingService* appURLLoadingService;
- (void)startUpChromeUIPostCrash:(BOOL)isPostCrashLaunch - (void)startUpChromeUIPostCrash:(BOOL)isPostCrashLaunch
needRestoration:(BOOL)needsRestoration; needRestoration:(BOOL)needsRestoration;
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
- (void)openSelectedTabInMode:(ApplicationModeForTabOpening)tabOpeningTargetMode
withUrlLoadParams:(const UrlLoadParams&)urlLoadParams
completion:(ProceduralBlock)completion;
- (void)openTabFromLaunchOptions:(NSDictionary*)launchOptions
startupInformation:(id<StartupInformation>)startupInformation
appState:(AppState*)appState;
- (void)dismissModalsAndOpenSelectedTabInMode: - (void)dismissModalsAndOpenSelectedTabInMode:
(ApplicationModeForTabOpening)targetMode (ApplicationModeForTabOpening)targetMode
withUrlLoadParams: withUrlLoadParams:
...@@ -51,27 +35,15 @@ class ChromeBrowserState; ...@@ -51,27 +35,15 @@ class ChromeBrowserState;
dismissOmnibox:(BOOL)dismissOmnibox dismissOmnibox:(BOOL)dismissOmnibox
completion:(ProceduralBlock)completion; completion:(ProceduralBlock)completion;
- (BOOL)shouldOpenNTPTabOnActivationOfTabModel:(TabModel*)tabModel;
// TabSwitcherDelegate helpers
// Begins the process of dismissing the tab switcher with the given current
// 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;
// Completes the process of dismissing the tab switcher, removing it from the
// screen and showing the appropriate BVC.
- (void)finishDismissingTabSwitcher;
- (BOOL)presentingFirstRunUI;
// Testing only. // Testing only.
- (BOOL)presentingFirstRunUI;
- (void)showFirstRunUI; - (void)showFirstRunUI;
- (void)setTabSwitcher:(id<TabSwitcher>)switcher; - (void)setTabSwitcher:(id<TabSwitcher>)switcher;
- (id<TabSwitcher>)tabSwitcher; - (id<TabSwitcher>)tabSwitcher;
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
#pragma mark - AppNavigation helpers #pragma mark - AppNavigation helpers
// Presents a SignedInAccountsViewController for |browserState| on the top view // Presents a SignedInAccountsViewController for |browserState| on the top view
...@@ -79,12 +51,6 @@ class ChromeBrowserState; ...@@ -79,12 +51,6 @@ class ChromeBrowserState;
- (void)presentSignedInAccountsViewControllerForBrowserState: - (void)presentSignedInAccountsViewControllerForBrowserState:
(ChromeBrowserState*)browserState; (ChromeBrowserState*)browserState;
// Clears incognito data that is specific to iOS and won't be cleared by
// deleting the browser state.
- (void)clearIOSSpecificIncognitoData;
- (void)activateBVCAndMakeCurrentBVCPrimary;
#pragma mark - iOS 12 compat #pragma mark - iOS 12 compat
// Method called on SceneController when the scene disconnects. Exposed here for // Method called on SceneController when the scene disconnects. Exposed here for
......
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