Skip to content

Commit

Permalink
[5735] Remove unnecessary command
Browse files Browse the repository at this point in the history
This command is no longer necessary. Indeed, if the pref is changed to
Never Move, the web state list observing methods will propagate 0
inactive tabs, which will trigger the pop here:
https://source.chromium.org/chromium/chromium/src/+/main:ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.mm;l=369;drc=6d1cea7beaa59224731827cc6d03fcd07fb878e4

(cherry picked from commit 9b10395)

Bug: 1440728
Change-Id: I189097fa0a5410714a9c8fd9676cb8a978a0b8d8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4482093
Auto-Submit: Louis Romero <lpromero@google.com>
Commit-Queue: Louis Romero <lpromero@google.com>
Reviewed-by: Aliona Dangla <alionadangla@chromium.org>
Commit-Queue: Aliona Dangla <alionadangla@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1136576}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4495250
Reviewed-by: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/branch-heads/5735@{#128}
Cr-Branched-From: 2f562e4-refs/heads/main@{#1135570}
  • Loading branch information
Arcank authored and Chromium LUCI CQ committed May 2, 2023
1 parent a2ba12d commit d014b43
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import("//build/config/ios/swift_source_set.gni")
source_set("inactive_tabs") {
configs += [ "//build/config/compiler:enable_arc" ]
sources = [
"inactive_tabs_commands.h",
"inactive_tabs_coordinator.h",
"inactive_tabs_coordinator.mm",
"inactive_tabs_mediator.h",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#import "ios/chrome/browser/tabs/inactive_tabs/features.h"
#import "ios/chrome/browser/ui/settings/settings_navigation_controller.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_commands.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_user_education_coordinator.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_view_controller.h"
Expand Down Expand Up @@ -99,7 +98,6 @@ - (void)setDimming:(CGFloat)dimming {

@interface InactiveTabsCoordinator () <
GridViewControllerDelegate,
InactiveTabsCommands,
InactiveTabsUserEducationCoordinatorDelegate,
InactiveTabsViewControllerDelegate,
SettingsNavigationControllerDelegate>
Expand Down Expand Up @@ -184,7 +182,6 @@ - (void)start {

self.mediator = [[InactiveTabsMediator alloc]
initWithConsumer:self.viewController.gridViewController
commandHandler:self
webStateList:self.browser->GetWebStateList()
prefService:GetApplicationContext()->GetLocalState()
sessionRestorationAgent:sessionRestorationBrowserAgent
Expand Down Expand Up @@ -425,12 +422,6 @@ - (void)didTapInactiveTabsSettingsLinkInGridViewController:
[self presentSettings];
}

#pragma mark - InactiveTabsCommands

- (void)inactiveTabsExplicitlyDisabledByUser {
[_delegate inactiveTabsCoordinatorDidFinish:self];
}

#pragma mark - InactiveTabsUserEducationCoordinatorDelegate

- (void)inactiveTabsUserEducationCoordinatorDidTapSettingsButton:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#import "ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_commands.h"

@protocol InactiveTabsCommands;
@protocol InactiveTabsInfoConsumer;
class PrefService;
class SnapshotBrowserAgent;
Expand All @@ -35,7 +34,6 @@ class TabRestoreService;
- (instancetype)initWithConsumer:
(id<TabCollectionConsumer, InactiveTabsInfoConsumer>)
consumer
commandHandler:(id<InactiveTabsCommands>)commandHandler
webStateList:(WebStateList*)webStateList
prefService:(PrefService*)prefService
sessionRestorationAgent:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#import "ios/chrome/browser/snapshots/snapshot_tab_helper.h"
#import "ios/chrome/browser/tabs/inactive_tabs/features.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_collection_consumer.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_commands.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_info_consumer.h"
#import "ios/chrome/browser/ui/tab_switcher/tab_utils.h"
#import "ios/chrome/browser/ui/tab_switcher/web_state_tab_switcher_item.h"
Expand Down Expand Up @@ -90,8 +89,6 @@ @interface InactiveTabsMediator () <CRWWebStateObserver,
WebStateListObserving> {
// The UI consumer to which updates are made.
__weak id<TabCollectionConsumer, InactiveTabsInfoConsumer> _consumer;
// The handler for commands related to Inactive Tabs.
__weak id<InactiveTabsCommands> _commandHandler;
// The list of inactive tabs.
WebStateList* _webStateList;
// The snapshot cache of _webStateList.
Expand Down Expand Up @@ -129,7 +126,6 @@ @implementation InactiveTabsMediator
- (instancetype)
initWithConsumer:
(id<TabCollectionConsumer, InactiveTabsInfoConsumer>)consumer
commandHandler:(id<InactiveTabsCommands>)commandHandler
webStateList:(WebStateList*)webStateList
prefService:(PrefService*)prefService
sessionRestorationAgent:
Expand All @@ -138,7 +134,6 @@ @implementation InactiveTabsMediator
tabRestoreService:(sessions::TabRestoreService*)tabRestoreService {
CHECK(IsInactiveTabsEnabled());
CHECK(consumer);
CHECK(commandHandler);
CHECK(webStateList);
CHECK(prefService);
CHECK(sessionRestorationAgent);
Expand All @@ -148,7 +143,6 @@ @implementation InactiveTabsMediator
self = [super init];
if (self) {
_consumer = consumer;
_commandHandler = commandHandler;
_webStateList = webStateList;

// Observe the web state list.
Expand Down Expand Up @@ -243,10 +237,6 @@ - (void)onPreferenceChanged:(const std::string&)preferenceName {
NSInteger daysThreshold =
_prefService->GetInteger(prefs::kInactiveTabsTimeThreshold);
[_consumer updateInactiveTabsDaysThreshold:daysThreshold];

if (daysThreshold == kInactiveTabsDisabledByUser) {
[_commandHandler inactiveTabsExplicitlyDisabledByUser];
}
}
}

Expand Down

0 comments on commit d014b43

Please sign in to comment.