Commit 4efbc3a0 authored by Stepan Khapugin's avatar Stepan Khapugin Committed by Commit Bot

Revert temporary changes from crrev/1951014/3..4

Reverts changes that maintain the downstream tests compileable.
This should land after CL 2277302 in ios_internal which updates the
call site to use MainController instead of SceneController.

Bug: none
Change-Id: I028c096279fbd9dd5b9dbfd8e7720c9818a1580b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1958121
Commit-Queue: Stepan Khapugin <stkhapugin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#727475}
parent 34b17f5e
......@@ -46,8 +46,7 @@
@property(nonatomic, weak) MetricsMediator* metricsMediator;
// For temporary plumbing only.
@property(nonatomic, weak) id<ApplicationCommands, BrowsingDataCommands>
sceneController;
@property(nonatomic, weak) id<ApplicationCommands> sceneController;
@end
......
......@@ -871,7 +871,8 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
// Lazily create the main coordinator.
TabGridCoordinator* tabGridCoordinator =
[[TabGridCoordinator alloc] initWithWindow:self.window
applicationCommandEndpoint:self.sceneController];
applicationCommandEndpoint:self.sceneController
browsingDataCommandEndpoint:self];
tabGridCoordinator.regularTabModel = self.mainTabModel;
tabGridCoordinator.incognitoTabModel = self.otrTabModel;
_mainCoordinator = tabGridCoordinator;
......
......@@ -16,7 +16,6 @@
@class TabGridCoordinator;
@protocol BrowserInterfaceProvider;
@protocol TabSwitcher;
@protocol BrowsingDataCommands;
class AppUrlLoadingService;
namespace ios {
......@@ -26,7 +25,7 @@ class ChromeBrowserState;
// 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 <BrowsingDataCommands>
@protocol MainControllerGuts
// Coordinator for displaying history.
@property(nonatomic, strong) HistoryCoordinator* historyCoordinator;
......
......@@ -8,14 +8,12 @@
#import <UIKit/UIKit.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/main/scene_state.h"
@protocol MainControllerGuts;
// The controller object for a scene. Reacts to scene state changes.
@interface SceneController
: NSObject <SceneStateObserver, ApplicationCommands, BrowsingDataCommands>
@interface SceneController : NSObject <SceneStateObserver, ApplicationCommands>
- (instancetype)init NS_UNAVAILABLE;
- (instancetype)initWithSceneState:(SceneState*)sceneState
......
......@@ -557,21 +557,6 @@ enum class EnterTabSwitcherSnapshotResult {
return self.mainController.currentBrowserState->IsOffTheRecord();
}
#pragma mark - BrowsingDataCommands
- (void)removeBrowsingDataForBrowserState:(ios::ChromeBrowserState*)browserState
timePeriod:(browsing_data::TimePeriod)timePeriod
removeMask:(BrowsingDataRemoveMask)removeMask
completionBlock:(ProceduralBlock)completionBlock {
// Forward the call. This is only here to maintain the downstream compilation
// intact. Once the call site in the test downstream is updated, this will be
// removed.
[self.mainController removeBrowsingDataForBrowserState:browserState
timePeriod:timePeriod
removeMask:removeMask
completionBlock:completionBlock];
}
#pragma mark - SettingsNavigationControllerDelegate
- (void)closeSettings {
......
......@@ -123,6 +123,7 @@ source_set("unit_tests") {
"//ios/chrome/browser/browser_state:test_support",
"//ios/chrome/browser/ntp",
"//ios/chrome/browser/tabs",
"//ios/chrome/browser/ui/commands",
"//ios/chrome/browser/web",
"//ios/chrome/browser/web:test_support",
"//ios/chrome/browser/web_state_list",
......
......@@ -12,6 +12,7 @@
#import "ios/chrome/browser/ui/tab_grid/view_controller_swapping.h"
@protocol ApplicationCommands;
@protocol BrowsingDataCommands;
@class TabModel;
@protocol TabSwitcher;
......@@ -20,6 +21,8 @@
- (instancetype)initWithWindow:(UIWindow*)window
applicationCommandEndpoint:
(id<ApplicationCommands>)applicationCommandEndpoint
browsingDataCommandEndpoint:
(id<BrowsingDataCommands>)browsingDataCommandEndpoint
NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithWindow:(UIWindow*)window NS_UNAVAILABLE;
......
......@@ -69,7 +69,9 @@
- (instancetype)initWithWindow:(nullable UIWindow*)window
applicationCommandEndpoint:
(id<ApplicationCommands>)applicationCommandEndpoint {
(id<ApplicationCommands>)applicationCommandEndpoint
browsingDataCommandEndpoint:
(id<BrowsingDataCommands>)browsingDataCommandEndpoint {
if ((self = [super initWithWindow:window])) {
_dispatcher = [[CommandDispatcher alloc] init];
[_dispatcher startDispatchingToTarget:applicationCommandEndpoint
......@@ -80,7 +82,7 @@
[_dispatcher
startDispatchingToTarget:applicationCommandEndpoint
forProtocol:@protocol(ApplicationSettingsCommands)];
[_dispatcher startDispatchingToTarget:applicationCommandEndpoint
[_dispatcher startDispatchingToTarget:browsingDataCommandEndpoint
forProtocol:@protocol(BrowsingDataCommands)];
}
return self;
......
......@@ -7,6 +7,7 @@
#import <UIKit/UIKit.h>
#import "base/test/ios/wait_util.h"
#import "ios/chrome/browser/ui/commands/browsing_data_commands.h"
#import "ios/chrome/browser/ui/tab_grid/tab_switcher.h"
#import "ios/chrome/test/block_cleanup_test.h"
#include "testing/gtest_mac.h"
......@@ -42,7 +43,9 @@ class TabGridCoordinatorTest : public BlockCleanupTest {
coordinator_ = [[TabGridCoordinator alloc]
initWithWindow:window
applicationCommandEndpoint:OCMProtocolMock(
@protocol(ApplicationCommands))];
@protocol(ApplicationCommands))
browsingDataCommandEndpoint:OCMProtocolMock(
@protocol(BrowsingDataCommands))];
coordinator_.animationsDisabledForTesting = YES;
// TabGirdCoordinator will make its view controller the root, so stash the
// original root view controller before starting |coordinator_|.
......
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