Skip to content

Commit

Permalink
Refactor FXIOS-10744 Cut out dead code from an old share tab experime…
Browse files Browse the repository at this point in the history
…nt (#23485)

* Cut out dead code from the tab share experiment.
  • Loading branch information
ih-codes authored Nov 29, 2024
1 parent 3e5b6f2 commit 5f55c43
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 37 deletions.
19 changes: 0 additions & 19 deletions firefox-ios/Client/Coordinators/TabTray/TabTrayCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ protocol TabTrayCoordinatorDelegate: AnyObject {

protocol TabTrayNavigationHandler: AnyObject {
func start(panelType: TabTrayPanelType, navigationController: UINavigationController)
func shareTab(url: URL, sourceView: UIView)
}

class TabTrayCoordinator: BaseCoordinator,
Expand Down Expand Up @@ -95,24 +94,6 @@ class TabTrayCoordinator: BaseCoordinator,
(navigationController.topViewController as? RemoteTabsPanel)?.remoteTabsDelegate = remoteTabsCoordinator
}

func shareTab(url: URL, sourceView: UIView) {
guard !childCoordinators.contains(where: { $0 is ShareExtensionCoordinator }) else { return }
let coordinator = makeShareExtensionCoordinator()
coordinator.start(url: url, sourceView: sourceView)
}

private func makeShareExtensionCoordinator() -> ShareExtensionCoordinator {
let coordinator = ShareExtensionCoordinator(
alertContainer: UIView(),
router: router,
profile: profile,
parentCoordinator: self,
tabManager: tabManager
)
add(child: coordinator)
return coordinator
}

// MARK: - ParentCoordinatorDelegate
func didFinish(from childCoordinator: Coordinator) {
TelemetryWrapper.recordEvent(category: .action,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ enum TabPanelViewActionType: ActionType {
case learnMorePrivateMode
case selectTab
case hideUndoToast
case showShareSheet
}

class TabPanelMiddlewareAction: Action {
Expand Down
13 changes: 0 additions & 13 deletions firefox-ios/Client/Frontend/Browser/Tabs/State/TabTrayState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct TabTrayState: ScreenState, Equatable {
var normalTabsCount: String
var hasSyncableAccount: Bool
var shouldDismiss: Bool
var shareURL: URL?
var toastType: ToastType?
var windowUUID: WindowUUID
var showCloseConfirmation: Bool
Expand All @@ -45,7 +44,6 @@ struct TabTrayState: ScreenState, Equatable {
normalTabsCount: panelState.normalTabsCount,
hasSyncableAccount: panelState.hasSyncableAccount,
shouldDismiss: panelState.shouldDismiss,
shareURL: panelState.shareURL,
toastType: panelState.toastType,
showCloseConfirmation: panelState.showCloseConfirmation)
}
Expand Down Expand Up @@ -73,7 +71,6 @@ struct TabTrayState: ScreenState, Equatable {
normalTabsCount: String,
hasSyncableAccount: Bool,
shouldDismiss: Bool = false,
shareURL: URL? = nil,
toastType: ToastType? = nil,
showCloseConfirmation: Bool = false) {
self.windowUUID = windowUUID
Expand All @@ -82,7 +79,6 @@ struct TabTrayState: ScreenState, Equatable {
self.normalTabsCount = normalTabsCount
self.hasSyncableAccount = hasSyncableAccount
self.shouldDismiss = shouldDismiss
self.shareURL = shareURL
self.toastType = toastType
self.showCloseConfirmation = showCloseConfirmation
}
Expand Down Expand Up @@ -185,15 +181,6 @@ struct TabTrayState: ScreenState, Equatable {

static func reduceTabPanelViewAction(action: TabPanelViewAction, state: TabTrayState) -> TabTrayState {
switch action.actionType {
case TabPanelViewActionType.showShareSheet:
guard let shareURL = action.shareSheetURL else { return defaultState(from: state) }
return TabTrayState(windowUUID: state.windowUUID,
isPrivateMode: state.isPrivateMode,
selectedPanel: state.selectedPanel,
normalTabsCount: state.normalTabsCount,
hasSyncableAccount: state.hasSyncableAccount,
shareURL: shareURL)

case TabPanelViewActionType.closeAllTabs:
return TabTrayState(windowUUID: state.windowUUID,
isPrivateMode: state.isPrivateMode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@ class TabTrayViewController: UIViewController,
delegate?.didFinish()
}

if let url = tabTrayState.shareURL {
navigationHandler?.shareTab(url: url, sourceView: self.view)
}

if tabTrayState.showCloseConfirmation {
showCloseAllConfirmation()
}
Expand Down

0 comments on commit 5f55c43

Please sign in to comment.