Commit cd9fa081 authored by Olivier Robin's avatar Olivier Robin Committed by Commit Bot

Revert "[ios] Hook up remote tabs in tab grid"

This reverts commit 5316b1cb.

Reason for revert: breaking ios_chrome_settings_egtests

Original change's description:
> [ios] Hook up remote tabs in tab grid
> 
> This CL hooks up the remote tabs in the tab grid.
> 
> A user can sign in from the remote tabs page in the tab grid. The
> transition animation that displays the signin interaction controller
> looks bad (and we are investigating the cause). If the user is signed
> in but does not have sync enabled, the user can enable sync from here.
> 
> Currently, tapping on a tab does nothing. This will be enabled in a
> future CL.
> 
> Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
> Change-Id: Ifba06919e1fb496917254a0da7e5462a4b854d79
> Reviewed-on: https://chromium-review.googlesource.com/1084080
> Commit-Queue: edchin <edchin@chromium.org>
> Reviewed-by: Eugene But <eugenebut@chromium.org>
> Reviewed-by: Sergio Collazos <sczs@chromium.org>
> Reviewed-by: edchin <edchin@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#564684}

TBR=rohitrao@chromium.org,eugenebut@chromium.org,edchin@chromium.org,sczs@chromium.org,javierrobles@chromium.org

Change-Id: Idc0b0b2def356a173949298bc7f560ee4dad3744
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Reviewed-on: https://chromium-review.googlesource.com/1088566Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564828}
parent eed597a7
......@@ -956,8 +956,6 @@ void MainControllerAuthenticationServiceDelegate::ClearBrowsingData(
[_browserViewWrangler shutdown];
_browserViewWrangler = nil;
[_mainCoordinator stop];
_chromeMain.reset();
}
......
......@@ -354,25 +354,25 @@ const int kRelativeTimeMaxHours = 4;
// called inside a [UITableView beginUpdates] block on iOS10, or
// performBatchUpdates on iOS11+.
- (void)updateOtherDevicesSectionForState:(SessionsSyncUserState)newState {
DCHECK_NE(newState,
SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS);
DCHECK(newState !=
SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS);
TableViewModel* model = self.tableViewModel;
SessionsSyncUserState previousState = self.sessionState;
if (previousState ==
SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS) {
// There were previously one or more session sections, but now they will be
// removed and replaced with a single OtherDevices section.
[self removeSessionSections];
[self addOtherDevicesSectionForState:newState];
// This is a special situation where the tableview operation is an insert
// rather than reload because the section was deleted.
[self.tableView insertSections:[self otherDevicesSectionIndexSet]
withRowAnimation:UITableViewRowAnimationNone];
return;
switch (previousState) {
case SessionsSyncUserState::USER_SIGNED_IN_SYNC_OFF:
case SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_NO_SESSIONS:
case SessionsSyncUserState::USER_SIGNED_OUT:
case SessionsSyncUserState::USER_SIGNED_IN_SYNC_IN_PROGRESS:
// The OtherDevices section will be updated, remove it in order to clean
// it up.
[model removeSectionWithIdentifier:SectionIdentifierOtherDevices];
break;
case SessionsSyncUserState::USER_SIGNED_IN_SYNC_ON_WITH_SESSIONS:
// The Sessions Section exists, remove it.
[self removeSessionSections];
break;
}
// For all other previous states, the tableview operation is a reload since
// there is already an OtherDevices section that can be updated.
[model removeSectionWithIdentifier:SectionIdentifierOtherDevices];
// Add an updated OtherDevices Section and then reload the TableView section.
[self addOtherDevicesSectionForState:newState];
[self.tableView reloadSections:[self otherDevicesSectionIndexSet]
withRowAnimation:UITableViewRowAnimationNone];
......
......@@ -68,12 +68,6 @@
forProtocol:@protocol(BrowserCommands)];
[_dispatcher startDispatchingToTarget:applicationCommandEndpoint
forProtocol:@protocol(ApplicationCommands)];
// -startDispatchingToTarget:forProtocol: doesn't pick up protocols the
// passed protocol conforms to, so ApplicationSettingsCommands is explicitly
// dispatched to the endpoint as well.
[_dispatcher
startDispatchingToTarget:applicationCommandEndpoint
forProtocol:@protocol(ApplicationSettingsCommands)];
}
return self;
}
......@@ -156,21 +150,6 @@
mainViewController.remoteTabsViewController.browserState =
_regularTabModel.browserState;
self.remoteTabsMediator = [[RecentTabsMediator alloc] init];
self.remoteTabsMediator.browserState = _regularTabModel.browserState;
self.remoteTabsMediator.consumer = mainViewController.remoteTabsConsumer;
// TODO(crbug.com/845636) : Currently, the image data source must be set
// before the mediator starts updating its consumer. Fix this so that order of
// calls does not matter.
mainViewController.remoteTabsViewController.imageDataSource =
self.remoteTabsMediator;
mainViewController.remoteTabsViewController.delegate =
self.remoteTabsMediator;
mainViewController.remoteTabsViewController.dispatcher =
static_cast<id<ApplicationCommands>>(self.dispatcher);
if (self.remoteTabsMediator.browserState) {
[self.remoteTabsMediator initObservers];
[self.remoteTabsMediator refreshSessionsView];
}
// Once the mediators are set up, stop keeping pointers to the tab models used
// to initialize them.
......@@ -183,8 +162,6 @@
- (void)stop {
[self.dispatcher stopDispatchingForProtocol:@protocol(BrowserCommands)];
[self.dispatcher stopDispatchingForProtocol:@protocol(ApplicationCommands)];
[self.dispatcher
stopDispatchingForProtocol:@protocol(ApplicationSettingsCommands)];
// TODO(crbug.com/845192) : RecentTabsTableViewController behaves like a
// coordinator and that should be factored out.
......
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