Skip to content

Commit

Permalink
Remove [Clean up] Dead code (#23380)
Browse files Browse the repository at this point in the history
Clean up dead code and remove some unused import
  • Loading branch information
lmarceau authored Nov 25, 2024
1 parent 0a32b73 commit 273cbdb
Show file tree
Hide file tree
Showing 19 changed files with 2 additions and 542 deletions.

This file was deleted.

24 changes: 0 additions & 24 deletions firefox-ios/Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,6 @@
96EB6C4027DBEE9800A9D159 /* SearchGroupedItemsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EB6C3F27DBEE9800A9D159 /* SearchGroupedItemsViewController.swift */; };
96EB6C4327DC205D00A9D159 /* SearchGroupedItemsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96EB6C4227DC205D00A9D159 /* SearchGroupedItemsViewModel.swift */; };
96F8DA49280452CA00E53239 /* GleanPlumbContextProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96F8DA48280452CA00E53239 /* GleanPlumbContextProvider.swift */; };
A5519CF52B5D57560062BECB /* SearchSettingsState.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5519CF42B5D57560062BECB /* SearchSettingsState.swift */; };
A55319BB2B5D5A850051559F /* SearchSettingsAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55319BA2B5D5A850051559F /* SearchSettingsAction.swift */; };
A55319BD2B5D5AE70051559F /* SearchSettingsMiddleware.swift in Sources */ = {isa = PBXBuildFile; fileRef = A55319BC2B5D5AE70051559F /* SearchSettingsMiddleware.swift */; };
A83E5B1A1C1DA8BF0026D912 /* image.gif in Resources */ = {isa = PBXBuildFile; fileRef = A83E5B181C1DA8BF0026D912 /* image.gif */; };
A83E5B1B1C1DA8BF0026D912 /* image.png in Resources */ = {isa = PBXBuildFile; fileRef = A83E5B191C1DA8BF0026D912 /* image.png */; };
A83E5B1D1C1DA8D80026D912 /* UIPasteboardExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A83E5B1C1C1DA8D80026D912 /* UIPasteboardExtensionsTests.swift */; };
Expand Down Expand Up @@ -1289,7 +1286,6 @@
C84266752728462900382274 /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84266742728462900382274 /* AccessibilityIdentifiers.swift */; };
C84266772728462900382274 /* AccessibilityIdentifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84266742728462900382274 /* AccessibilityIdentifiers.swift */; };
C8445A14264428DC00B83F53 /* LibraryPanelViewState.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8445A13264428DC00B83F53 /* LibraryPanelViewState.swift */; };
C8445AD126443C7F00B83F53 /* LibraryPanelViewStateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8445AD026443C7F00B83F53 /* LibraryPanelViewStateTests.swift */; };
C84655E22887388F00861B4A /* Wallpaper.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84655E12887388F00861B4A /* Wallpaper.swift */; };
C84655E42887394B00861B4A /* WallpaperMetadata.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84655E32887394B00861B4A /* WallpaperMetadata.swift */; };
C84655E62887398700861B4A /* WallpaperCollection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C84655E52887398700861B4A /* WallpaperCollection.swift */; };
Expand Down Expand Up @@ -7933,9 +7929,6 @@
A4CA448AA96CDBC3A7DBAC77 /* es-AR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-AR"; path = "es-AR.lproj/Storage.strings"; sourceTree = "<group>"; };
A4DC42139D8B8F1B3EF09187 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/AuthenticationManager.strings; sourceTree = "<group>"; };
A53F4A73AD12CBDA5CE2257D /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/Storage.strings; sourceTree = "<group>"; };
A5519CF42B5D57560062BECB /* SearchSettingsState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsState.swift; sourceTree = "<group>"; };
A55319BA2B5D5A850051559F /* SearchSettingsAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsAction.swift; sourceTree = "<group>"; };
A55319BC2B5D5AE70051559F /* SearchSettingsMiddleware.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsMiddleware.swift; sourceTree = "<group>"; };
A5624F1DA2ABA87677302EDA /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Shared.strings; sourceTree = "<group>"; };
A56E4D2BB5542C88A788D957 /* uz */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uz; path = uz.lproj/PrivateBrowsing.strings; sourceTree = "<group>"; };
A5724A80AF359D2F273F343E /* ne-NP */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ne-NP"; path = "ne-NP.lproj/Localizable.strings"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -8323,7 +8316,6 @@
C8417D212657F0600010B877 /* LibraryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryViewModel.swift; sourceTree = "<group>"; };
C84266742728462900382274 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = "<group>"; };
C8445A13264428DC00B83F53 /* LibraryPanelViewState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryPanelViewState.swift; sourceTree = "<group>"; };
C8445AD026443C7F00B83F53 /* LibraryPanelViewStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryPanelViewStateTests.swift; sourceTree = "<group>"; };
C8464093BC0470D518B16C72 /* af */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = af; path = af.lproj/3DTouchActions.strings; sourceTree = "<group>"; };
C84655E12887388F00861B4A /* Wallpaper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Wallpaper.swift; sourceTree = "<group>"; };
C84655E32887394B00861B4A /* WallpaperMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpaperMetadata.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -10318,7 +10310,6 @@
2F44FC551A9E83E200FD20CC /* Settings */ = {
isa = PBXGroup;
children = (
A5519CF32B5D572A0062BECB /* SearchSettings */,
216A0D772A40E83F008077BA /* ThemeSettings */,
8A3EF7ED2A2FCEC900796E3A /* Main */,
EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */,
Expand Down Expand Up @@ -12276,16 +12267,6 @@
path = GeneralizedTableView;
sourceTree = "<group>";
};
A5519CF32B5D572A0062BECB /* SearchSettings */ = {
isa = PBXGroup;
children = (
A5519CF42B5D57560062BECB /* SearchSettingsState.swift */,
A55319BA2B5D5A850051559F /* SearchSettingsAction.swift */,
A55319BC2B5D5AE70051559F /* SearchSettingsMiddleware.swift */,
);
path = SearchSettings;
sourceTree = "<group>";
};
AB11407B2CAC0CA8005080CE /* TrackigProtectionRedux */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -14150,7 +14131,6 @@
C889D7D32858CD4500121E1D /* HistoryHighlights */,
8A2825342760399B00395E66 /* KeyboardPressesHandlerTests.swift */,
8AED868128CA3A1F00351A50 /* Library */,
C8445AD026443C7F00B83F53 /* LibraryPanelViewStateTests.swift */,
81DAB2EF2C88EFEE00F4BE98 /* MainMenu */,
C8DC90CA2A067BF10008832B /* MarkupParseUtilityTests */,
C83DE54529DF3579006E1B69 /* Messaging */,
Expand Down Expand Up @@ -16227,7 +16207,6 @@
21B359C62AEAC20300FF09E3 /* TabsSectionManager.swift in Sources */,
21BFEEF52A040EF40033048D /* TabMigrationUtility.swift in Sources */,
8AEAD9F52C3D7BA9001A2C5A /* FeatureFlagsDebugViewController.swift in Sources */,
A55319BB2B5D5A850051559F /* SearchSettingsAction.swift in Sources */,
810CD9C12BB346D800E290C2 /* OnboardingCardViewController.swift in Sources */,
C8A012F126AB07D70096A7A7 /* JumpBackInViewModel.swift in Sources */,
8AAAB05F2C1B72C9008830B3 /* SearchHighlightItem.swift in Sources */,
Expand Down Expand Up @@ -16341,7 +16320,6 @@
D87F84AC20B891160091F2DA /* TopTabDisplayManager.swift in Sources */,
D0C95EF6201A55A800E4E51C /* BrowserViewController+UIDropInteractionDelegate.swift in Sources */,
D31CF65C1CC1959A001D0BD0 /* PrivilegedRequest.swift in Sources */,
A55319BD2B5D5AE70051559F /* SearchSettingsMiddleware.swift in Sources */,
8A6A796D27F773550022D6C6 /* HomepageContextMenuHelper.swift in Sources */,
8A2783F1275FFDC50080D29D /* KeyboardPressesHandler.swift in Sources */,
E650755C1E37F747006961AC /* Swizzling.m in Sources */,
Expand Down Expand Up @@ -16675,7 +16653,6 @@
C84655FF2887A06B00861B4A /* WallpaperFilePathProvider.swift in Sources */,
8A1E93EA2A3CDC6100DD540A /* BaseCoordinator.swift in Sources */,
E1442FD6294782D9003680B0 /* UIView+Extension.swift in Sources */,
A5519CF52B5D57560062BECB /* SearchSettingsState.swift in Sources */,
AB936A692C05F2B100600F82 /* TrackingProtectionButton.swift in Sources */,
74F80D342A0A52D700013C3D /* PrivacyPolicyViewController.swift in Sources */,
274A36CE239EB9EC00A21587 /* LibraryViewController+LibraryPanelDelegate.swift in Sources */,
Expand Down Expand Up @@ -17186,7 +17163,6 @@
967EDABD29D705300089208D /* CreditCardValidatorTests.swift in Sources */,
D815A3A824A53F3200AAB221 /* TabToolbarHelperTests.swift in Sources */,
967EDABF29D769A10089208D /* CreditCardInputFieldTests.swift in Sources */,
C8445AD126443C7F00B83F53 /* LibraryPanelViewStateTests.swift in Sources */,
21F2A2D42B0D194A00626AEC /* TabsPanelStateTests.swift in Sources */,
8CFD56892AAF06D3003157A6 /* ShoppingProductTests.swift in Sources */,
8ACA8F7629198D6400D3075D /* ThrottlerTests.swift in Sources */,
Expand Down
2 changes: 0 additions & 2 deletions firefox-ios/Client/Application/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@

import UIKit
import CoreSpotlight
import Storage
import Shared
import Sync
import UserNotifications
import Account
import Common

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
Expand Down
1 change: 0 additions & 1 deletion firefox-ios/Client/BookmarkItemsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Foundation
import Storage
import Shared

import class MozillaAppServices.BookmarkItemData
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Common
import Storage
import ComponentLibrary
import WebKit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import Foundation
import Storage
import Common
import MozillaAppServices

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import Common
import UIKit
import Shared
import Storage

/// Each scene has it's own scene coordinator, which is the root coordinator for a scene.
class SceneCoordinator: BaseCoordinator, LaunchCoordinatorDelegate, LaunchFinishedLoadingDelegate {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ import WebKit
import Common
import SiteImageView

private class FetchInProgressError: MaybeErrorType {
internal var description: String {
return "Fetch is already in-progress"
}
}

@objcMembers
class HistoryPanel: UIViewController,
LibraryPanel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ import SwiftUI

import struct MozillaAppServices.VisitTransitionSet

private class FetchInProgressError: MaybeErrorType {
internal var description: String {
return "Fetch is already in-progress"
}
}

class HistoryPanelViewModel: FeatureFlaggable {
enum Sections: Int, CaseIterable {
case additionalHistoryActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,82 +81,3 @@ enum LibraryPanelSubState {
return false
}
}

/// The `LibraryPanelViewState` class is a state machine that will keep track of the
/// current state of each panel of the Library Panel. The current state is accessed/updated
/// through the `currentState` variable, which will ensure that specific substates for each
/// are preserved.
class LibraryPanelViewState {
private var state: LibraryPanelMainState = .bookmarks(state: .mainView)
var currentState: LibraryPanelMainState {
get { return state }
set {
updateState(to: newValue)
}
}

// All states with a substate must have their own variable in order to keep
// track of what substate we were in such that, when the user returns to
// that panel, we retain the correct state.
private var bookmarksState: LibraryPanelMainState = .bookmarks(state: .mainView)
private var historyState: LibraryPanelMainState = .history(state: .mainView)

private func updateState(to newState: LibraryPanelMainState) {
let changingPanels = state.panelIsDifferentFrom(newState)
storeCurrentState()
switch newState {
// All cases where we have substates must use the `updateStateVariables`
// function in order to check if it's a legal update
case .bookmarks(let newSubviewState):
guard case .bookmarks(let oldSubviewState) = bookmarksState else { return }
updateStateVariables(for: newState,
andCategory: bookmarksState,
with: newSubviewState,
and: oldSubviewState,
isChangingPanels: changingPanels)

case .history(let newSubviewState):
guard case .history(let oldSubviewState) = historyState else { return }
updateStateVariables(for: newState,
andCategory: historyState,
with: newSubviewState,
and: oldSubviewState,
isChangingPanels: changingPanels)

// In the case of panels without substates, we can just update
// the state directly without worry.
case .downloads,
.readingList:
self.state = newState
}
}

private func storeCurrentState() {
switch state {
case .bookmarks:
bookmarksState = state
case .history:
historyState = state
case .downloads, .readingList:
return
}
}

private func updateStateVariables(
for newState: LibraryPanelMainState,
andCategory category: LibraryPanelMainState,
with newSubviewState: LibraryPanelSubState,
and oldSubviewState: LibraryPanelSubState,
isChangingPanels: Bool
) {
if isChangingPanels {
self.state = category
} else if newSubviewState.isChildState(of: oldSubviewState)
|| newSubviewState.isParentState(of: oldSubviewState)
|| oldSubviewState == newSubviewState {
self.state = newState
} else if newSubviewState == .search || oldSubviewState == .search {
self.state = newState
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ protocol BreachAlertsClientProtocol {
}

/// Handles all network requests for BreachAlertsManager.
public class BreachAlertsClient: BreachAlertsClientProtocol {
class BreachAlertsClient: BreachAlertsClientProtocol {
private var dataTask: URLSessionDataTask?
public enum Endpoint: String {
case breachedAccounts = "https://monitor.firefox.com/hibp/breaches"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct BreachRecord: Codable, Equatable, Hashable {
}

/// A manager for the user's breached login information, if any.
public final class BreachAlertsManager {
final class BreachAlertsManager {
static let monitorAboutUrl = URL(string: "https://monitor.firefox.com/about")
var breaches = Set<BreachRecord>()
var client: BreachAlertsClientProtocol
Expand Down
9 changes: 0 additions & 9 deletions firefox-ios/Client/Frontend/Settings/Clearables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ protocol Clearable {
var label: String { get }
}

class ClearableError: MaybeErrorType {
fileprivate let msg: String
init(msg: String) {
self.msg = msg
}

var description: String { return msg }
}

// Clears our browsing history, including favicons and thumbnails.
class HistoryClearable: Clearable {
let profile: Profile
Expand Down

This file was deleted.

This file was deleted.

Loading

0 comments on commit 273cbdb

Please sign in to comment.