Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ extension Notification.Name {
public static let TopSitesUpdated = Notification.Name("TopSitesUpdated")
public static let PageZoomLevelUpdated = Notification.Name("PageZoomLevelUpdated")
public static let PageZoomSettingsChanged = Notification.Name("PageZoomSettingsChanged")
public static let SettingsDismissed = Notification.Name("SettingsDismissed")

// Search
public static let DefaultSearchEngineUpdated = Notification.Name("DefaultSearchEngineUpdated")
Expand Down
40 changes: 24 additions & 16 deletions firefox-ios/Client.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@
2CF9D9AA20067FA10083DF2A /* BrowsingPDFTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CF9D9A920067FA10083DF2A /* BrowsingPDFTests.swift */; };
2F13E79B1AC0C02700D75081 /* StringExtensionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F13E79A1AC0C02700D75081 /* StringExtensionsTests.swift */; };
2F44FA1B1A9D426A00FD20CC /* TestHashExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FA1A1A9D426A00FD20CC /* TestHashExtensions.swift */; };
2F44FC721A9E840300FD20CC /* SettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */; };
2F44FC721A9E840300FD20CC /* ThemedNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */; };
2F44FCC51A9E85E900FD20CC /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */; };
2F44FCC71A9E8CF500FD20CC /* SearchSettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */; };
2F44FCCB1A9E972E00FD20CC /* SearchEnginePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */; };
Expand Down Expand Up @@ -1508,6 +1508,8 @@
C2200A6A2B7D148C00DC062A /* ContentBlockerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2200A692B7D148C00DC062A /* ContentBlockerTests.swift */; };
C22753402A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = C227533F2A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift */; };
C2296FCC2A601C190046ECA6 /* IntensityVisualEffectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C2296FCB2A601C190046ECA6 /* IntensityVisualEffectView.swift */; };
C234BFC02EBB8321004BF5A8 /* SettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */; };
C234BFC22EBB8356004BF5A8 /* ModalSettingsNavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */; };
C23889DF2A4EFCE500429673 /* ShareSheetCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889DE2A4EFCE500429673 /* ShareSheetCoordinator.swift */; };
C23889E12A4F3E7200429673 /* ParentCoordinatorDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889E02A4F3E7200429673 /* ParentCoordinatorDelegate.swift */; };
C23889E32A50319A00429673 /* ShareSheetCoordinatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C23889E22A50319A00429673 /* ShareSheetCoordinatorTests.swift */; };
Expand Down Expand Up @@ -3177,7 +3179,7 @@
2F13E79A1AC0C02700D75081 /* StringExtensionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StringExtensionsTests.swift; sourceTree = "<group>"; };
2F14E1391ABB890800FF98DB /* Account-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Account-Bridging-Header.h"; sourceTree = "<group>"; };
2F44FA1A1A9D426A00FD20CC /* TestHashExtensions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHashExtensions.swift; sourceTree = "<group>"; };
2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsNavigationController.swift; sourceTree = "<group>"; };
2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemedNavigationController.swift; sourceTree = "<group>"; };
2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = "<group>"; };
2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchSettingsTableViewController.swift; sourceTree = "<group>"; };
2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchEnginePicker.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -9769,6 +9771,8 @@
C2200A692B7D148C00DC062A /* ContentBlockerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentBlockerTests.swift; sourceTree = "<group>"; };
C227533F2A3C9E1300B9C0D1 /* WebsiteDataManagementViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WebsiteDataManagementViewModel.swift; sourceTree = "<group>"; };
C2296FCB2A601C190046ECA6 /* IntensityVisualEffectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntensityVisualEffectView.swift; sourceTree = "<group>"; };
C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsNavigationController.swift; sourceTree = "<group>"; };
C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalSettingsNavigationController.swift; sourceTree = "<group>"; };
C23889DE2A4EFCE500429673 /* ShareSheetCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareSheetCoordinator.swift; sourceTree = "<group>"; };
C23889E02A4F3E7200429673 /* ParentCoordinatorDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParentCoordinatorDelegate.swift; sourceTree = "<group>"; };
C23889E22A50319A00429673 /* ShareSheetCoordinatorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareSheetCoordinatorTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -12012,37 +12016,37 @@
2F44FC551A9E83E200FD20CC /* Settings */ = {
isa = PBXGroup;
children = (
AAD861A92E9E757D00F6E0E0 /* Translation */,
BCBE04E22E3A52D4004B6039 /* Summarize */,
8D8251721F4DE67E00780643 /* AdvancedAccountSettingViewController.swift */,
BA4BB9962D7F371F006BD137 /* AppearanceSettings */,
ED8B49B72D6CF2AE00743444 /* AppIconSelection */,
2152473D2D6E4A4A0078D78A /* AutoFillPasswordSettingsViewController.swift */,
8ADED55B2D6679B200345293 /* BrowsingSettingsViewController.swift */,
EDADF77B2D70C58200C39295 /* SettingsTelemetry.swift */,
8A15AB742D5FDB80008BB03C /* AutoplaySettingsViewController.swift */,
ED8B49B72D6CF2AE00743444 /* AppIconSelection */,
216A0D772A40E83F008077BA /* ThemeSettings */,
8A3EF7ED2A2FCEC900796E3A /* Main */,
EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */,
8D8251721F4DE67E00780643 /* AdvancedAccountSettingViewController.swift */,
8ADED55B2D6679B200345293 /* BrowsingSettingsViewController.swift */,
0B62EFD11AD63CD100ACB9CD /* Clearables.swift */,
D3E8EEE71B97A87A001900FB /* ClearPrivateDataTableViewController.swift */,
EBB895322193FFF400EB91A0 /* ContentBlockerSettingViewController.swift */,
3B39EDCA1E16E1AA00EF029F /* CustomSearchViewController.swift */,
BCFF93F32AAF9879005B5B71 /* FirefoxSuggestSettingsViewController.swift */,
DFACBF83277B9B36003D5F41 /* HomepageSettings */,
C82F4C2A29AE2DF0005BD116 /* NotificationsSettingsViewController.swift */,
8A3EF7ED2A2FCEC900796E3A /* Main */,
D81E45121F82C56C004EFFBA /* NewTabContentSettingsViewController.swift */,
C82F4C2A29AE2DF0005BD116 /* NotificationsSettingsViewController.swift */,
8AE1E1CE27B191160024C45E /* SearchBar */,
2F44FCCA1A9E972E00FD20CC /* SearchEnginePicker.swift */,
2F44FCC61A9E8CF500FD20CC /* SearchSettingsTableViewController.swift */,
74E36D771B71323500D69DA1 /* SettingsContentViewController.swift */,
D04CD717215EBD85004FF5B0 /* SettingsLoadingView.swift */,
2F44FC711A9E840300FD20CC /* SettingsNavigationController.swift */,
C234BFBF2EBB82E1004BF5A8 /* SettingsNavigationController.swift */,
2F44FCC41A9E85E900FD20CC /* SettingsTableViewController.swift */,
EDADF77B2D70C58200C39295 /* SettingsTelemetry.swift */,
F85C7F0D2711C555004BDBA4 /* SettingsViewController.swift */,
D821E9052141B71C00452C55 /* SiriSettingsViewController.swift */,
BCBE04E22E3A52D4004B6039 /* Summarize */,
CEFA977D1FAA6B490016F365 /* SyncContentSettingsViewController.swift */,
8AE1E1CE27B191160024C45E /* SearchBar */,
C22753422A3CA25100B9C0D1 /* WebsiteDataManagement */,
216A0D772A40E83F008077BA /* ThemeSettings */,
211046CC2A7D842A00A7309F /* TPAccessoryInfo.swift */,
AAD861A92E9E757D00F6E0E0 /* Translation */,
C22753422A3CA25100B9C0D1 /* WebsiteDataManagement */,
);
path = Settings;
sourceTree = "<group>";
Expand Down Expand Up @@ -13896,9 +13900,11 @@
8A36BE2829EDBC6900AC1C5C /* ContentContainer.swift */,
8ACE9BFA2A54A010001E7A73 /* ExpandButtonState.swift */,
43AB6F9E25DC53D20016B015 /* LegacyLabelButtonHeaderView.swift */,
C234BFC12EBB8352004BF5A8 /* ModalSettingsNavigationController.swift */,
8AAC7C442D52C18A0011F87A /* SaveLoginAlert.swift */,
8A0D32832A61E1CC007D976D /* StatusBarOverlay.swift */,
E17496362991A2480096900A /* SwiftUI */,
2F44FC711A9E840300FD20CC /* ThemedNavigationController.swift */,
);
path = Components;
sourceTree = "<group>";
Expand Down Expand Up @@ -18552,7 +18558,7 @@
D3B6923D1B9F9444004B87A4 /* FindInPageBar.swift in Sources */,
8A4B148B2CF919C800FCE2D0 /* UnifiedAdsConverter.swift in Sources */,
1D5CBF492B17E3CB0001D033 /* NotificationPayloads.swift in Sources */,
2F44FC721A9E840300FD20CC /* SettingsNavigationController.swift in Sources */,
2F44FC721A9E840300FD20CC /* ThemedNavigationController.swift in Sources */,
5A96FB5F2D96DAA300917B12 /* TabTraySelectorView.swift in Sources */,
AB9CBC052C53B64C00102610 /* TrackingProtectionState.swift in Sources */,
D0E89A2920910917001CE5C7 /* DownloadsPanel.swift in Sources */,
Expand Down Expand Up @@ -18602,6 +18608,7 @@
43E69EC3254D081D00B591C2 /* SimpleTab.swift in Sources */,
0BDDB33D2CA6B1DA00D501DF /* EditFolderViewController.swift in Sources */,
AB8EE2D32C750E6100BD0A6B /* TrackingProtectionVerifiedByView.swift in Sources */,
C234BFC02EBB8321004BF5A8 /* SettingsNavigationController.swift in Sources */,
8ADAE4202A33A0FD007BF926 /* SendFeedbackSetting.swift in Sources */,
C29B64812AD6959E00F3244B /* QRCodeCoordinator.swift in Sources */,
21A7C45028353D0E0071D996 /* OnboardingBasicCardViewController.swift in Sources */,
Expand Down Expand Up @@ -18862,6 +18869,7 @@
E1CEC2022A28C3F100B177D5 /* LoginDetailCenteredTableViewCell.swift in Sources */,
C2D71B972A384F40003DEC7A /* ThemedSubtitleTableViewCell.swift in Sources */,
2122EE552DDCFD8C00D42716 /* PageZoomSettingsViewModel.swift in Sources */,
C234BFC22EBB8356004BF5A8 /* ModalSettingsNavigationController.swift in Sources */,
BC129A2D2E452082004A6875 /* SummarizeMiddleware.swift in Sources */,
8A83B7462A264FA0002FF9AC /* SettingsCoordinator.swift in Sources */,
619FE8932CE6595B004F83E2 /* WallpaperMiddleware.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class BrowserCoordinator: BaseCoordinator,
return // route is handled with existing child coordinator
}
windowManager.postWindowEvent(event: .settingsOpened, windowUUID: windowUUID)
let navigationController = ThemedNavigationController(windowUUID: windowUUID)
let navigationController = SettingsNavigationController(windowUUID: windowUUID)
let isPad = UIDevice.current.userInterfaceIdiom == .pad
let modalPresentationStyle: UIModalPresentationStyle = isPad ? .fullScreen: .formSheet
navigationController.modalPresentationStyle = modalPresentationStyle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,7 @@ class BrowserViewController: UIViewController,
case .PageZoomSettingsChanged: handlePageZoomSettingsChanged(notification)
case .RemoteTabNotificationTapped: openRecentlyClosedTabs()
case .StopDownloads: onStopDownloads(notification)
case .SettingsDismissed: onSettingsDismissed()
default: break
}
}
Expand All @@ -1135,11 +1136,23 @@ class BrowserViewController: UIViewController,
.PageZoomLevelUpdated,
.PageZoomSettingsChanged,
.RemoteTabNotificationTapped,
.StopDownloads
.StopDownloads,
.SettingsDismissed
]
)
}

private func onSettingsDismissed() {
// FXIOS-13959: Changing address toolbar position from settings prevents content interaction homepage/webpage
// This bug is only happening in iOS 15 + 16
// Trigger a layout refresh to correctly position mask for translucent toolbars
// Remove when support for iOS 15 + 16 is dropped: FXIOS-14024
if #unavailable(iOS 17) {
view.setNeedsLayout()
view.layoutIfNeeded()
}
}

private func onStopDownloads(_ notification: Notification) {
ensureMainThread {
guard let notiWindowUUID = notification.userInfo?["windowUUID"] as? String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 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

class ModalSettingsNavigationController: UINavigationController {
override var preferredStatusBarStyle: UIStatusBarStyle {
return .default
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// 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
import Common

class ThemedNavigationController: DismissableNavigationViewController, Themeable {
var themeManager: ThemeManager
var themeListenerCancellable: Any?
var notificationCenter: NotificationProtocol
let windowUUID: WindowUUID
var currentWindowUUID: UUID? { windowUUID }

init(windowUUID: WindowUUID,
themeManager: ThemeManager = AppContainer.shared.resolve(),
notificationCenter: NotificationProtocol = NotificationCenter.default) {
self.themeManager = themeManager
self.notificationCenter = notificationCenter
self.windowUUID = windowUUID
super.init(nibName: nil, bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

init(rootViewController: UIViewController,
windowUUID: WindowUUID,
themeManager: ThemeManager = AppContainer.shared.resolve(),
notificationCenter: NotificationProtocol = NotificationCenter.default) {
self.windowUUID = windowUUID
self.themeManager = themeManager
self.notificationCenter = notificationCenter
super.init(rootViewController: rootViewController)
}

override var preferredStatusBarStyle: UIStatusBarStyle {
return topViewController?.preferredStatusBarStyle ?? .default
}

override func viewDidLoad() {
super.viewDidLoad()
modalPresentationStyle = .overFullScreen
modalPresentationCapturesStatusBarAppearance = true

listenForThemeChanges(withNotificationCenter: notificationCenter)
applyTheme()
}

private func setupNavigationBarAppearance(theme: Theme) {
let standardAppearance = UINavigationBarAppearance()
standardAppearance.configureWithDefaultBackground()
standardAppearance.backgroundColor = theme.colors.layer1
standardAppearance.titleTextAttributes = [.foregroundColor: theme.colors.textPrimary]

navigationBar.standardAppearance = standardAppearance
navigationBar.compactAppearance = standardAppearance
navigationBar.scrollEdgeAppearance = standardAppearance
navigationBar.compactScrollEdgeAppearance = standardAppearance
navigationBar.tintColor = theme.colors.actionPrimary
}

func applyTheme() {
setupNavigationBarAppearance(theme: themeManager.getCurrentTheme(for: windowUUID))
setNeedsStatusBarAppearanceUpdate()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,72 +3,11 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/

import UIKit
import Common

class ThemedNavigationController: DismissableNavigationViewController, Themeable {
var themeManager: ThemeManager
var themeListenerCancellable: Any?
var notificationCenter: NotificationProtocol
let windowUUID: WindowUUID
var currentWindowUUID: UUID? { windowUUID }
class SettingsNavigationController: ThemedNavigationController {
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)

init(windowUUID: WindowUUID,
themeManager: ThemeManager = AppContainer.shared.resolve(),
notificationCenter: NotificationProtocol = NotificationCenter.default) {
self.themeManager = themeManager
self.notificationCenter = notificationCenter
self.windowUUID = windowUUID
super.init(nibName: nil, bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

init(rootViewController: UIViewController,
windowUUID: WindowUUID,
themeManager: ThemeManager = AppContainer.shared.resolve(),
notificationCenter: NotificationProtocol = NotificationCenter.default) {
self.windowUUID = windowUUID
self.themeManager = themeManager
self.notificationCenter = notificationCenter
super.init(rootViewController: rootViewController)
}

override var preferredStatusBarStyle: UIStatusBarStyle {
return topViewController?.preferredStatusBarStyle ?? .default
}

override func viewDidLoad() {
super.viewDidLoad()
modalPresentationStyle = .overFullScreen
modalPresentationCapturesStatusBarAppearance = true

listenForThemeChanges(withNotificationCenter: notificationCenter)
applyTheme()
}

private func setupNavigationBarAppearance(theme: Theme) {
let standardAppearance = UINavigationBarAppearance()
standardAppearance.configureWithDefaultBackground()
standardAppearance.backgroundColor = theme.colors.layer1
standardAppearance.titleTextAttributes = [.foregroundColor: theme.colors.textPrimary]

navigationBar.standardAppearance = standardAppearance
navigationBar.compactAppearance = standardAppearance
navigationBar.scrollEdgeAppearance = standardAppearance
navigationBar.compactScrollEdgeAppearance = standardAppearance
navigationBar.tintColor = theme.colors.actionPrimary
}

func applyTheme() {
setupNavigationBarAppearance(theme: themeManager.getCurrentTheme(for: windowUUID))
setNeedsStatusBarAppearanceUpdate()
}
}

class ModalSettingsNavigationController: UINavigationController {
override var preferredStatusBarStyle: UIStatusBarStyle {
return .default
NotificationCenter.default.post(name: .SettingsDismissed, object: self)
}
}