Skip to content

Commit

Permalink
Remove no longer used _showSaveLoginDialog (deadcode)
Browse files Browse the repository at this point in the history
  • Loading branch information
rainemak committed Mar 19, 2021
1 parent 88a7bf7 commit 5f68844
Showing 1 changed file with 0 additions and 55 deletions.
55 changes: 0 additions & 55 deletions jscomps/nsLoginManagerPrompter.js
Expand Up @@ -1172,61 +1172,6 @@ LoginManagerPrompter.prototype = {
}
},


/**
* Called when we detect a new login in a form submission,
* asks the user what to do.
*/
_showSaveLoginDialog : function (aLogin) {
const buttonFlags = Ci.nsIPrompt.BUTTON_POS_1_DEFAULT +
(Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_0) +
(Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_1) +
(Ci.nsIPrompt.BUTTON_TITLE_IS_STRING * Ci.nsIPrompt.BUTTON_POS_2);

var displayHost = this._getShortDisplayHost(aLogin.hostname);

var dialogText;
if (aLogin.username) {
var displayUser = this._sanitizeUsername(aLogin.username);
dialogText = this._getLocalizedString(
"rememberPasswordMsg",
[displayUser, displayHost]);
} else {
dialogText = this._getLocalizedString(
"rememberPasswordMsgNoUsername",
[displayHost]);

}
var dialogTitle = this._getLocalizedString(
"savePasswordTitle");
var neverButtonText = this._getLocalizedString(
"neverForSiteButtonText");
var rememberButtonText = this._getLocalizedString(
"rememberButtonText");
var notNowButtonText = this._getLocalizedString(
"notNowButtonText");

this.log("Prompting user to save/ignore login");
var userChoice = this._promptService.confirmEx(this._chromeWindow,
dialogTitle, dialogText,
buttonFlags, rememberButtonText,
notNowButtonText, neverButtonText,
null, {});
// Returns:
// 0 - Ignore the login this time
// 1 - Save the login
if (userChoice == 1) {
this.log("Saving login for " + aLogin.hostname);
this._pwmgr.addLogin(aLogin);
} else {
// userChoice == 1 --> just ignore the login.
this.log("Ignoring login.");
}

Services.obs.notifyObservers(aLogin, "passwordmgr-prompt-save", null);
},


/**
* Called when we think we detect a password or username change for
* an existing login, when the form being submitted contains multiple
Expand Down

0 comments on commit 5f68844

Please sign in to comment.