Commit 5096f41f authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Remove sceneController property.

This property was used before there was an "official" way
to access scene controllers. Now it can be fetched through
the app state.

Change-Id: I11abb2508323000b2ed317f9ad2de12f748510d6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2299631Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#788695}
parent 6073e2a4
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
// TODO(crbug.com/1040501): remove this. // TODO(crbug.com/1040501): remove this.
// This is temporary plumbing that's not supposed to be here. // This is temporary plumbing that's not supposed to be here.
_sceneController.mainController = (id<MainControllerGuts>)_mainController; _sceneController.mainController = (id<MainControllerGuts>)_mainController;
_mainController.sceneController = _sceneController;
_tabSwitcherProtocol = _sceneController; _tabSwitcherProtocol = _sceneController;
_tabOpener = _sceneController; _tabOpener = _sceneController;
} }
......
...@@ -11,16 +11,11 @@ ...@@ -11,16 +11,11 @@
#import "ios/chrome/app/application_delegate/browser_launcher.h" #import "ios/chrome/app/application_delegate/browser_launcher.h"
#import "ios/chrome/app/application_delegate/startup_information.h" #import "ios/chrome/app/application_delegate/startup_information.h"
#import "ios/chrome/app/main_controller_guts.h" #import "ios/chrome/app/main_controller_guts.h"
#import "ios/chrome/browser/ui/commands/application_commands.h"
#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 MetricsMediator; @class MetricsMediator;
@protocol BrowsingDataCommands; @protocol BrowsingDataCommands;
@protocol ConnectionInformation;
@protocol SceneControllerGuts;
@protocol TabOpening;
@protocol TabSwitcherDelegate;
// The main controller of the application, owned by the MainWindow nib. Also // The main controller of the application, owned by the MainWindow nib. Also
// serves as the delegate for the app. Owns all the various top-level // serves as the delegate for the app. Owns all the various top-level
...@@ -45,14 +40,6 @@ ...@@ -45,14 +40,6 @@
// to the user preferences. // to the user preferences.
@property(nonatomic, weak) MetricsMediator* metricsMediator; @property(nonatomic, weak) MetricsMediator* metricsMediator;
// For temporary plumbing only.
@property(nonatomic, weak) id<ApplicationCommands,
TabSwitcherDelegate,
ConnectionInformation,
SceneControllerGuts,
TabOpening>
sceneController;
@end @end
#endif // IOS_CHROME_APP_MAIN_CONTROLLER_H_ #endif // IOS_CHROME_APP_MAIN_CONTROLLER_H_
...@@ -587,8 +587,9 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -587,8 +587,9 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
} }
} }
[self.sceneController startUpChromeUIPostCrash:postCrashLaunch SceneState* sceneState = self.appState.connectedScenes.firstObject;
needRestoration:needRestore]; [sceneState.controller startUpChromeUIPostCrash:postCrashLaunch
needRestoration:needRestore];
[self startUpAfterFirstWindowCreated]; [self startUpAfterFirstWindowCreated];
} }
...@@ -649,7 +650,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -649,7 +650,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
base::mac::ObjCCastStrict<UIWindowScene>(notification.object); base::mac::ObjCCastStrict<UIWindowScene>(notification.object);
SceneDelegate* sceneDelegate = SceneDelegate* sceneDelegate =
base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate); base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate);
self.sceneController = sceneDelegate.sceneController;
sceneDelegate.sceneController.mainController = self; sceneDelegate.sceneController.mainController = self;
} }
} }
...@@ -1292,7 +1292,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData( ...@@ -1292,7 +1292,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
- (void)setStartupParametersWithURL:(const GURL&)launchURL { - (void)setStartupParametersWithURL:(const GURL&)launchURL {
DCHECK(!IsSceneStartupSupported()); DCHECK(!IsSceneStartupSupported());
NSString* sourceApplication = @"Fake App"; NSString* sourceApplication = @"Fake App";
self.sceneController.startupParameters = [ChromeAppStartupParameters SceneState* sceneState = self.appState.foregroundActiveScene;
sceneState.controller.startupParameters = [ChromeAppStartupParameters
newChromeAppStartupParametersWithURL:net::NSURLWithGURL(launchURL) newChromeAppStartupParametersWithURL:net::NSURLWithGURL(launchURL)
fromSourceApplication:sourceApplication]; fromSourceApplication:sourceApplication];
} }
......
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