Commit d7a2ebf5 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

[multiball] Remove main controller guts.

Removes the final method from main controller guts.

Bug: 1045659
Change-Id: I4b04c70e49f8abbac0f3c933da301b21a11340aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2421650
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#810622}
parent b088a0ad
......@@ -144,7 +144,6 @@ source_set("app_internal") {
"main_application_delegate_testing.h",
"main_controller.h",
"main_controller.mm",
"main_controller_guts.h",
"main_controller_private.h",
"memory_monitor.h",
"memory_monitor.mm",
......
......@@ -89,9 +89,6 @@
[[SceneController alloc] initWithSceneState:_sceneState];
_sceneState.controller = _sceneController;
// TODO(crbug.com/1040501): remove this.
// This is temporary plumbing that's not supposed to be here.
_sceneController.mainController = (id<MainControllerGuts>)_mainController;
_tabSwitcherProtocol = _sceneController;
_tabOpener = _sceneController;
}
......
......@@ -10,7 +10,6 @@
#import "ios/chrome/app/application_delegate/app_state.h"
#import "ios/chrome/app/application_delegate/browser_launcher.h"
#import "ios/chrome/app/application_delegate/startup_information.h"
#import "ios/chrome/app/main_controller_guts.h"
#import "ios/chrome/browser/ui/commands/browsing_data_commands.h"
@class AppState;
......@@ -24,7 +23,6 @@
// By design, it has no public API of its own. Anything interacting with
// MainController should be doing so through a specific protocol.
@interface MainController : NSObject <BrowserLauncher,
MainControllerGuts,
StartupInformation,
BrowsingDataCommands,
AppStateObserver>
......
......@@ -393,17 +393,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[self.appState.appCommandDispatcher
startDispatchingToTarget:self
forProtocol:@protocol(BrowsingDataCommands)];
if (@available(iOS 13, *)) {
if (IsSceneStartupSupported()) {
// Subscribe for scene connection and disconnection notifications.
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(sceneWillConnect:)
name:UISceneWillConnectNotification
object:nil];
}
}
}
- (void)startUpBrowserBackgroundInitialization {
......@@ -605,20 +594,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[self startUpAfterFirstWindowCreated];
}
#pragma mark - Scene notifications
// Handler for UISceneWillConnectNotification.
- (void)sceneWillConnect:(NSNotification*)notification {
DCHECK(IsSceneStartupSupported());
if (@available(iOS 13, *)) {
UIWindowScene* scene =
base::mac::ObjCCastStrict<UIWindowScene>(notification.object);
SceneDelegate* sceneDelegate =
base::mac::ObjCCastStrict<SceneDelegate>(scene.delegate);
sceneDelegate.sceneController.mainController = self;
}
}
#pragma mark - Property implementation.
- (void)setAppState:(AppState*)appState {
......@@ -1060,7 +1035,7 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
}
}
- (void)prepareForFirstRunUI:(SceneState*)presentingScene {
- (void)prepareForFirstRunUI {
// Register for notification when First Run is completed.
// Some initializations are held back until First Run modal dialog
// is dismissed.
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef IOS_CHROME_APP_MAIN_CONTROLLER_GUTS_H_
#define IOS_CHROME_APP_MAIN_CONTROLLER_GUTS_H_
#import <UIKit/UIKit.h>
// TODO(crbug.com/1012697): Remove this protocol when SceneController is
// operational. Move the private internals back into MainController, and pass
// ownership of Scene-related objects to SceneController.
@protocol MainControllerGuts
// MainController tracks EULA acceptance and performs delayed tasks when the
// first run UI is dismissed.
- (void)prepareForFirstRunUI:(SceneState*)presentingScene;
@end
#endif // IOS_CHROME_APP_MAIN_CONTROLLER_GUTS_H_
......@@ -14,8 +14,6 @@
#import "ios/chrome/browser/ui/main/scene_state.h"
#import "ios/chrome/browser/web_state_list/web_state_list_observer_bridge.h"
@protocol MainControllerGuts;
// The controller object for a scene. Reacts to scene state changes.
@interface SceneController : NSObject <SceneStateObserver,
ApplicationCommands,
......@@ -31,9 +29,6 @@
// The state of the scene controlled by this object.
@property(nonatomic, weak, readonly) SceneState* sceneState;
// A temporary pointer to MainController.
@property(nonatomic, weak) id<MainControllerGuts> mainController;
// The interface provider for this scene.
@property(nonatomic, strong, readonly) id<BrowserInterfaceProvider>
interfaceProvider;
......
......@@ -21,7 +21,6 @@
#include "ios/chrome/app/application_mode.h"
#import "ios/chrome/app/chrome_overlay_window.h"
#import "ios/chrome/app/deferred_initialization_runner.h"
#import "ios/chrome/app/main_controller_guts.h"
#include "ios/chrome/browser/browser_state/chrome_browser_state.h"
#include "ios/chrome/browser/browsing_data/browsing_data_remove_mask.h"
#include "ios/chrome/browser/browsing_data/browsing_data_remover.h"
......@@ -534,7 +533,6 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
return;
}
DCHECK(self.mainController);
[self startUpChromeUI];
self.hasInitializedUI = YES;
}
......@@ -543,7 +541,6 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
- (void)startUpChromeUI {
DCHECK(!self.browserViewWrangler);
DCHECK(self.sceneURLLoadingService);
DCHECK(self.mainController);
DCHECK(self.sceneState.appState.mainBrowserState);
self.browserViewWrangler = [[BrowserViewWrangler alloc]
......@@ -673,7 +670,6 @@ const char kMultiWindowOpenInNewWindowHistogram[] =
// If this isn't first run, check if the sign-in promo needs to display.
if (firstRun && launchMode != ApplicationMode::INCOGNITO &&
!self.sceneState.appState.startupInformation.isPresentingFirstRunUI) {
[self.mainController prepareForFirstRunUI:self.sceneState];
[self showFirstRunUI];
// Do not ever show the 'restore' infobar during first run.
self.sceneState.appState.startupInformation.restoreHelper = nil;
......
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