@@ -3239,10 +3239,6 @@ class BrowserViewController: UIViewController,
3239
3239
view. backgroundColor = toolbarLayoutStyle == . baseline ? theme. colors. layer1 : theme. colors. layer3
3240
3240
}
3241
3241
3242
- var isPreferSwitchToOpenTabOverDuplicateFeatureEnabled : Bool {
3243
- featureFlags. isFeatureEnabled ( . preferSwitchToOpenTabOverDuplicate, checking: . buildOnly)
3244
- }
3245
-
3246
3242
// MARK: - Telemetry
3247
3243
3248
3244
private func logTelemetryForAppDidEnterBackground( ) {
@@ -3266,20 +3262,12 @@ class BrowserViewController: UIViewController,
3266
3262
func libraryPanel( didSelectURL url: URL , visitType: VisitType ) {
3267
3263
guard let tab = tabManager. selectedTab else { return }
3268
3264
3269
- if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
3270
- let tab = tabManager. tabs. reversed ( ) . first ( where: {
3271
- // URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
3272
- ( $0. url == url || $0. url == url. safeEncodedUrl) && $0. isPrivate == tab. isPrivate
3273
- } ) {
3274
- tabManager. selectTab ( tab)
3275
- } else {
3276
- // Handle keyboard shortcuts from homepage with url selection
3277
- // (ex: Cmd + Tap on Link; which is a cell in this case)
3278
- if navigateLinkShortcutIfNeeded ( url: url) {
3279
- return
3280
- }
3281
- finishEditingAndSubmit ( url, visitType: visitType, forTab: tab)
3265
+ // Handle keyboard shortcuts from homepage with url selection
3266
+ // (ex: Cmd + Tap on Link; which is a cell in this case)
3267
+ if navigateLinkShortcutIfNeeded ( url: url) {
3268
+ return
3282
3269
}
3270
+ finishEditingAndSubmit ( url, visitType: visitType, forTab: tab)
3283
3271
}
3284
3272
3285
3273
func libraryPanelDidRequestToOpenInNewTab( _ url: URL , isPrivate: Bool ) {
@@ -3733,26 +3721,18 @@ extension BrowserViewController: HomePanelDelegate {
3733
3721
func homePanel( didSelectURL url: URL , visitType: VisitType , isGoogleTopSite: Bool ) {
3734
3722
guard let tab = tabManager. selectedTab else { return }
3735
3723
3736
- if isPreferSwitchToOpenTabOverDuplicateFeatureEnabled,
3737
- let tab = tabManager. tabs. reversed ( ) . first ( where: {
3738
- // URL for reading mode comes encoded and we need a separate case to check if it's equal with the tab url
3739
- ( $0. url == url || $0. url == url. safeEncodedUrl) && $0. isPrivate == tab. isPrivate
3740
- } ) {
3741
- tabManager. selectTab ( tab)
3742
- } else {
3743
- if isGoogleTopSite {
3744
- tab. urlType = . googleTopSite
3745
- searchTelemetry. shouldSetGoogleTopSiteSearch = true
3746
- }
3747
-
3748
- // Handle keyboard shortcuts from homepage with url selection
3749
- // (ex: Cmd + Tap on Link; which is a cell in this case)
3750
- if navigateLinkShortcutIfNeeded ( url: url) {
3751
- return
3752
- }
3724
+ if isGoogleTopSite {
3725
+ tab. urlType = . googleTopSite
3726
+ searchTelemetry. shouldSetGoogleTopSiteSearch = true
3727
+ }
3753
3728
3754
- finishEditingAndSubmit ( url, visitType: visitType, forTab: tab)
3729
+ // Handle keyboard shortcuts from homepage with url selection
3730
+ // (ex: Cmd + Tap on Link; which is a cell in this case)
3731
+ if navigateLinkShortcutIfNeeded ( url: url) {
3732
+ return
3755
3733
}
3734
+
3735
+ finishEditingAndSubmit ( url, visitType: visitType, forTab: tab)
3756
3736
}
3757
3737
3758
3738
func homePanelDidRequestToOpenInNewTab( _ url: URL , isPrivate: Bool , selectNewTab: Bool = false ) {
0 commit comments