Skip to content

Commit 9474931

Browse files
committed
Uplift of #28621 (squashed) to release
1 parent 84b7772 commit 9474931

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed

ios/brave-ios/App/iOS/Delegates/SceneDelegate.swift

+19-3
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,13 @@ extension SceneDelegate {
385385
let urlString = userInfo[CSSearchableItemActivityIdentifier] as? String,
386386
let url = URL(string: urlString)
387387
{
388-
scene.browserViewController?.switchToTabForURLOrOpen(url, isPrivileged: false)
388+
let isPrivateBrowsing =
389+
scene.browserViewController?.privateBrowsingManager.isPrivateBrowsing == true
390+
scene.browserViewController?.switchToTabForURLOrOpen(
391+
url,
392+
isPrivate: isPrivateBrowsing,
393+
isPrivileged: false
394+
)
389395
return
390396
}
391397
case ActivityType.newTab.identifier:
@@ -480,7 +486,13 @@ extension SceneDelegate {
480486
break
481487
}
482488

483-
scene.browserViewController?.switchToTabForURLOrOpen(url, isPrivileged: true)
489+
let isPrivateBrowsing =
490+
scene.browserViewController?.privateBrowsingManager.isPrivateBrowsing == true
491+
scene.browserViewController?.switchToTabForURLOrOpen(
492+
url,
493+
isPrivate: isPrivateBrowsing,
494+
isPrivileged: false
495+
)
484496
return
485497
}
486498
}
@@ -665,7 +677,11 @@ extension SceneDelegate {
665677
if let urlToOpen = urlToOpen {
666678
DispatchQueue.main.async {
667679
browserViewController.loadViewIfNeeded()
668-
browserViewController.switchToTabForURLOrOpen(urlToOpen, isPrivileged: false)
680+
browserViewController.switchToTabForURLOrOpen(
681+
urlToOpen,
682+
isPrivate: isPrivate,
683+
isPrivileged: false
684+
)
669685
}
670686
}
671687

ios/brave-ios/Sources/Brave/Frontend/Browser/BrowserViewController/BrowserViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -2110,7 +2110,7 @@ public class BrowserViewController: UIViewController {
21102110
browser.tabManager.addTabsForURLs([url], zombie: false, isPrivate: isPrivate)
21112111
}
21122112

2113-
public func switchToTabForURLOrOpen(_ url: URL, isPrivate: Bool = false, isPrivileged: Bool) {
2113+
public func switchToTabForURLOrOpen(_ url: URL, isPrivate: Bool, isPrivileged: Bool) {
21142114
popToBVC(isAnimated: false)
21152115

21162116
if let tab = tabManager.getTabForURL(url, isPrivate: isPrivate) {

0 commit comments

Comments
 (0)