Commit 803b1316 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[iOS] Remove AppState.window.

AppState's |window| is confusing in multiwindow world. It is equivalent
to AppState.foregroundActiveScene.window. Remove it to avoid confusion.

Bug: none
Change-Id: I3d5c0f10df07050f90380d14133f406ab541d9c2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2193991
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Auto-Submit: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771745}
parent 588b9d40
...@@ -46,10 +46,6 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher ...@@ -46,10 +46,6 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher
// application has been woken up by the system for background work. // application has been woken up by the system for background work.
@property(nonatomic, readonly) BOOL userInteracted; @property(nonatomic, readonly) BOOL userInteracted;
// Current foreground active for the application, if any. Some scene's window
// otherwise. For legacy use cases only, use scene windows instead.
@property(nonatomic, readonly) UIWindow* window;
// When multiwindow is unavailable, this is the only scene state. It is created // When multiwindow is unavailable, this is the only scene state. It is created
// by the app delegate. // by the app delegate.
@property(nonatomic, strong) SceneState* mainSceneState; @property(nonatomic, strong) SceneState* mainSceneState;
......
...@@ -183,18 +183,6 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher ...@@ -183,18 +183,6 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher
_safeModeCoordinator = safeModeCoordinator; _safeModeCoordinator = safeModeCoordinator;
} }
- (UIWindow*)window {
return self.foregroundActiveScene ? self.foregroundActiveScene.window
: self.connectedScenes.firstObject.window;
}
- (void)setsceneShowingBlockingUI:(SceneState*)sceneState {
_sceneShowingBlockingUI = sceneState;
for (SceneState* state in self.connectedScenes) {
state.presentingModalOverlay = (state != sceneState) && (sceneState != nil);
}
}
#pragma mark - Public methods. #pragma mark - Public methods.
- (void)applicationDidEnterBackground:(UIApplication*)application - (void)applicationDidEnterBackground:(UIApplication*)application
...@@ -560,14 +548,14 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher ...@@ -560,14 +548,14 @@ initWithBrowserLauncher:(id<BrowserLauncher>)browserLauncher
- (void)startSafeMode { - (void)startSafeMode {
DCHECK(self.foregroundActiveScene); DCHECK(self.foregroundActiveScene);
SafeModeCoordinator* safeModeCoordinator = SafeModeCoordinator* safeModeCoordinator = [[SafeModeCoordinator alloc]
[[SafeModeCoordinator alloc] initWithWindow:self.window]; initWithWindow:self.foregroundActiveScene.window];
self.safeModeCoordinator = safeModeCoordinator; self.safeModeCoordinator = safeModeCoordinator;
[self.safeModeCoordinator setDelegate:self]; [self.safeModeCoordinator setDelegate:self];
// Activate the main window, which will prompt the views to load. // Activate the main window, which will prompt the views to load.
[self.window makeKeyAndVisible]; [self.foregroundActiveScene.window makeKeyAndVisible];
[self.safeModeCoordinator start]; [self.safeModeCoordinator start];
} }
......
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