Bug 1183908 - Put password visibility toggling in the capture doorhanger behind the pref signon.rememberSignons.visibilityToggle. r=rittme
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Wed, 29 Jul 2015 23:07:06 -0700
changeset 287062 7e94e4795386f80aa71451798363c22d5fe5b77d
parent 287061 b0ea220ccfb3893f2d2f979c10b82dbd8b008feb
child 287063 caa59fe73a47f3deb4981d7b49b4f973b685d07a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrittme
bugs1183908
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1183908 - Put password visibility toggling in the capture doorhanger behind the pref signon.rememberSignons.visibilityToggle. r=rittme
modules/libpref/init/all.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3983,16 +3983,17 @@ pref("font.name.serif.x-unicode", "dt-in
 pref("font.name.sans-serif.x-unicode", "dt-interface system-ucs2.cjk_japan-0");
 pref("font.name.monospace.x-unicode", "dt-interface user-ucs2.cjk_japan-0");
 
 # AIX
 #endif
 
 // 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);
 pref("signon.ui.experimental",              false);
 pref("signon.debug",                        false);
 pref("signon.recipes.path",                 "chrome://passwordmgr/content/recipes.json");
 
 // Satchel (Form Manager) prefs
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -852,17 +852,21 @@ LoginManagerPrompter.prototype = {
                .setAttribute("placeholder", usernamePlaceholder);
       chromeDoc.getElementById("password-notification-username")
                .setAttribute("value", login.username);
 
       let passwordField = chromeDoc.getElementById("password-notification-password");
       // 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();
     };
 
     let readDataFromUI = () => {
       login.username =
         chromeDoc.getElementById("password-notification-username").value;
       login.password =
         chromeDoc.getElementById("password-notification-password").value;
@@ -983,18 +987,20 @@ LoginManagerPrompter.prototype = {
         eventCallback: function (topic) {
           switch (topic) {
             case "showing":
               currentNotification = this;
               chromeDoc.getElementById("password-notification-username")
                        .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;
             case "shown":
               chromeDoc.getElementById("notification-popup")
                          .addEventListener("click", onNotificationClick);
               writeDataToUI();
               break;