Bug 1921962 - remove unused ConfirmDialogIfNeeded method from nsGlobalWindowOuter, r=dom-core,farre

Differential Revision: https://phabricator.services.mozilla.com/D224215
This commit is contained in:
Gijs Kruitbosch 2024-10-09 16:54:39 +00:00
parent 13e44b4aa0
commit a63314a05d
3 changed files with 0 additions and 35 deletions

View File

@ -2839,35 +2839,6 @@ bool nsGlobalWindowOuter::AreDialogsEnabled() {
return group->GetAreDialogsEnabled();
}
bool nsGlobalWindowOuter::ConfirmDialogIfNeeded() {
NS_ENSURE_TRUE(mDocShell, false);
nsCOMPtr<nsIPromptService> promptSvc =
do_GetService("@mozilla.org/prompter;1");
if (!promptSvc) {
return true;
}
// Reset popup state while opening a modal dialog, and firing events
// about the dialog, to prevent the current state from being active
// the whole time a modal dialog is open.
AutoPopupStatePusher popupStatePusher(PopupBlocker::openAbused, true);
bool disableDialog = false;
nsAutoString label, title;
nsContentUtils::GetLocalizedString(nsContentUtils::eCOMMON_DIALOG_PROPERTIES,
"ScriptDialogLabel", label);
nsContentUtils::GetLocalizedString(nsContentUtils::eCOMMON_DIALOG_PROPERTIES,
"ScriptDialogPreventTitle", title);
promptSvc->Confirm(this, title.get(), label.get(), &disableDialog);
if (disableDialog) {
DisableDialogs();
return false;
}
return true;
}
void nsGlobalWindowOuter::DisableDialogs() {
BrowsingContextGroup* group = mBrowsingContext->Group();
if (!group) {

View File

@ -939,11 +939,6 @@ class nsGlobalWindowOuter final : public mozilla::dom::EventTarget,
mozilla::Maybe<nsID>* aCallerAgentClusterId, nsACString* aScriptLocation,
mozilla::ErrorResult& aError);
// Ask the user if further dialogs should be blocked, if dialogs are currently
// being abused. This is used in the cases where we have no modifiable UI to
// show, in that case we show a separate dialog to ask this question.
bool ConfirmDialogIfNeeded();
// Helper called after moving/resizing, to update docShell's presContext
// if we have caused a resolution change by moving across monitors.
void CheckForDPIChange();

View File

@ -27,7 +27,6 @@ ScriptDialogLabelNullPrincipal=Dont allow this site to prompt you again
# %S is either the domain and port of the site prompting, or the name of
# an add-on prompting.
ScriptDialogLabelContentPrincipal=Dont allow %S to prompt you again
ScriptDialogPreventTitle=Confirm Dialog Preference
# LOCALIZATION NOTE (EnterLoginForRealm3, EnterLoginForProxy3):
# %1 is an untrusted string provided by a remote server. It could try to
# take advantage of sentence structure in order to mislead the user (see