Bug 1183908 - Put password visibility toggling in the capture doorhanger behind the pref signon.rememberSignons.visibilityToggle. r=rittme a=lmandel
authorMatthew Noorenberghe <mozilla@noorenberghe.ca>
Thu, 30 Jul 2015 11:06:06 -0700
changeset 275501 34b95d9ef07ef0dc6079d72b9eb40bb4701b9722
parent 275500 4e36b11687f75fabd6f6e0e976e198fe48787d52
child 275502 9b861360b297f18f62cb9c8dfb576fc9eb507331
push id863
push userraliiev@mozilla.com
push dateMon, 03 Aug 2015 13:22:43 +0000
treeherdermozilla-release@f6321b14228d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrittme, lmandel
bugs1183908
milestone40.0
Bug 1183908 - Put password visibility toggling in the capture doorhanger behind the pref signon.rememberSignons.visibilityToggle. r=rittme a=lmandel
modules/libpref/init/all.js
toolkit/components/passwordmgr/nsLoginManagerPrompter.js
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -3800,16 +3800,17 @@ pref("font.name.monospace.x-unicode", "d
 pref("print.postscript.print_command", "lp -c -s ${MOZ_PRINTER_NAME:+-d\"$MOZ_PRINTER_NAME\"}");
 pref("print.print_command", "lp -c -s ${MOZ_PRINTER_NAME:+-d\"$MOZ_PRINTER_NAME\"}");
 
 # Solaris
 #endif
 
 // Login Manager prefs
 pref("signon.rememberSignons",              true);
+pref("signon.rememberSignons.visibilityToggle", false);
 pref("signon.autofillForms",                true);
 pref("signon.autologin.proxy",              false);
 pref("signon.storeWhenAutocompleteOff",     true);
 pref("signon.debug",                        false);
 
 // Satchel (Form Manager) prefs
 pref("browser.formfill.debug",            false);
 pref("browser.formfill.enable",           true);
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -991,18 +991,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;