Commit 9132909e authored by Vasilii Sukhanov's avatar Vasilii Sukhanov Committed by Commit Bot

Revert "[iOS][multiball] Move AppURLLoadingServiceDelegate to Scene."

This reverts commit 4a58461b.

Reason for revert: broke compilation on iOS
https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8891643701272051152/+/steps/compile/0/stdout

Original change's description:
> [iOS][multiball] Move AppURLLoadingServiceDelegate to Scene.
> 
> Moves AppURLLoadingServiceDelegate from Main to Scene Controller.
> * adds SceneControllerGuts temporary interface to expose scene-level
> internals to MainController while the code is moved.
> 
> Bug: None
> Change-Id: I0c7dbe077a94ff5b9c598c401c9c7340cc8f969c
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1983226
> Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
> Reviewed-by: Mark Cogan <marq@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#730151}

TBR=marq@chromium.org,stkhapugin@chromium.org

Change-Id: I65d0afac9c2296574c324784960b36ecb1802b43
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: None
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1995171Reviewed-by: default avatarVasilii Sukhanov <vasilii@chromium.org>
Commit-Queue: Vasilii Sukhanov <vasilii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730160}
parent 1f6515df
......@@ -233,7 +233,6 @@ source_set("app_internal") {
"//ios/chrome/browser/ui/history",
"//ios/chrome/browser/ui/main",
"//ios/chrome/browser/ui/main:scene",
"//ios/chrome/browser/ui/main:scene_guts",
"//ios/chrome/browser/ui/promos",
"//ios/chrome/browser/ui/settings",
"//ios/chrome/browser/ui/settings:settings_root",
......
......@@ -86,7 +86,6 @@
_sceneController =
[[SceneController alloc] initWithSceneState:_sceneState];
// TODO(crbug.com/1040501): remove this.
// This is temporary plumbing that's not supposed to be here.
_sceneController.mainController = (id<MainControllerGuts>)_mainController;
_mainController.sceneController = _sceneController;
......
......@@ -17,9 +17,7 @@
@class AppState;
@class MetricsMediator;
@protocol AppURLLoadingServiceDelegate;
@protocol BrowsingDataCommands;
@protocol SceneControllerGuts;
@protocol TabSwitcherDelegate;
// The main controller of the application, owned by the MainWindow nib. Also
......@@ -47,10 +45,7 @@
@property(nonatomic, weak) MetricsMediator* metricsMediator;
// For temporary plumbing only.
@property(nonatomic, weak) id<ApplicationCommands,
TabSwitcherDelegate,
AppURLLoadingServiceDelegate,
SceneControllerGuts>
@property(nonatomic, weak) id<ApplicationCommands, TabSwitcherDelegate>
sceneController;
@end
......
This diff is collapsed.
......@@ -7,7 +7,6 @@
#import <UIKit/UIKit.h>
#import "ios/chrome/browser/crash_report/crash_restore_helper.h"
#import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
#import "ios/public/provider/chrome/browser/user_feedback/user_feedback_provider.h"
......@@ -23,11 +22,6 @@ namespace ios {
class ChromeBrowserState;
} // namespace ios
// Used to update the current BVC mode if a new tab is added while the tab
// switcher view is being dismissed. This is different than ApplicationMode in
// that it can be set to |NONE| when not in use.
enum class TabSwitcherDismissalMode { NONE, NORMAL, INCOGNITO };
// 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.
......@@ -60,38 +54,10 @@ enum class TabSwitcherDismissalMode { NONE, NORMAL, INCOGNITO };
SigninInteractionCoordinator* signinInteractionCoordinator;
// If YES, the tab switcher is currently active.
@property(nonatomic, assign, getter=isTabSwitcherActive)
BOOL tabSwitcherIsActive;
// YES while animating the dismissal of tab switcher.
@property(nonatomic, assign) BOOL dismissingTabSwitcher;
// Returns YES if the settings are presented, either from
// self.settingsNavigationController or from SigninInteractionCoordinator.
@property(nonatomic, assign, readonly, getter=isSettingsViewPresented)
BOOL settingsViewPresented;
// If not NONE, the current BVC should be switched to this BVC on completion
// of tab switcher dismissal.
@property(nonatomic, assign)
TabSwitcherDismissalMode modeToDisplayOnTabSwitcherDismissal;
// A property to track whether the QR Scanner should be started upon tab
// switcher dismissal. It can only be YES if the QR Scanner experiment is
// enabled.
@property(nonatomic, readwrite)
NTPTabOpeningPostOpeningAction NTPActionAfterTabSwitcherDismissal;
// Parameters received at startup time when the app is launched from another
// app.
@property(nonatomic, strong) AppStartupParameters* startupParameters;
- (ProceduralBlock)completionBlockForTriggeringAction:
(NTPTabOpeningPostOpeningAction)action;
// Keeps track of the restore state during startup.
@property(nonatomic, strong) CrashRestoreHelper* restoreHelper;
- (id<TabSwitcher>)tabSwitcher;
- (TabModel*)currentTabModel;
- (id<TabSwitcher>)tabSwitcher;
......@@ -104,6 +70,11 @@ enum class TabSwitcherDismissalMode { NONE, NORMAL, INCOGNITO };
- (id<BrowserInterfaceProvider>)interfaceProvider;
- (void)startVoiceSearchInCurrentBVC;
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
- (void)closeSettingsAnimated:(BOOL)animated
completion:(ProceduralBlock)completion;
- (void)dismissModalsAndOpenSelectedTabInMode:
(ApplicationModeForTabOpening)targetMode
withUrlLoadParams:
......@@ -124,13 +95,6 @@ enum class TabSwitcherDismissalMode { NONE, NORMAL, INCOGNITO };
// screen and showing the appropriate BVC.
- (void)finishDismissingTabSwitcher;
// Sets |currentBVC| as the root view controller for the window.
- (void)displayCurrentBVCAndFocusOmnibox:(BOOL)focusOmnibox;
// Activates |mainBVC| and |otrBVC| and sets |currentBVC| as primary iff
// |currentBVC| can be made active.
- (void)activateBVCAndMakeCurrentBVCPrimary;
@end
#endif // IOS_CHROME_APP_MAIN_CONTROLLER_GUTS_H_
......@@ -24,7 +24,10 @@ class GURL;
// Presents a promo's navigation controller.
- (void)showPromo:(UIViewController*)promo;
- (BOOL)dismissingTabSwitcher;
// Dismisses all modal dialogs, excluding the omnibox if |dismissOmnibox| is
// NO, then call |completion|.
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
@end
......@@ -39,16 +42,12 @@ class GURL;
// Tab switcher state.
@property(nonatomic, getter=isTabSwitcherActive) BOOL tabSwitcherActive;
@property(nonatomic, readonly) BOOL dismissingTabSwitcher;
// Sets the internal startup state to indicate that the launch was triggered
// by an external app opening the given URL.
- (void)setStartupParametersWithURL:(const GURL&)launchURL;
// Dismisses all modal dialogs, excluding the omnibox if |dismissOmnibox| is
// NO, then call |completion|.
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
@end
#endif // IOS_CHROME_APP_MAIN_CONTROLLER_PRIVATE_H_
......@@ -4,19 +4,6 @@
import("//ios/build/chrome_build.gni")
source_set("scene_guts") {
sources = [
"scene_controller_guts.h",
]
deps = [
"//ios/chrome/app/application_delegate:application_delegate_internal",
"//ios/chrome/browser:utils",
"//ios/chrome/browser/url_loading",
]
libs = [ "UIKit.framework" ]
}
source_set("scene") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
......@@ -30,18 +17,15 @@ source_set("scene") {
deps = [
":main",
":scene_guts",
"//base",
"//components/signin/public/identity_manager",
"//components/url_formatter",
"//ios/chrome/app:app",
"//ios/chrome/app/application_delegate:application_delegate_internal",
"//ios/chrome/browser",
"//ios/chrome/browser:chrome_url_constants",
"//ios/chrome/browser/browser_state",
"//ios/chrome/browser/browsing_data",
"//ios/chrome/browser/main",
"//ios/chrome/browser/ntp:features",
"//ios/chrome/browser/signin",
"//ios/chrome/browser/snapshots",
"//ios/chrome/browser/tabs:tabs",
......@@ -55,9 +39,6 @@ source_set("scene") {
"//ios/chrome/browser/ui/util:multiwindow_util",
"//ios/chrome/browser/url_loading",
"//ios/chrome/browser/web_state_list",
"//ios/public/provider/chrome/browser",
"//ios/public/provider/chrome/browser/mailto",
"//ios/public/provider/chrome/browser/signin",
"//ios/public/provider/chrome/browser/user_feedback",
]
......
......@@ -9,20 +9,16 @@
#import "ios/chrome/app/application_delegate/tab_switching.h"
#import "ios/chrome/browser/ui/commands/application_commands.h"
#import "ios/chrome/browser/ui/main/scene_controller_guts.h"
#import "ios/chrome/browser/ui/main/scene_state.h"
#import "ios/chrome/browser/ui/tab_grid/tab_switcher.h"
#import "ios/chrome/browser/url_loading/app_url_loading_service.h"
@protocol MainControllerGuts;
// The controller object for a scene. Reacts to scene state changes.
@interface SceneController : NSObject <AppURLLoadingServiceDelegate,
SceneStateObserver,
@interface SceneController : NSObject <SceneStateObserver,
ApplicationCommands,
TabSwitcherDelegate,
TabSwitching,
SceneControllerGuts>
TabSwitching>
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithSceneState:(SceneState*)sceneState
......
// 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_BROWSER_UI_MAIN_SCENE_CONTROLLER_GUTS_H_
#define IOS_CHROME_BROWSER_UI_MAIN_SCENE_CONTROLLER_GUTS_H_
#import <UIKit/UIKit.h>
#import "ios/chrome/app/application_delegate/tab_opening.h"
#import "ios/chrome/browser/procedural_block_types.h"
#import "ios/chrome/browser/url_loading/url_loading_params.h"
@protocol SceneControllerGuts
- (void)closeSettingsAnimated:(BOOL)animated
completion:(ProceduralBlock)completion;
- (void)dismissModalDialogsWithCompletion:(ProceduralBlock)completion
dismissOmnibox:(BOOL)dismissOmnibox;
- (void)openSelectedTabInMode:(ApplicationModeForTabOpening)tabOpeningTargetMode
withUrlLoadParams:(const UrlLoadParams&)urlLoadParams
completion:(ProceduralBlock)completion;
@end
#endif // IOS_CHROME_BROWSER_UI_MAIN_SCENE_CONTROLLER_GUTS_H_
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