Skip to content

Commit 2ea6d2c

Browse files
authored
Remove FXIOS-10865 [Dead code] Clean up dead code (#23703)
* Further clean up with periphery * remove comment * Remove dead telemetry
1 parent 301b752 commit 2ea6d2c

28 files changed

+29
-760
lines changed

.periphery.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
project: firefox-ios/Client.xcodeproj
2+
schemes:
3+
- Fennec
4+
targets:
5+
- Account
6+
- AccountTests
7+
- Client
8+
- ClientTests
9+
- NotificationService
10+
- SharedTests
11+
- Storage
12+
- StorageTests
13+
- Sync
14+
- SyncTelemetryTests
15+
- UITests
16+
- XCUITests

firefox-ios/Client.xcodeproj/project.pbxproj

-40
Large diffs are not rendered by default.

firefox-ios/Client/AccessoryViewProvider.swift

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class AccessoryViewProvider: UIView, Themeable, InjectedThemeUUIDIdentifiable {
1818
static let fixedSpacerHeight: CGFloat = 30
1919
static let fixedLeadingSpacerWidth: CGFloat = 2
2020
static let fixedTrailingSpacerWidth: CGFloat = 3
21-
static let doneButtonFontSize: CGFloat = 17
2221
}
2322

2423
// MARK: - Properties

firefox-ios/Client/Application/AccessibilityIdentifiers.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import Foundation
1212
/// main element wherein they appear. As we continue updating views, all
1313
/// `.accessibilityIdentifier` identifiers from the client and the tests
1414
/// should be move here and updated throughout the app.
15-
public struct AccessibilityIdentifiers {
15+
struct AccessibilityIdentifiers {
1616
/// Used for toolbar/URL bar buttons since our classes are built that buttons can live in one or the other
1717
/// Using only those a11y identifiers for both ensures we have standard way to refer to buttons from iPad to iPhone
1818
struct Toolbar {

firefox-ios/Client/Application/AppDelegate+PushNotifications.swift

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
import UIKit
66
import Shared
7-
import Storage
8-
import Sync
97
import UserNotifications
108
import Account
119

firefox-ios/Client/Application/AppDelegate+SyncSentTabs.swift

-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
// file, You can obtain one at http://mozilla.org/MPL/2.0/
44

55
import Shared
6-
import Storage
7-
import Sync
86
import UserNotifications
9-
import Account
107
import Common
118

129
extension UIApplication {
@@ -22,16 +19,13 @@ extension UIApplication {
2219
/// they can be handled when the app performs a sync.
2320
class AppFxACommandsDelegate: FxACommandsDelegate {
2421
private let app: ApplicationStateProvider
25-
private let logger: Logger
2622
private var applicationHelper: ApplicationHelper
2723
private var mainQueue: DispatchQueueInterface
2824

2925
init(app: ApplicationStateProvider,
30-
logger: Logger = DefaultLogger.shared,
3126
applicationHelper: ApplicationHelper = DefaultApplicationHelper(),
3227
mainQueue: DispatchQueueInterface = DispatchQueue.main) {
3328
self.app = app
34-
self.logger = logger
3529
self.applicationHelper = applicationHelper
3630
self.mainQueue = mainQueue
3731
}

firefox-ios/Client/Application/AppDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// file, You can obtain one at http://mozilla.org/MPL/2.0/
44

55
import Shared
6-
import Storage
76
import CoreSpotlight
87
import UIKit
98
import Common

firefox-ios/Client/Application/QuickActions.swift

-30
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ enum ShortcutType: String {
1414
case openLastBookmark = "OpenLastBookmark"
1515
case qrCode = "QRCode"
1616

17-
init?(fullType: String) {
18-
guard let last = fullType.components(separatedBy: ".").last else { return nil }
19-
20-
self.init(rawValue: last)
21-
}
22-
2317
var type: String {
2418
return Bundle.main.bundleIdentifier! + ".\(self.rawValue)"
2519
}
@@ -35,12 +29,6 @@ struct QuickActionInfos {
3529

3630
// MARK: - QuickActions
3731
protocol QuickActions {
38-
func addDynamicApplicationShortcutItemOfType(
39-
_ type: ShortcutType,
40-
fromShareItem shareItem: ShareItem,
41-
toApplication application: UIApplication
42-
)
43-
4432
func addDynamicApplicationShortcutItemOfType(
4533
_ type: ShortcutType,
4634
withUserData userData: [String: String],
@@ -64,25 +52,7 @@ extension QuickActions {
6452
}
6553

6654
struct QuickActionsImplementation: QuickActions {
67-
private let logger: Logger
68-
69-
init(logger: Logger = DefaultLogger.shared) {
70-
self.logger = logger
71-
}
72-
7355
// MARK: Administering Quick Actions
74-
func addDynamicApplicationShortcutItemOfType(_ type: ShortcutType,
75-
fromShareItem shareItem: ShareItem,
76-
toApplication application: UIApplication) {
77-
var userData = [QuickActionInfos.tabURLKey: shareItem.url]
78-
if let title = shareItem.title {
79-
userData[QuickActionInfos.tabTitleKey] = title
80-
}
81-
addDynamicApplicationShortcutItemOfType(type,
82-
withUserData: userData,
83-
toApplication: application)
84-
}
85-
8656
func addDynamicApplicationShortcutItemOfType(
8757
_ type: ShortcutType,
8858
withUserData userData: [String: String] = [String: String](),

firefox-ios/Client/Application/SceneDelegate.swift

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import UIKit
66
import CoreSpotlight
77
import Shared
8-
import Sync
98
import UserNotifications
109
import Common
1110

firefox-ios/Client/Application/UserConversionMetrics.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ class UserConversionMetrics {
2323
self.userDefaults = userDefaults
2424
}
2525

26-
public func didStartNewSession() {
26+
func didStartNewSession() {
2727
guard shouldRecordMetric() else { return }
2828
appOpenTimestamps.append(Date())
2929
if shouldActivateProfile() {
3030
sendActivationEvent()
3131
}
3232
}
3333

34-
public func didPerformSearch() {
34+
func didPerformSearch() {
3535
guard shouldRecordMetric() else { return }
3636
searchesTimestamps.append(Date())
3737
if shouldActivateProfile() {

firefox-ios/Client/DispatchQueueHelper.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
// Only push the task async if we are not already on the main thread.
88
// Unless you want another event to fire before your work happens.
99
// This is better than using DispatchQueue.main.async to ensure main thread
10-
public func ensureMainThread(execute work: @escaping @convention(block) () -> Swift.Void) {
10+
func ensureMainThread(execute work: @escaping @convention(block) () -> Swift.Void) {
1111
if Thread.isMainThread {
1212
work()
1313
} else {
@@ -17,7 +17,7 @@ public func ensureMainThread(execute work: @escaping @convention(block) () -> Sw
1717
}
1818
}
1919

20-
public func ensureMainThread<T>(execute work: @escaping () -> T) {
20+
func ensureMainThread<T>(execute work: @escaping () -> T) {
2121
if Thread.isMainThread {
2222
_ = work()
2323
} else {

firefox-ios/Client/Experiments/Experiments.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ enum Experiments {
134134
}
135135

136136
/// The `NimbusApi` object. This is the entry point to do anything with the Nimbus SDK on device.
137-
public static var shared: NimbusInterface = {
137+
static var shared: NimbusInterface = {
138138
let defaults = UserDefaults.standard
139139
let isFirstRun: Bool = defaults.object(forKey: NIMBUS_IS_FIRST_RUN_KEY) == nil
140140
if isFirstRun {
@@ -223,7 +223,7 @@ enum Experiments {
223223
/// - Parameters:
224224
/// - fireURL: an optional file URL that stores the initial experiments document.
225225
/// - firstRun: a flag indicating that this is the first time that the app has been run.
226-
public static func intialize() {
226+
static func intialize() {
227227
// Getting the singleton first time initializes it.
228228
let nimbus = Experiments.shared
229229

firefox-ios/Client/Experiments/Messaging/GleanPlumbMessage.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct GleanPlumbMessage {
3131
///
3232
/// This is corresponds to a MessageKey string from Nimbus.
3333
///
34-
public let id: String
34+
let id: String
3535

3636
/// The underlying MessageData from Nimbus.
3737
///

firefox-ios/Client/Frontend/Browser/Tabs/RemoteTabs/RemoteTabsClientAndTabsDataSource.swift

-124
This file was deleted.

firefox-ios/Client/Frontend/Browser/Tabs/Views/RemoteTabsPanel.swift

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ protocol RemoteTabsPanelDelegate: AnyObject {
1414
func presentFxAccountSettings()
1515
}
1616

17+
protocol RemoteTabsClientAndTabsDataSourceDelegate: AnyObject {
18+
func remoteTabsClientAndTabsDataSourceDidSelectURL(_ url: URL, visitType: VisitType)
19+
}
20+
1721
class RemoteTabsPanel: UIViewController,
1822
Themeable,
1923
RemoteTabsClientAndTabsDataSourceDelegate,

0 commit comments

Comments
 (0)