diff --git a/BrowserKit/Sources/ComponentLibrary/Buttons/LegacyResizableButton.swift b/BrowserKit/Sources/ComponentLibrary/Buttons/LegacyResizableButton.swift deleted file mode 100644 index ecb22b62f5b3..000000000000 --- a/BrowserKit/Sources/ComponentLibrary/Buttons/LegacyResizableButton.swift +++ /dev/null @@ -1,71 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import UIKit - -/// Deprecated base button class that use content, image and title edge insets. -/// Should be replaced gradually with ``ResizableButton``, using UIButton.Configuration instead. -@available(*, deprecated, renamed: "ResizableButton", - message: "Should be replaced with ResizableButton, using UIButton.Configuration") -open class LegacyResizableButton: UIButton { - public struct UX { - public static let buttonEdgeSpacing: CGFloat = 8 - } - - public var buttonEdgeSpacing: CGFloat = UX.buttonEdgeSpacing { - didSet { - contentEdgeInsets = UIEdgeInsets(top: 0, - left: buttonEdgeSpacing, - bottom: 0, - right: buttonEdgeSpacing) - } - } - - override public init(frame: CGRect) { - super.init(frame: frame) - commonInit() - } - - public required init?(coder aDecoder: NSCoder) { - super.init(coder: aDecoder) - fatalError("init(coder:) has not been implemented") - } - - func commonInit() { - titleLabel?.numberOfLines = 0 - titleLabel?.adjustsFontForContentSizeCategory = true - titleLabel?.lineBreakMode = .byWordWrapping - adjustsImageSizeForAccessibilityContentSizeCategory = true - contentEdgeInsets = UIEdgeInsets(top: 0, - left: buttonEdgeSpacing, - bottom: 0, - right: buttonEdgeSpacing) - } - - override public var intrinsicContentSize: CGSize { - guard let title = titleLabel else { - return super.intrinsicContentSize - } - - let widthTitleInset = titleEdgeInsets.left + titleEdgeInsets.right - let widthImageInset = imageEdgeInsets.left + imageEdgeInsets.right - let widthContentInset = contentEdgeInsets.left + contentEdgeInsets.right - - var availableWidth = frame.width - widthTitleInset - widthImageInset - widthContentInset - if let imageWidth = image(for: [])?.size.width { - availableWidth = availableWidth - imageWidth - } - - let size = title.sizeThatFits(CGSize(width: availableWidth, height: .greatestFiniteMagnitude)) - return CGSize(width: size.width + widthContentInset, - height: size.height + contentEdgeInsets.top + contentEdgeInsets.bottom) - } - - override public func layoutSubviews() { - super.layoutSubviews() - guard let title = titleLabel else { return } - - titleLabel?.preferredMaxLayoutWidth = title.frame.size.width - } -} diff --git a/firefox-ios/Client.xcodeproj/project.pbxproj b/firefox-ios/Client.xcodeproj/project.pbxproj index 41cc57e0aea8..4c1083490775 100644 --- a/firefox-ios/Client.xcodeproj/project.pbxproj +++ b/firefox-ios/Client.xcodeproj/project.pbxproj @@ -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 */; }; @@ -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 */; }; @@ -7933,9 +7929,6 @@ A4CA448AA96CDBC3A7DBAC77 /* es-AR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-AR"; path = "es-AR.lproj/Storage.strings"; sourceTree = ""; }; A4DC42139D8B8F1B3EF09187 /* is */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = is; path = is.lproj/AuthenticationManager.strings; sourceTree = ""; }; A53F4A73AD12CBDA5CE2257D /* eu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = eu; path = eu.lproj/Storage.strings; sourceTree = ""; }; - A5519CF42B5D57560062BECB /* SearchSettingsState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsState.swift; sourceTree = ""; }; - A55319BA2B5D5A850051559F /* SearchSettingsAction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsAction.swift; sourceTree = ""; }; - A55319BC2B5D5AE70051559F /* SearchSettingsMiddleware.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsMiddleware.swift; sourceTree = ""; }; A5624F1DA2ABA87677302EDA /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = id.lproj/Shared.strings; sourceTree = ""; }; A56E4D2BB5542C88A788D957 /* uz */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uz; path = uz.lproj/PrivateBrowsing.strings; sourceTree = ""; }; A5724A80AF359D2F273F343E /* ne-NP */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "ne-NP"; path = "ne-NP.lproj/Localizable.strings"; sourceTree = ""; }; @@ -8323,7 +8316,6 @@ C8417D212657F0600010B877 /* LibraryViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryViewModel.swift; sourceTree = ""; }; C84266742728462900382274 /* AccessibilityIdentifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessibilityIdentifiers.swift; sourceTree = ""; }; C8445A13264428DC00B83F53 /* LibraryPanelViewState.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryPanelViewState.swift; sourceTree = ""; }; - C8445AD026443C7F00B83F53 /* LibraryPanelViewStateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryPanelViewStateTests.swift; sourceTree = ""; }; C8464093BC0470D518B16C72 /* af */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = af; path = af.lproj/3DTouchActions.strings; sourceTree = ""; }; C84655E12887388F00861B4A /* Wallpaper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Wallpaper.swift; sourceTree = ""; }; C84655E32887394B00861B4A /* WallpaperMetadata.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WallpaperMetadata.swift; sourceTree = ""; }; @@ -10318,7 +10310,6 @@ 2F44FC551A9E83E200FD20CC /* Settings */ = { isa = PBXGroup; children = ( - A5519CF32B5D572A0062BECB /* SearchSettings */, 216A0D772A40E83F008077BA /* ThemeSettings */, 8A3EF7ED2A2FCEC900796E3A /* Main */, EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */, @@ -12276,16 +12267,6 @@ path = GeneralizedTableView; sourceTree = ""; }; - A5519CF32B5D572A0062BECB /* SearchSettings */ = { - isa = PBXGroup; - children = ( - A5519CF42B5D57560062BECB /* SearchSettingsState.swift */, - A55319BA2B5D5A850051559F /* SearchSettingsAction.swift */, - A55319BC2B5D5AE70051559F /* SearchSettingsMiddleware.swift */, - ); - path = SearchSettings; - sourceTree = ""; - }; AB11407B2CAC0CA8005080CE /* TrackigProtectionRedux */ = { isa = PBXGroup; children = ( @@ -14150,7 +14131,6 @@ C889D7D32858CD4500121E1D /* HistoryHighlights */, 8A2825342760399B00395E66 /* KeyboardPressesHandlerTests.swift */, 8AED868128CA3A1F00351A50 /* Library */, - C8445AD026443C7F00B83F53 /* LibraryPanelViewStateTests.swift */, 81DAB2EF2C88EFEE00F4BE98 /* MainMenu */, C8DC90CA2A067BF10008832B /* MarkupParseUtilityTests */, C83DE54529DF3579006E1B69 /* Messaging */, @@ -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 */, @@ -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 */, @@ -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 */, @@ -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 */, diff --git a/firefox-ios/Client/Application/SceneDelegate.swift b/firefox-ios/Client/Application/SceneDelegate.swift index 5156159ab38d..fc3c86d5e9b5 100644 --- a/firefox-ios/Client/Application/SceneDelegate.swift +++ b/firefox-ios/Client/Application/SceneDelegate.swift @@ -4,11 +4,9 @@ import UIKit import CoreSpotlight -import Storage import Shared import Sync import UserNotifications -import Account import Common class SceneDelegate: UIResponder, UIWindowSceneDelegate { diff --git a/firefox-ios/Client/BookmarkItemsHelper.swift b/firefox-ios/Client/BookmarkItemsHelper.swift index 88054025b3dc..6808d5876854 100644 --- a/firefox-ios/Client/BookmarkItemsHelper.swift +++ b/firefox-ios/Client/BookmarkItemsHelper.swift @@ -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 diff --git a/firefox-ios/Client/Coordinators/AddressAutofillCoordinator.swift b/firefox-ios/Client/Coordinators/AddressAutofillCoordinator.swift index ed9a9308fa67..0fc61a2c1813 100644 --- a/firefox-ios/Client/Coordinators/AddressAutofillCoordinator.swift +++ b/firefox-ios/Client/Coordinators/AddressAutofillCoordinator.swift @@ -3,7 +3,6 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/ import Common -import Storage import ComponentLibrary import WebKit diff --git a/firefox-ios/Client/Coordinators/Library/BookmarksCoordinator.swift b/firefox-ios/Client/Coordinators/Library/BookmarksCoordinator.swift index f140ac15f823..c8d5f6d997ec 100644 --- a/firefox-ios/Client/Coordinators/Library/BookmarksCoordinator.swift +++ b/firefox-ios/Client/Coordinators/Library/BookmarksCoordinator.swift @@ -3,7 +3,6 @@ // file, You can obtain one at http://mozilla.org/MPL/2.0/ import Foundation -import Storage import Common import MozillaAppServices diff --git a/firefox-ios/Client/Coordinators/Scene/SceneCoordinator.swift b/firefox-ios/Client/Coordinators/Scene/SceneCoordinator.swift index b7342b9d9e0f..70b14ae5c3aa 100644 --- a/firefox-ios/Client/Coordinators/Scene/SceneCoordinator.swift +++ b/firefox-ios/Client/Coordinators/Scene/SceneCoordinator.swift @@ -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 { diff --git a/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanel.swift b/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanel.swift index 6a1124a1dc9f..7e66d454912b 100644 --- a/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanel.swift +++ b/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanel.swift @@ -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, diff --git a/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanelViewModel.swift b/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanelViewModel.swift index 24d6b76f48f6..9b28d95a2069 100644 --- a/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanelViewModel.swift +++ b/firefox-ios/Client/Frontend/Library/HistoryPanel/HistoryPanelViewModel.swift @@ -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 diff --git a/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryPanelViewState.swift b/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryPanelViewState.swift index 085a1b993953..224de1c5928e 100644 --- a/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryPanelViewState.swift +++ b/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryPanelViewState.swift @@ -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 - } - } -} diff --git a/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsClient.swift b/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsClient.swift index e79d6899a8fe..e7de9ed3465d 100644 --- a/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsClient.swift +++ b/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsClient.swift @@ -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" diff --git a/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsManager.swift b/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsManager.swift index 1c35ef092064..20239fffa986 100644 --- a/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsManager.swift +++ b/firefox-ios/Client/Frontend/PasswordManagement/BreachAlertsManager.swift @@ -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() var client: BreachAlertsClientProtocol diff --git a/firefox-ios/Client/Frontend/Settings/Clearables.swift b/firefox-ios/Client/Frontend/Settings/Clearables.swift index 5a6345f47304..f903a60edf41 100644 --- a/firefox-ios/Client/Frontend/Settings/Clearables.swift +++ b/firefox-ios/Client/Frontend/Settings/Clearables.swift @@ -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 diff --git a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsAction.swift b/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsAction.swift deleted file mode 100644 index 761bb1c05a5e..000000000000 --- a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsAction.swift +++ /dev/null @@ -1,7 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import Redux - -class SearchSettingsAction: Action {} diff --git a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsMiddleware.swift b/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsMiddleware.swift deleted file mode 100644 index 8095bb2cb92f..000000000000 --- a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsMiddleware.swift +++ /dev/null @@ -1,8 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import Foundation - -class SearchSettingsMiddleware { -} diff --git a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsState.swift b/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsState.swift deleted file mode 100644 index 51879cc7a7d0..000000000000 --- a/firefox-ios/Client/Frontend/Settings/SearchSettings/SearchSettingsState.swift +++ /dev/null @@ -1,26 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import Redux -import Common - -struct SearchSettingsState: ScreenState, Equatable { - let windowUUID: WindowUUID - - init(_ appState: AppState, windowUUID: WindowUUID) { - self.windowUUID = windowUUID - } - - init(windowUUID: WindowUUID) { - self.windowUUID = windowUUID - } - - static let reducer: Reducer = { state, action in - return defaultState(from: state) - } - - static func defaultState(from state: SearchSettingsState) -> SearchSettingsState { - return SearchSettingsState(windowUUID: state.windowUUID) - } -} diff --git a/firefox-ios/Providers/Pocket/PocketProvider.swift b/firefox-ios/Providers/Pocket/PocketProvider.swift index c9b373f0fab7..30610296a208 100644 --- a/firefox-ios/Providers/Pocket/PocketProvider.swift +++ b/firefox-ios/Providers/Pocket/PocketProvider.swift @@ -24,10 +24,6 @@ extension PocketStoriesProviding { } class PocketProvider: PocketStoriesProviding, FeatureFlaggable, URLCaching { - private class PocketError: MaybeErrorType { - var description = "Failed to load from API" - } - private let pocketEnvAPIKey = "PocketEnvironmentAPIKey" private static let SupportedLocales = ["en_CA", "en_US", "en_GB", "en_ZA", "de_DE", "de_AT", "de_CH"] diff --git a/firefox-ios/Providers/RustSyncManager.swift b/firefox-ios/Providers/RustSyncManager.swift index 6a06cd43de79..bd6bd7719b88 100644 --- a/firefox-ios/Providers/RustSyncManager.swift +++ b/firefox-ios/Providers/RustSyncManager.swift @@ -339,10 +339,6 @@ public class RustSyncManager: NSObject, SyncManager { public let description = "No key data found for scope." } - public class EncryptionKeyError: MaybeErrorType { - public let description = "Failed to get stored key." - } - public class DeviceIdError: MaybeErrorType { public let description = "Failed to get deviceId." } @@ -351,10 +347,6 @@ public class RustSyncManager: NSObject, SyncManager { public let description = "Failed to get token server endpoint url." } - public class EngineAndKeyRetrievalError: MaybeErrorType { - public let description = "Failed to get sync engine and key data." - } - private func registerSyncEngines(engines: [RustSyncManagerAPI.TogglableEngine], loginKey: String?, creditCardKey: String?, diff --git a/firefox-ios/firefox-ios-tests/Tests/ClientTests/LibraryPanelViewStateTests.swift b/firefox-ios/firefox-ios-tests/Tests/ClientTests/LibraryPanelViewStateTests.swift deleted file mode 100644 index 6a9879e32e6b..000000000000 --- a/firefox-ios/firefox-ios-tests/Tests/ClientTests/LibraryPanelViewStateTests.swift +++ /dev/null @@ -1,286 +0,0 @@ -// This Source Code Form is subject to the terms of the Mozilla Public -// License, v. 2.0. If a copy of the MPL was not distributed with this -// file, You can obtain one at http://mozilla.org/MPL/2.0/ - -import XCTest -@testable import Client - -class LibraryPanelViewStateTests: XCTestCase { - var panelState: LibraryPanelViewState? - - override func setUp() { - super.setUp() - panelState = LibraryPanelViewState() - } - - override func tearDown() { - super.tearDown() - panelState = nil - } - - // MARK: - Single panel interaction tests - func testStateMachineInitializesWithProperState() { - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .mainView) - - XCTAssertEqual(actualState, expectedState, "The library panel view is not initializing correctly.") - } - - func testStateChangingToSameState() { - panelState?.currentState = .bookmarks(state: .mainView) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .mainView) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view changing from one state to the same state is not working!" - ) - } - - func testStateOnBookmarkPanelGoesIntoFolderState() { - panelState?.currentState = .bookmarks(state: .inFolder) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolder) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolder state for bookmarks" - ) - } - - func testStateOnBookmarkPanelGoesIntoEditFolderState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolderEditMode) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolderEditMode state for bookmarks" - ) - } - - func testStateOnBookmarkPanelGoesIntoItemEditState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: .itemEditMode) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .itemEditMode) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolderEditMode state for bookmarks" - ) - } - - func testStateOnBookmarkPanelGoesBackToFolderEditModeFromItemEditState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: .itemEditMode) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolderEditMode) - - // swiftlint:disable line_length - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolderEditMode state for bookmarks from the .itemEditMode state" - ) - // swiftlint:enable line_length - } - - func testStateOnBookmarkPanelGoesBackToFolderEditModeFromItemEditInvalidFieldState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: .itemEditModeInvalidField) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolderEditMode) - - // swiftlint:disable line_length - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolderEditMode state for bookmarks from the .itemEditModeInvalidField state" - ) - // swiftlint:enable line_length - } - - func testStateOnBookmarkPanelGoesIntoItemEditInvalidFieldState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: .itemEditModeInvalidField) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .itemEditModeInvalidField) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inItemEditModeInvalidField state for bookmarks" - ) - } - - func testStateOnBookmarkPanelGoesBackToFolderEditModeFromItemEditInvalidState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: .itemEditModeInvalidField) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolderEditMode) - - // swiftlint:disable line_length - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .inFolderEditMode state for bookmarks from the .itemEditMode state" - ) - // swiftlint:enable line_length - } - - func testStateOnBookmarkPanelFollowStateProgressionMovingIntoStates() { - testStateOnBookmarkPanelFollowStateProgressionMovingIntoStates(using: .itemEditMode) - testStateOnBookmarkPanelFollowStateProgressionMovingIntoStates(using: .itemEditModeInvalidField) - } - - private func testStateOnBookmarkPanelFollowStateProgressionMovingIntoStates(using state: LibraryPanelSubState) { - panelState?.currentState = .bookmarks(state: state) - var actualState = panelState?.currentState - var wrongState: LibraryPanelMainState = .bookmarks(state: state) - let expectedState: LibraryPanelMainState = .bookmarks(state: .mainView) - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .mainView state for bookmarks" - ) - XCTAssertNotEqual(actualState, wrongState, "Attempting to move to the wrong state did not fail!") - - panelState?.currentState = .bookmarks(state: state) - actualState = panelState?.currentState - wrongState = .bookmarks(state: state) - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .mainView state for bookmarks" - ) - XCTAssertNotEqual(actualState, wrongState, "Attempting to move to the wrong state did not fail!") - } - - func testStateOnBookmarkPanelFollowsStateProgressionMovingOutOfStates() { - testStateOnBookmarkPanelFollowsStateProgressionMovingOutOfStates(lastState: .itemEditMode) - testStateOnBookmarkPanelFollowsStateProgressionMovingOutOfStates(lastState: .itemEditModeInvalidField) - } - - private func testStateOnBookmarkPanelFollowsStateProgressionMovingOutOfStates(lastState: LibraryPanelSubState) { - // Go to last state - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .bookmarks(state: lastState) - - // attempt to climb backwards - panelState?.currentState = .bookmarks(state: .inFolder) - var actualState = panelState?.currentState - var wrongState: LibraryPanelMainState = .bookmarks(state: .inFolder) - let expectedState: LibraryPanelMainState = .bookmarks(state: lastState) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the correct edit state for bookmarks" - ) - XCTAssertNotEqual(actualState, wrongState, "Attempting to move to the wrong state did not fail!") - - panelState?.currentState = .bookmarks(state: .mainView) - actualState = panelState?.currentState - wrongState = .bookmarks(state: .mainView) - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the correct edit state for bookmarks" - ) - XCTAssertNotEqual(actualState, wrongState, "Attempting to move to the wrong state did not fail!") - } - - // MARK: - Multi-panel tests - func testStateForBookmarkMainViewToOtherPanelMainView() { - panelState?.currentState = .history(state: .mainView) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .history(state: .mainView) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly enter the .history(.mainView) state for the History Panel" - ) - } - - func testStateForBookmarkMainViewToOtherPanelMainViewAndBack() { - panelState?.currentState = .history(state: .mainView) - panelState?.currentState = .bookmarks(state: .mainView) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .mainView) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly return to the .bookmarks(.mainView) state" - ) - } - - func testBookmarkViewInFolderModeSwitchingToOtherPanelAndReturningToCorrectBookmarksState() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .history(state: .mainView) - panelState?.currentState = .bookmarks(state: .mainView) - - let actualState = panelState?.currentState - let expectedState: LibraryPanelMainState = .bookmarks(state: .inFolder) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly return to the .bookmarks(.inFolder) state" - ) - } - - func testChangingDifferentPanelsAndSavingStates() { - panelState?.currentState = .bookmarks(state: .inFolder) - panelState?.currentState = .bookmarks(state: .inFolderEditMode) - panelState?.currentState = .history(state: .mainView) - panelState?.currentState = .history(state: .inFolder) - panelState?.currentState = .downloads - panelState?.currentState = .bookmarks(state: .mainView) - - var actualState = panelState?.currentState - var expectedState: LibraryPanelMainState = .bookmarks(state: .inFolderEditMode) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly return to the .bookmarks(.inFolderEditMode) state" - ) - - panelState?.currentState = .history(state: .mainView) - actualState = panelState?.currentState - expectedState = .history(state: .inFolder) - - XCTAssertEqual( - actualState, - expectedState, - "The library panel view did not correctly return to the .history(.inFolder) state" - ) - } -}