-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Protect private tabs with biometric authentication via tab tray #32411
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5fe8c68
0e381b9
a3fcfde
44f7609
9bd0e79
3eccf3d
ca69c3b
98adb6b
4c7b7b0
12261ab
5908abe
f8d4e71
ed9a933
7c92ad3
e447743
cd8cab7
0b0e6f9
c326d3a
426916c
907be36
a5bdd56
925f807
c2b128d
2415333
4e539ab
8d972e9
2607bbb
74ec4d9
8d1cfa9
ab1c6a2
119801e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| APP_VERSION = 149.2 | ||
| APP_VERSION = 149.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -498,7 +498,9 @@ final class BrowserCoordinator: BaseCoordinator, | |
| } | ||
|
|
||
| func didFinishSettings(from coordinator: SettingsCoordinator) { | ||
| router.dismiss(animated: true, completion: nil) | ||
| router.dismiss(animated: true, completion: { [weak browserViewController] in | ||
| browserViewController?.settingsControllerDidHide() | ||
| }) | ||
| remove(child: coordinator) | ||
| } | ||
|
|
||
|
|
@@ -944,7 +946,7 @@ final class BrowserCoordinator: BaseCoordinator, | |
| coordinator.showQRCode(delegate: delegate) | ||
| } | ||
|
|
||
| func showTabTray(selectedPanel: TabTrayPanelType) { | ||
| func showTabTray(selectedPanel: TabTrayPanelType, animated: Bool) { | ||
| guard !childCoordinators.contains(where: { $0 is TabTrayCoordinator }) else { | ||
| return // flow is already handled | ||
| } | ||
|
|
@@ -983,9 +985,12 @@ final class BrowserCoordinator: BaseCoordinator, | |
| if featureFlags.isFeatureEnabled(.tabTrayUIExperiments, checking: .buildOnly) && | ||
| UIDevice.current.userInterfaceIdiom != .pad && selectedPanel != .syncedTabs { | ||
| guard let tabTrayVC = tabTrayCoordinator.tabTrayViewController else { return } | ||
| present(navigationController, customTransition: tabTrayVC, style: modalPresentationStyle) | ||
| present(navigationController, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a case where
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. showPrivacyOverlayIfNeeded in bvc calls with animated false on appDidEnterBackgroundNotification event |
||
| customTransition: tabTrayVC, | ||
| style: modalPresentationStyle, | ||
| animated: animated) | ||
| } else { | ||
| present(navigationController) | ||
| present(navigationController, animated: animated) | ||
| } | ||
| guard browserViewController.isAppStoreReviewTriggerEnabled else { return } | ||
| browserViewController.ratingPromptManager.showRatingPromptIfNeeded() | ||
|
|
@@ -994,12 +999,13 @@ final class BrowserCoordinator: BaseCoordinator, | |
| // This implementation of present is specifically for the animation on .tabTrayUIExperiments | ||
| private func present(_ viewController: UIViewController, | ||
| customTransition: UIViewControllerTransitioningDelegate, | ||
| style: UIModalPresentationStyle) { | ||
| style: UIModalPresentationStyle, | ||
| animated: Bool = true) { | ||
| browserViewController.willNavigateAway(from: tabManager.selectedTab) | ||
| if !UIAccessibility.isReduceMotionEnabled { | ||
| router.present( | ||
| viewController, | ||
| animated: true, | ||
| animated: animated, | ||
| customTransition: customTransition, | ||
| presentationStyle: style | ||
| ) | ||
|
|
@@ -1008,9 +1014,9 @@ final class BrowserCoordinator: BaseCoordinator, | |
| } | ||
| } | ||
|
|
||
| private func present(_ viewController: UIViewController) { | ||
| private func present(_ viewController: UIViewController, animated: Bool = true) { | ||
| browserViewController.willNavigateAway(from: tabManager.selectedTab) | ||
| router.present(viewController) | ||
| router.present(viewController, animated: animated) | ||
| } | ||
|
|
||
| func showBackForwardList() { | ||
|
|
@@ -1253,6 +1259,15 @@ final class BrowserCoordinator: BaseCoordinator, | |
| // [FXIOS-10482] Initial bandaid for memory leaking during tab tray open/close. Needs further investigation. | ||
| coordinator.dismissChildTabTrayPanels() | ||
| remove(child: coordinator) | ||
| let panel = TabTrayPanelType.convert(from: tabManager.selectedTab) | ||
| store.dispatch( | ||
| PrivateLockAction( | ||
| windowUUID: windowUUID, | ||
| actionType: PrivateLockActionType.didChangeTrayPresentation, | ||
| trayDisplayContext: .page, | ||
| trayPanelType: panel | ||
| ) | ||
| ) | ||
|
Comment on lines
+1263
to
+1270
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is not clear to me from the naming what the action is actually doing here. Is there a more intuitive name we could use? Here are the action naming conventions if helpful! https://github.com/mozilla-mobile/firefox-ios/wiki/Redux-Guidelines---FAQs#tips
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point, fixed |
||
| } | ||
|
|
||
| // MARK: - WindowEventCoordinator | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| // 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 Common | ||
| import Redux | ||
|
|
||
| enum PrivateLockActionType: ActionType { | ||
| case privateAuthRequested(String) | ||
| case didChangeTrayDisplayContext | ||
| case didChangeTrayPresentation | ||
| case didEnterBackground | ||
| case willEnterForeground | ||
| case didChangePrivateTabsLockSetting | ||
| } | ||
|
|
||
| struct PrivateLockAction: Action { | ||
| let windowUUID: WindowUUID | ||
| let actionType: ActionType | ||
| let trayDisplayContext: BrowserViewControllerState.TrayDisplayContext? | ||
| let trayPanelType: TabTrayPanelType? | ||
|
|
||
| init(windowUUID: WindowUUID, | ||
| actionType: ActionType, | ||
| trayDisplayContext: BrowserViewControllerState.TrayDisplayContext? = nil, | ||
| trayPanelType: TabTrayPanelType? = nil) { | ||
| self.windowUUID = windowUUID | ||
| self.actionType = actionType | ||
| self.trayDisplayContext = trayDisplayContext | ||
| self.trayPanelType = trayPanelType | ||
| } | ||
| } | ||
|
|
||
| enum PrivateLockMiddlewareActionType: ActionType { | ||
| case didChangePrivateLockState | ||
| case didChangeTabTrayPanelType | ||
| case didChangeTrayDisplayContext | ||
| } | ||
|
|
||
| struct PrivateLockMiddlewareAction: Action { | ||
| let windowUUID: WindowUUID | ||
| let actionType: ActionType | ||
| let privateLockState: PrivateLockDomainState? | ||
| let trayPanelType: TabTrayPanelType? | ||
| let trayDisplayContext: BrowserViewControllerState.TrayDisplayContext? | ||
| let privateLockEnabled: Bool? | ||
|
|
||
| init(windowUUID: WindowUUID, | ||
| actionType: ActionType, | ||
| privatePanelLockState: PrivateLockDomainState? = nil, | ||
| trayPanelType: TabTrayPanelType? = nil, | ||
| trayDisplayContext: BrowserViewControllerState.TrayDisplayContext? = nil, | ||
| privateLockEnabled: Bool? = nil) { | ||
| self.windowUUID = windowUUID | ||
| self.actionType = actionType | ||
| self.privateLockState = privatePanelLockState | ||
| self.trayPanelType = trayPanelType | ||
| self.trayDisplayContext = trayDisplayContext | ||
| self.privateLockEnabled = privateLockEnabled | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this change needed for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a hook to check actual state on possible settings change in order to show tray and lock on it