Skip to content
Snippets Groups Projects
Verified Commit 74a9682b authored by Arturo Mejia's avatar Arturo Mejia Committed by ma1
Browse files

Bug 1908344 - Improve prompts showing a=dmeehan - BP, tor-browser#43005

parent 88158de9
Branches
Tags tor-browser-128.1.0esr-14.0-1-build3
No related merge requests found
......@@ -544,11 +544,23 @@ class PromptFeature private constructor(
*
* @param session The session which requested the dialog.
*/
@Suppress("NestedBlockDepth")
@VisibleForTesting(otherwise = PRIVATE)
internal fun onPromptRequested(session: SessionState) {
// Some requests are handle with intents
session.content.promptRequests.lastOrNull()?.let { promptRequest ->
if (session.content.permissionRequestsList.isNotEmpty()) {
onCancel(session.id, promptRequest.uid)
} else {
processPromptRequest(promptRequest, session)
}
}
}
@Suppress("NestedBlockDepth")
private fun processPromptRequest(
promptRequest: PromptRequest,
session: SessionState,
) {
store.state.findTabOrCustomTabOrSelectedTab(customTabId)?.let {
promptRequest.executeIfWindowedPrompt { exitFullscreenUsecase(it.id) }
}
......@@ -571,6 +583,7 @@ class PromptFeature private constructor(
if (!isLoginAutofillEnabled()) {
return
}
if (promptRequest.generatedPassword != null && isSuggestStrongPasswordEnabled) {
val currentUrl =
store.state.findTabOrCustomTabOrSelectedTab(customTabId)?.content?.url
......@@ -581,6 +594,7 @@ class PromptFeature private constructor(
onSaveLoginWithStrongPassword,
)
}
strongPasswordPromptViewListener?.handleSuggestStrongPasswordRequest()
} else {
loginPicker?.handleSelectLoginRequest(promptRequest)
}
......@@ -597,7 +611,6 @@ class PromptFeature private constructor(
else -> handleDialogsRequest(promptRequest, session)
}
}
}
/**
* Invoked when a dialog is dismissed. This consumes the [PromptFeature]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment