From d5b76a70b1b4bc5dd94d9f69d3c4944cc3326f61 Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Thu, 10 Aug 2023 13:15:26 -0400 Subject: [PATCH 1/7] Organizing Settings Views Controller --- .../AdblockDebugMenuTableViewController.swift | 0 .../Brave Search/BraveSearchDebugMenu.swift | 0 .../BraveSearchDebugMenuDetail.swift | 0 .../Brave Search/BraveSearchLogEntry.swift | 0 .../BraveCoreDebugSwitchesView.swift | 0 .../{ => Debug}/LocalStateInspectorView.swift | 0 ...onPreferencesDebugMenuViewController.swift | 0 .../RewardsDebugSettingsViewController.swift | 0 ...rdsInternalsAutoContributeController.swift | 0 .../RewardsInternalsDebugViewController.swift | 0 ...sInternalsContributionListController.swift | 0 ...ContributionPublishersListController.swift | 0 .../RewardsInternalsLogController.swift | 0 ...ardsInternalsPromotionListController.swift | 0 .../RewardsInternalsSharable.swift | 0 .../RewardsInternalsShareController.swift | 0 .../RewardsInternalsViewController.swift | 0 .../{ => Debug}/SandboxInspectorView.swift | 0 .../VPNLogsViewController.swift} | 0 .../{ => Display}/MediaSettingsView.swift | 0 .../NTPTableViewController.swift | 0 .../BraveRewardsSettingsViewController.swift | 0 .../PlaylistSettingsViewController.swift | 0 .../AdvancedShieldSettings.swift | 0 .../AdvancedShieldsSettingsView.swift | 0 .../ClearDataSectionView.swift | 0 .../ShieldsPrivacy}/Clearables.swift | 0 .../DefaultShieldsSectionView.swift | 0 .../FilterLists}/FilterListAddURLView.swift | 0 .../FilterLists}/FilterListsView.swift | 0 .../ManageWebsiteDataView.swift | 0 .../OtherPrivacySettingsSectionView.swift | 38 ++++---- .../PrivacyReportSettingsView.swift | 0 .../ShieldsPrivacy}/ShieldLabelView.swift | 0 .../ShieldsPrivacy}/ShieldToggleView.swift | 0 .../SearchCustomEngineViewController.swift | 0 .../SearchEngines}/SearchEnginePicker.swift | 0 .../SearchQuickEnginesViewController.swift | 0 .../SearchSettingsTableViewController.swift | 0 .../ShortcutSettingsViewController.swift | 0 .../WebsiteRedirectsSettingsView.swift | 0 .../PasscodeSettingsViewController.swift | 89 ------------------- .../LocationViewPositionPickerCell.swift | 0 43 files changed, 19 insertions(+), 108 deletions(-) rename Sources/Brave/Frontend/Settings/{ => Debug}/AdblockDebugMenuTableViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Brave Search/BraveSearchDebugMenu.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Brave Search/BraveSearchDebugMenuDetail.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Brave Search/BraveSearchLogEntry.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/BraveCoreDebugSwitchesView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/LocalStateInspectorView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/RetentionPreferencesDebugMenuViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/QA/RewardsDebugSettingsViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/QA/RewardsInternalsAutoContributeController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/QA/RewardsInternalsDebugViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsContributionListController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsContributionPublishersListController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsLogController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsPromotionListController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsSharable.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsShareController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/Rewards Internals/RewardsInternalsViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Debug}/SandboxInspectorView.swift (100%) rename Sources/Brave/Frontend/Settings/{VPNLogs.swift => Debug/VPNLogsViewController.swift} (100%) rename Sources/Brave/Frontend/Settings/{ => Display}/MediaSettingsView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Display}/NTPTableViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features}/BraveRewardsSettingsViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features}/PlaylistSettingsViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/AdvancedShieldSettings.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/AdvancedShieldsSettingsView.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/ClearDataSectionView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features/ShieldsPrivacy}/Clearables.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/DefaultShieldsSectionView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features/ShieldsPrivacy/FilterLists}/FilterListAddURLView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features/ShieldsPrivacy/FilterLists}/FilterListsView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => Features/ShieldsPrivacy}/ManageWebsiteDataView.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/OtherPrivacySettingsSectionView.swift (78%) rename Sources/Brave/Frontend/Settings/{ => Features/ShieldsPrivacy}/PrivacyReportSettingsView.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/ShieldLabelView.swift (100%) rename Sources/Brave/Frontend/Settings/{Shields => Features/ShieldsPrivacy}/ShieldToggleView.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General/SearchEngines}/SearchCustomEngineViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General/SearchEngines}/SearchEnginePicker.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General/SearchEngines}/SearchQuickEnginesViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General/SearchEngines}/SearchSettingsTableViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General}/ShortcutSettingsViewController.swift (100%) rename Sources/Brave/Frontend/Settings/{ => General}/WebsiteRedirectsSettingsView.swift (100%) delete mode 100644 Sources/Brave/Frontend/Settings/PasscodeSettingsViewController.swift rename Sources/Brave/Frontend/Settings/{ => Tabs}/LocationViewPositionPickerCell.swift (100%) diff --git a/Sources/Brave/Frontend/Settings/AdblockDebugMenuTableViewController.swift b/Sources/Brave/Frontend/Settings/Debug/AdblockDebugMenuTableViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/AdblockDebugMenuTableViewController.swift rename to Sources/Brave/Frontend/Settings/Debug/AdblockDebugMenuTableViewController.swift diff --git a/Sources/Brave/Frontend/Settings/Brave Search/BraveSearchDebugMenu.swift b/Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchDebugMenu.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Brave Search/BraveSearchDebugMenu.swift rename to Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchDebugMenu.swift diff --git a/Sources/Brave/Frontend/Settings/Brave Search/BraveSearchDebugMenuDetail.swift b/Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchDebugMenuDetail.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Brave Search/BraveSearchDebugMenuDetail.swift rename to Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchDebugMenuDetail.swift diff --git a/Sources/Brave/Frontend/Settings/Brave Search/BraveSearchLogEntry.swift b/Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchLogEntry.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Brave Search/BraveSearchLogEntry.swift rename to Sources/Brave/Frontend/Settings/Debug/Brave Search/BraveSearchLogEntry.swift diff --git a/Sources/Brave/Frontend/Settings/BraveCoreDebugSwitchesView.swift b/Sources/Brave/Frontend/Settings/Debug/BraveCoreDebugSwitchesView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/BraveCoreDebugSwitchesView.swift rename to Sources/Brave/Frontend/Settings/Debug/BraveCoreDebugSwitchesView.swift diff --git a/Sources/Brave/Frontend/Settings/LocalStateInspectorView.swift b/Sources/Brave/Frontend/Settings/Debug/LocalStateInspectorView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/LocalStateInspectorView.swift rename to Sources/Brave/Frontend/Settings/Debug/LocalStateInspectorView.swift diff --git a/Sources/Brave/Frontend/Settings/RetentionPreferencesDebugMenuViewController.swift b/Sources/Brave/Frontend/Settings/Debug/RetentionPreferencesDebugMenuViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/RetentionPreferencesDebugMenuViewController.swift rename to Sources/Brave/Frontend/Settings/Debug/RetentionPreferencesDebugMenuViewController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsDebugSettingsViewController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsDebugSettingsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsDebugSettingsViewController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsDebugSettingsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsInternalsAutoContributeController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsInternalsAutoContributeController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsInternalsAutoContributeController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsInternalsAutoContributeController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsInternalsDebugViewController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsInternalsDebugViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/QA/RewardsInternalsDebugViewController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/QA/RewardsInternalsDebugViewController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsContributionListController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsContributionListController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsContributionListController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsContributionListController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsContributionPublishersListController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsContributionPublishersListController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsContributionPublishersListController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsContributionPublishersListController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsLogController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsLogController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsLogController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsLogController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsPromotionListController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsPromotionListController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsPromotionListController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsPromotionListController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsSharable.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsSharable.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsSharable.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsSharable.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsShareController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsShareController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsShareController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsShareController.swift diff --git a/Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsViewController.swift b/Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Rewards Internals/RewardsInternalsViewController.swift rename to Sources/Brave/Frontend/Settings/Debug/Rewards Internals/RewardsInternalsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/SandboxInspectorView.swift b/Sources/Brave/Frontend/Settings/Debug/SandboxInspectorView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/SandboxInspectorView.swift rename to Sources/Brave/Frontend/Settings/Debug/SandboxInspectorView.swift diff --git a/Sources/Brave/Frontend/Settings/VPNLogs.swift b/Sources/Brave/Frontend/Settings/Debug/VPNLogsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/VPNLogs.swift rename to Sources/Brave/Frontend/Settings/Debug/VPNLogsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/MediaSettingsView.swift b/Sources/Brave/Frontend/Settings/Display/MediaSettingsView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/MediaSettingsView.swift rename to Sources/Brave/Frontend/Settings/Display/MediaSettingsView.swift diff --git a/Sources/Brave/Frontend/Settings/NTPTableViewController.swift b/Sources/Brave/Frontend/Settings/Display/NTPTableViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/NTPTableViewController.swift rename to Sources/Brave/Frontend/Settings/Display/NTPTableViewController.swift diff --git a/Sources/Brave/Frontend/Settings/BraveRewardsSettingsViewController.swift b/Sources/Brave/Frontend/Settings/Features/BraveRewardsSettingsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/BraveRewardsSettingsViewController.swift rename to Sources/Brave/Frontend/Settings/Features/BraveRewardsSettingsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/PlaylistSettingsViewController.swift b/Sources/Brave/Frontend/Settings/Features/PlaylistSettingsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/PlaylistSettingsViewController.swift rename to Sources/Brave/Frontend/Settings/Features/PlaylistSettingsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/AdvancedShieldSettings.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/AdvancedShieldSettings.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/AdvancedShieldSettings.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/AdvancedShieldSettings.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/AdvancedShieldsSettingsView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/AdvancedShieldsSettingsView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/AdvancedShieldsSettingsView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/AdvancedShieldsSettingsView.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/ClearDataSectionView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ClearDataSectionView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/ClearDataSectionView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ClearDataSectionView.swift diff --git a/Sources/Brave/Frontend/Settings/Clearables.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/Clearables.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Clearables.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/Clearables.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/DefaultShieldsSectionView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/DefaultShieldsSectionView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/DefaultShieldsSectionView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/DefaultShieldsSectionView.swift diff --git a/Sources/Brave/Frontend/Settings/FilterListAddURLView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListAddURLView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/FilterListAddURLView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListAddURLView.swift diff --git a/Sources/Brave/Frontend/Settings/FilterListsView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListsView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/FilterListsView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/FilterLists/FilterListsView.swift diff --git a/Sources/Brave/Frontend/Settings/ManageWebsiteDataView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ManageWebsiteDataView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/ManageWebsiteDataView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ManageWebsiteDataView.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/OtherPrivacySettingsSectionView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift similarity index 78% rename from Sources/Brave/Frontend/Settings/Shields/OtherPrivacySettingsSectionView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift index f214e228fe4..c75a47b6ace 100644 --- a/Sources/Brave/Frontend/Settings/Shields/OtherPrivacySettingsSectionView.swift +++ b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift @@ -54,25 +54,25 @@ struct OtherPrivacySettingsSectionView: View { ) }) - if !Preferences.Privacy.privateBrowsingOnly.value { - OptionToggleView(title: Strings.persistentPrivateBrowsing, - subtitle: nil, - option: Preferences.Privacy.persistentPrivateBrowsing) { newValue in - Task { @MainActor in - if newValue { - settings.tabManager.saveAllTabs() - } else { - let tabs = settings.tabManager.allTabs.filter({ $0.isPrivate }) - SessionTab.deleteAll(tabIds: tabs.map({ $0.id })) - - if !settings.tabManager.privateBrowsingManager.isPrivateBrowsing { - settings.tabManager.willSwitchTabMode(leavingPBM: true) - } - } - } - } - } - +// if !Preferences.Privacy.privateBrowsingOnly.value { +// OptionToggleView(title: Strings.persistentPrivateBrowsing, +// subtitle: nil, +// option: Preferences.Privacy.persistentPrivateBrowsing) { newValue in +// Task { @MainActor in +// if newValue { +// settings.tabManager.saveAllTabs() +// } else { +// let tabs = settings.tabManager.allTabs.filter({ $0.isPrivate }) +// SessionTab.deleteAll(tabIds: tabs.map({ $0.id })) +// +// if !settings.tabManager.privateBrowsingManager.isPrivateBrowsing { +// settings.tabManager.willSwitchTabMode(leavingPBM: true) +// } +// } +// } +// } +// } +// ShieldToggleView( title: Strings.blockMobileAnnoyances, subtitle: nil, diff --git a/Sources/Brave/Frontend/Settings/PrivacyReportSettingsView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/PrivacyReportSettingsView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/PrivacyReportSettingsView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/PrivacyReportSettingsView.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/ShieldLabelView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ShieldLabelView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/ShieldLabelView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ShieldLabelView.swift diff --git a/Sources/Brave/Frontend/Settings/Shields/ShieldToggleView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ShieldToggleView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/Shields/ShieldToggleView.swift rename to Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/ShieldToggleView.swift diff --git a/Sources/Brave/Frontend/Settings/SearchCustomEngineViewController.swift b/Sources/Brave/Frontend/Settings/General/SearchEngines/SearchCustomEngineViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/SearchCustomEngineViewController.swift rename to Sources/Brave/Frontend/Settings/General/SearchEngines/SearchCustomEngineViewController.swift diff --git a/Sources/Brave/Frontend/Settings/SearchEnginePicker.swift b/Sources/Brave/Frontend/Settings/General/SearchEngines/SearchEnginePicker.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/SearchEnginePicker.swift rename to Sources/Brave/Frontend/Settings/General/SearchEngines/SearchEnginePicker.swift diff --git a/Sources/Brave/Frontend/Settings/SearchQuickEnginesViewController.swift b/Sources/Brave/Frontend/Settings/General/SearchEngines/SearchQuickEnginesViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/SearchQuickEnginesViewController.swift rename to Sources/Brave/Frontend/Settings/General/SearchEngines/SearchQuickEnginesViewController.swift diff --git a/Sources/Brave/Frontend/Settings/SearchSettingsTableViewController.swift b/Sources/Brave/Frontend/Settings/General/SearchEngines/SearchSettingsTableViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/SearchSettingsTableViewController.swift rename to Sources/Brave/Frontend/Settings/General/SearchEngines/SearchSettingsTableViewController.swift diff --git a/Sources/Brave/Frontend/Settings/ShortcutSettingsViewController.swift b/Sources/Brave/Frontend/Settings/General/ShortcutSettingsViewController.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/ShortcutSettingsViewController.swift rename to Sources/Brave/Frontend/Settings/General/ShortcutSettingsViewController.swift diff --git a/Sources/Brave/Frontend/Settings/WebsiteRedirectsSettingsView.swift b/Sources/Brave/Frontend/Settings/General/WebsiteRedirectsSettingsView.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/WebsiteRedirectsSettingsView.swift rename to Sources/Brave/Frontend/Settings/General/WebsiteRedirectsSettingsView.swift diff --git a/Sources/Brave/Frontend/Settings/PasscodeSettingsViewController.swift b/Sources/Brave/Frontend/Settings/PasscodeSettingsViewController.swift deleted file mode 100644 index 381a1270561..00000000000 --- a/Sources/Brave/Frontend/Settings/PasscodeSettingsViewController.swift +++ /dev/null @@ -1,89 +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 -import LocalAuthentication -import Static -import SwiftKeychainWrapper -import Shared -import BraveUI -import Preferences -import UIKit - -class PasscodeSettingsViewController: TableViewController { - - init() { - super.init(style: .grouped) - } - - @available(*, unavailable) - required init?(coder aDecoder: NSCoder) { - fatalError() - } - - override func viewDidLoad() { - super.viewDidLoad() - - navigationItem.title = titleForTouchIDState - - tableView.accessibilityIdentifier = "PasscodeSettingsViewController.tableView" - tableView.separatorColor = .braveSeparator - tableView.backgroundColor = .braveGroupedBackground - } - - override func viewWillAppear(_ animated: Bool) { - reloadSections() - } - - func reloadSections() { - dataSource.sections = [ - .init( - rows: [.boolRow(title: titleForTouchIDState, option: Preferences.Privacy.lockWithPasscode)] - ) - ] - } - - private var deviceBiometryType: LABiometryType { - let context = LAContext() - if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) { - return context.biometryType - } - return .none - } - - var titleForTouchIDState: String { - switch deviceBiometryType { - case .faceID: - return Strings.authenticationFaceIDPasscodeSetting - case .touchID: - return Strings.authenticationTouchIDPasscodeSetting - case .none: - return Strings.authenticationPasscode - @unknown default: - return Strings.authenticationPasscode - } - } -} - -class DisabledCell: Value1Cell { - override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) { - super.init(style: style, reuseIdentifier: reuseIdentifier) - - selectionStyle = .none - textLabel?.textColor = .lightGray - } - - override var accessoryView: UIView? { - didSet { - if let control = accessoryView as? UIControl { - control.isEnabled = false - } - } - } - - @available(*, unavailable) - required init?(coder aDecoder: NSCoder) { - fatalError() - } -} diff --git a/Sources/Brave/Frontend/Settings/LocationViewPositionPickerCell.swift b/Sources/Brave/Frontend/Settings/Tabs/LocationViewPositionPickerCell.swift similarity index 100% rename from Sources/Brave/Frontend/Settings/LocationViewPositionPickerCell.swift rename to Sources/Brave/Frontend/Settings/Tabs/LocationViewPositionPickerCell.swift From cca4df2404555206486d64c35b33274c1f254341 Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Thu, 10 Aug 2023 16:16:58 -0400 Subject: [PATCH 2/7] Adding Tabs Bar Private Mode Screen --- .../Settings/SettingsViewController.swift | 20 +++++-- .../Settings/Shields/OptionToggleView.swift | 2 +- .../Settings/Tabs/PrivateTabsView.swift | 56 +++++++++++++++++++ Sources/BraveStrings/BraveStrings.swift | 35 ++++++++---- 4 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift diff --git a/Sources/Brave/Frontend/Settings/SettingsViewController.swift b/Sources/Brave/Frontend/Settings/SettingsViewController.swift index c8aeb242363..f22291d32b4 100644 --- a/Sources/Brave/Frontend/Settings/SettingsViewController.swift +++ b/Sources/Brave/Frontend/Settings/SettingsViewController.swift @@ -449,6 +449,19 @@ class SettingsViewController: TableViewController { } tabs.rows.append(autoCloseTabsRow) + + if !Preferences.Privacy.privateBrowsingOnly.value { + let privateTabsRow = Row( + text: Strings.TabsSettings.privateTabsSettingsTitle, + selection: { [unowned self] in + let vc = UIHostingController(rootView: PrivateTabsView(tabManager: tabManager)) + self.navigationController?.pushViewController(vc, animated: true) + }, + image: UIImage(braveSystemNamed: "leo.product.private-window"), + accessory: .disclosureIndicator) + + tabs.rows.append(privateTabsRow) + } return tabs }() @@ -594,11 +607,6 @@ class SettingsViewController: TableViewController { detailText: Strings.Privacy.browserLockDescription, option: Preferences.Privacy.lockWithPasscode, image: UIImage(braveSystemNamed: "leo.biometric.login")), - .boolRow( - title: Strings.Privacy.privateBrowsingLock, - detailText: Strings.Privacy.privateBrowsingLockDescription, - option: Preferences.Privacy.privateBrowsingLock, - image: UIImage(braveSystemNamed: "leo.lock")), Row( text: Strings.Login.loginListNavigationTitle, selection: { [unowned self] in @@ -607,7 +615,7 @@ class SettingsViewController: TableViewController { windowProtection: self.windowProtection) loginsPasswordsViewController.settingsDelegate = self.settingsDelegate self.navigationController?.pushViewController(loginsPasswordsViewController, animated: true) - }, image: UIImage(braveSystemNamed: "leo.outside"), accessory: .disclosureIndicator), + }, image: UIImage(braveSystemNamed: "leo.outside"), accessory: .disclosureIndicator) ] ) }() diff --git a/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift b/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift index 61baedeb87c..4a18d6612b8 100644 --- a/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift +++ b/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift @@ -13,7 +13,7 @@ struct OptionToggleView: View { @ObservedObject var option: Preferences.Option let onChange: ShieldToggleView.OnChangeCallback? - init(title: String, subtitle: String?, + init(title: String, subtitle: String? = nil, option: Preferences.Option, onChange: ShieldToggleView.OnChangeCallback? = nil) { self.title = title self.subtitle = subtitle diff --git a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift new file mode 100644 index 00000000000..177b49378c8 --- /dev/null +++ b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift @@ -0,0 +1,56 @@ +// Copyright 2023 The Brave Authors. All rights reserved. +// 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 SwiftUI +import BraveStrings +import Preferences +import BraveUI +import Data + +struct PrivateTabsView: View { + @ObservedObject var privateBrowsingOnly = Preferences.Privacy.privateBrowsingOnly + var tabManager: TabManager? + + var body: some View { + Form { + Section( + header: Text(Strings.TabsSettings.privateTabsSettingsTitle.uppercased()), + footer: privateBrowsingOnly.value ? Text("") : Text(Strings.TabsSettings.persistentPrivateBrowsingDescription)) { + if !privateBrowsingOnly.value { + OptionToggleView(title: Strings.TabsSettings.persistentPrivateBrowsingTitle, + option: Preferences.Privacy.persistentPrivateBrowsing) { newValue in + Task { @MainActor in + if newValue { + tabManager?.saveAllTabs() + } else { + if let tabs = tabManager?.allTabs.filter({ $0.isPrivate }) { + SessionTab.deleteAll(tabIds: tabs.map({ $0.id })) + } + + if tabManager?.privateBrowsingManager.isPrivateBrowsing == true { + tabManager?.willSwitchTabMode(leavingPBM: true) + } + } + } + } + } + OptionToggleView(title: Strings.TabsSettings.privateBrowsingLockTitle, + option: Preferences.Privacy.privateBrowsingLock) + } + .listRowBackground(Color(.secondaryBraveGroupedBackground)) + } + .navigationBarTitle(Strings.TabsSettings.privateTabsSettingsTitle) + .navigationBarTitleDisplayMode(.inline) + .listBackgroundColor(Color(UIColor.braveGroupedBackground)) + } +} + +#if DEBUG +struct PrivateTabsView_Previews: PreviewProvider { + static var previews: some View { + PrivateTabsView() + } +} +#endif diff --git a/Sources/BraveStrings/BraveStrings.swift b/Sources/BraveStrings/BraveStrings.swift index fd3ee904328..d18ab80e3c4 100644 --- a/Sources/BraveStrings/BraveStrings.swift +++ b/Sources/BraveStrings/BraveStrings.swift @@ -3340,16 +3340,6 @@ extension Strings { "BrowserLockDescription", tableName: "BraveShared", bundle: .module, value: "Unlock Brave with Touch ID, Face ID or system passcode.", comment: "Description for setting to enable the browser lock privacy feature") - public static let privateBrowsingLock = - NSLocalizedString( - "privacy.private.browsing.lock.title", tableName: "BraveShared", bundle: .module, - value: "Private Browsing Lock", - comment: "Title for setting to enable the private browsing lock privacy feature") - public static let privateBrowsingLockDescription = - NSLocalizedString( - "privacy.private.browsing.lock.description", tableName: "BraveShared", bundle: .module, - value: "Require Passcode to Unlock Private Browsing", - comment: "Description for setting to enable the browser lock privacy feature") public static let tabTraySetPasscodeAlertDescription = NSLocalizedString( "privacy.tab.tray.passcode.alert", @@ -3360,6 +3350,31 @@ extension Strings { } } +extension Strings { + public struct TabsSettings { + public static let privateTabsSettingsTitle = + NSLocalizedString( + "tabs.settings.privateTabsSettingsTitle", tableName: "BraveShared", bundle: .module, + value: "Private Tabs", + comment: "") + public static let privateBrowsingLockTitle = + NSLocalizedString( + "tabs.settings.privateBrowsingLock", tableName: "BraveShared", bundle: .module, + value: "Require Face ID", + comment: "") + public static let persistentPrivateBrowsingTitle = + NSLocalizedString( + "tabs.settings.persistentPrivateBrowsingTitle", tableName: "BraveShared", bundle: .module, + value: "Keep Private Tabs", + comment: "") + public static let persistentPrivateBrowsingDescription = + NSLocalizedString( + "tabs.settings.persistentPrivateBrowsingTitle", tableName: "BraveShared", bundle: .module, + value: "Keep private browsing tabs open when you close the app, ensuring private browsing sessions continue seamlessly.", + comment: "") + } +} + extension Strings { public struct Login { public static let loginListEmptyScreenTitle = From 528f80ec6b820504c6d794ebe4ce7578f0b4892a Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Thu, 10 Aug 2023 16:43:26 -0400 Subject: [PATCH 3/7] Removing old private lock section --- .../OtherPrivacySettingsSectionView.swift | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift index c75a47b6ace..97c98aa393d 100644 --- a/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift +++ b/Sources/Brave/Frontend/Settings/Features/ShieldsPrivacy/OtherPrivacySettingsSectionView.swift @@ -53,26 +53,6 @@ struct OtherPrivacySettingsSectionView: View { }) ) }) - -// if !Preferences.Privacy.privateBrowsingOnly.value { -// OptionToggleView(title: Strings.persistentPrivateBrowsing, -// subtitle: nil, -// option: Preferences.Privacy.persistentPrivateBrowsing) { newValue in -// Task { @MainActor in -// if newValue { -// settings.tabManager.saveAllTabs() -// } else { -// let tabs = settings.tabManager.allTabs.filter({ $0.isPrivate }) -// SessionTab.deleteAll(tabIds: tabs.map({ $0.id })) -// -// if !settings.tabManager.privateBrowsingManager.isPrivateBrowsing { -// settings.tabManager.willSwitchTabMode(leavingPBM: true) -// } -// } -// } -// } -// } -// ShieldToggleView( title: Strings.blockMobileAnnoyances, subtitle: nil, From e7449b5fa0c3a7efdcb14f67490d07ae6f75ffb2 Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Fri, 11 Aug 2023 15:32:31 -0400 Subject: [PATCH 4/7] Adding additional dynamic biometric content check --- .../Tabs/TabTray/TabTrayController.swift | 8 ++- .../Settings/Tabs/PrivateTabsView.swift | 65 ++++++++++++++++++- .../Widgets/LoadingViewController.swift | 8 ++- Sources/BraveStrings/BraveStrings.swift | 14 +++- 4 files changed, 88 insertions(+), 7 deletions(-) diff --git a/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift b/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift index b9260ff9178..6da43ac6996 100644 --- a/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift +++ b/Sources/Brave/Frontend/Browser/Tabs/TabTray/TabTrayController.swift @@ -12,6 +12,7 @@ import Combine import Data import SnapKit import BraveUI +import LocalAuthentication protocol TabTrayDelegate: AnyObject { /// Notifies the delegate that order of tabs on tab tray has changed. @@ -600,7 +601,12 @@ class TabTrayController: AuthenticationController { @objc func togglePrivateModeAction() { if !privateMode, Preferences.Privacy.privateBrowsingLock.value { - askForAuthentication(viewType: .tabTray) + askForAuthentication(viewType: .tabTray) { [weak self] success, error in + if !success, error == LAError.passcodeNotSet { + // If Pin code is not set in this device, private mode is enabled default + self?.toggleModeChanger() + } + } } else { toggleModeChanger() } diff --git a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift index 177b49378c8..1692533f31b 100644 --- a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift +++ b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift @@ -8,10 +8,56 @@ import BraveStrings import Preferences import BraveUI import Data +import LocalAuthentication struct PrivateTabsView: View { + enum AuthenticationType { + case faceID, touchID, pinCode, noAuthentication + } + @ObservedObject var privateBrowsingOnly = Preferences.Privacy.privateBrowsingOnly var tabManager: TabManager? + + private var localAuthenticationType: AuthenticationType { + let context = LAContext() + + if context.canEvaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, error: nil) { + switch context.biometryType { + case .faceID: + return .faceID + case .touchID: + return .touchID + default: + var error: NSError? + let policyEvaluation = context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) + + if policyEvaluation { + return .pinCode + } else { + if (error as? LAError)?.code == .passcodeNotSet { + return .noAuthentication + } + } + } + } + + return .noAuthentication + } + + private var browsingLockTitle: String { + var title: String + + switch localAuthenticationType { + case .faceID: + title = Strings.TabsSettings.privateBrowsingLockTitleFaceID + case .touchID: + title = Strings.TabsSettings.privateBrowsingLockTitleTouchID + default: + title = Strings.TabsSettings.privateBrowsingLockTitlePinCode + } + + return title + } var body: some View { Form { @@ -36,8 +82,23 @@ struct PrivateTabsView: View { } } } - OptionToggleView(title: Strings.TabsSettings.privateBrowsingLockTitle, - option: Preferences.Privacy.privateBrowsingLock) + + switch localAuthenticationType { + case .faceID, .touchID, .pinCode: + OptionToggleView(title: browsingLockTitle, + option: Preferences.Privacy.privateBrowsingLock) + case .noAuthentication: + Toggle(isOn: .constant(false)) { + VStack(alignment: .leading, spacing: 4) { + Text(browsingLockTitle) + .foregroundColor(Color(.bravePrimary)) + } + .opacity(0.25) + } + .disabled(true) + .listRowBackground(Color(.secondaryBraveGroupedBackground)) + .toggleStyle(SwitchToggleStyle(tint: .accentColor)) + } } .listRowBackground(Color(.secondaryBraveGroupedBackground)) } diff --git a/Sources/Brave/Frontend/Widgets/LoadingViewController.swift b/Sources/Brave/Frontend/Widgets/LoadingViewController.swift index a49e6a3860c..4e5f8012bcb 100644 --- a/Sources/Brave/Frontend/Widgets/LoadingViewController.swift +++ b/Sources/Brave/Frontend/Widgets/LoadingViewController.swift @@ -70,8 +70,12 @@ public class AuthenticationController: LoadingViewController { } if !windowProtection.isPassCodeAvailable { - showSetPasscodeError(viewType: viewType) { + if viewType == .tabTray { completion?(false, LAError.passcodeNotSet) + } else { + showSetPasscodeError(viewType: viewType) { + completion?(false, LAError.passcodeNotSet) + } } } else { windowProtection.presentAuthenticationForViewController( @@ -91,7 +95,7 @@ public class AuthenticationController: LoadingViewController { alert.addAction( UIAlertAction(title: Strings.OKString, style: .default, handler: { _ in - completion() + completion() }) ) diff --git a/Sources/BraveStrings/BraveStrings.swift b/Sources/BraveStrings/BraveStrings.swift index d18ab80e3c4..40fd463bcd5 100644 --- a/Sources/BraveStrings/BraveStrings.swift +++ b/Sources/BraveStrings/BraveStrings.swift @@ -3357,11 +3357,21 @@ extension Strings { "tabs.settings.privateTabsSettingsTitle", tableName: "BraveShared", bundle: .module, value: "Private Tabs", comment: "") - public static let privateBrowsingLockTitle = + public static let privateBrowsingLockTitleFaceID = NSLocalizedString( - "tabs.settings.privateBrowsingLock", tableName: "BraveShared", bundle: .module, + "tabs.settings.privateBrowsingLockTitleFaceID", tableName: "BraveShared", bundle: .module, value: "Require Face ID", comment: "") + public static let privateBrowsingLockTitleTouchID = + NSLocalizedString( + "tabs.settings.privateBrowsingLockTitleTouchID", tableName: "BraveShared", bundle: .module, + value: "Require Touch ID", + comment: "") + public static let privateBrowsingLockTitlePinCode = + NSLocalizedString( + "tabs.settings.privateBrowsingLockTitlePinCode", tableName: "BraveShared", bundle: .module, + value: "Require Pin Code", + comment: "") public static let persistentPrivateBrowsingTitle = NSLocalizedString( "tabs.settings.persistentPrivateBrowsingTitle", tableName: "BraveShared", bundle: .module, From 7feeff1508ff53e7b76e6817c06da404ff295e0d Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Mon, 14 Aug 2023 12:07:17 -0400 Subject: [PATCH 5/7] Fixing auth type process in settings --- .../Settings/Tabs/PrivateTabsView.swift | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift index 1692533f31b..895a005be9a 100644 --- a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift +++ b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift @@ -28,16 +28,18 @@ struct PrivateTabsView: View { case .touchID: return .touchID default: - var error: NSError? - let policyEvaluation = context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) - - if policyEvaluation { - return .pinCode - } else { - if (error as? LAError)?.code == .passcodeNotSet { - return .noAuthentication - } - } + return .noAuthentication + } + } + + var error: NSError? + let policyEvaluation = context.canEvaluatePolicy(.deviceOwnerAuthentication, error: &error) + + if policyEvaluation { + return .pinCode + } else { + if (error as? LAError)?.code == .passcodeNotSet { + return .noAuthentication } } From 1cc9050f4978ebade8cdc8f10f2eb6ba81754e3c Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Tue, 15 Aug 2023 14:37:30 -0400 Subject: [PATCH 6/7] Pull Request comments are addressed --- Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift | 2 +- Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift b/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift index 4a18d6612b8..61baedeb87c 100644 --- a/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift +++ b/Sources/Brave/Frontend/Settings/Shields/OptionToggleView.swift @@ -13,7 +13,7 @@ struct OptionToggleView: View { @ObservedObject var option: Preferences.Option let onChange: ShieldToggleView.OnChangeCallback? - init(title: String, subtitle: String? = nil, + init(title: String, subtitle: String?, option: Preferences.Option, onChange: ShieldToggleView.OnChangeCallback? = nil) { self.title = title self.subtitle = subtitle diff --git a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift index 895a005be9a..06dabc83fd0 100644 --- a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift +++ b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift @@ -68,6 +68,7 @@ struct PrivateTabsView: View { footer: privateBrowsingOnly.value ? Text("") : Text(Strings.TabsSettings.persistentPrivateBrowsingDescription)) { if !privateBrowsingOnly.value { OptionToggleView(title: Strings.TabsSettings.persistentPrivateBrowsingTitle, + subtitle: nil, option: Preferences.Privacy.persistentPrivateBrowsing) { newValue in Task { @MainActor in if newValue { @@ -88,6 +89,7 @@ struct PrivateTabsView: View { switch localAuthenticationType { case .faceID, .touchID, .pinCode: OptionToggleView(title: browsingLockTitle, + subtitle: nil, option: Preferences.Privacy.privateBrowsingLock) case .noAuthentication: Toggle(isOn: .constant(false)) { From 9ce700bd934ab34898d08e1b5425528a76b01361 Mon Sep 17 00:00:00 2001 From: Soner Yuksel Date: Tue, 15 Aug 2023 15:25:30 -0400 Subject: [PATCH 7/7] Minor change with causes of no authentication styles --- Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift index 06dabc83fd0..44d0c0d5ff7 100644 --- a/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift +++ b/Sources/Brave/Frontend/Settings/Tabs/PrivateTabsView.swift @@ -37,10 +37,6 @@ struct PrivateTabsView: View { if policyEvaluation { return .pinCode - } else { - if (error as? LAError)?.code == .passcodeNotSet { - return .noAuthentication - } } return .noAuthentication