Bug 1183908 - Put password visibility toggling in the capture doorhanger behind the pref signon.rememberSignons.visibilityToggle. r=rittme

This commit is contained in:
Matthew Noorenberghe 2015-07-29 23:07:06 -07:00
parent d98f969383
commit 76e8c07cd0
2 changed files with 10 additions and 3 deletions

View File

@ -3988,6 +3988,7 @@ pref("font.name.monospace.x-unicode", "dt-interface user-ucs2.cjk_japan-0");
// Login Manager prefs
pref("signon.rememberSignons", true);
pref("signon.rememberSignons.visibilityToggle", true);
pref("signon.autofillForms", true);
pref("signon.autologin.proxy", false);
pref("signon.storeWhenAutocompleteOff", true);

View File

@ -857,7 +857,11 @@ LoginManagerPrompter.prototype = {
// Ensure the type is reset so the field is masked.
passwordField.setAttribute("type", "password");
passwordField.setAttribute("value", login.password);
passwordField.setAttribute("show-content", showPasswordPlaceholder);
if (Services.prefs.getBoolPref("signon.rememberSignons.visibilityToggle")) {
passwordField.setAttribute("show-content", showPasswordPlaceholder);
} else {
passwordField.setAttribute("show-content", "");
}
updateButtonLabel();
};
@ -988,8 +992,10 @@ LoginManagerPrompter.prototype = {
.addEventListener("input", onInput);
chromeDoc.getElementById("password-notification-password")
.addEventListener("input", onInput);
chromeDoc.getElementById("password-notification-password")
.addEventListener("focus", onPasswordFocus);
if (Services.prefs.getBoolPref("signon.rememberSignons.visibilityToggle")) {
chromeDoc.getElementById("password-notification-password")
.addEventListener("focus", onPasswordFocus);
}
chromeDoc.getElementById("password-notification-password")
.addEventListener("blur", onPasswordBlur);
break;