Bug 1135126 - Only show one Login doorhanger at a time. r=ally
authorChenxia Liu <liuche@mozilla.com>
Wed, 08 Apr 2015 18:30:47 -0700
changeset 239405 7807b2f2c9e66575ba014db1dbfd604fd156408f
parent 239398 a35163f83d22a34de0d34bda0f656b1ce57b9c41
child 239406 364bc6209cc5583f9b1b87343ea49189e976b29d
push id28596
push usercbook@mozilla.com
push dateThu, 16 Apr 2015 10:34:35 +0000
treeherdermozilla-central@7894f40823d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersally
bugs1135126
milestone40.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 1135126 - Only show one Login doorhanger at a time. r=ally
mobile/android/components/LoginManagerPrompter.js
--- a/mobile/android/components/LoginManagerPrompter.js
+++ b/mobile/android/components/LoginManagerPrompter.js
@@ -135,30 +135,27 @@ LoginManagerPrompter.prototype = {
         Services.telemetry.getHistogramById("PWMGR_PROMPT_REMEMBER_ACTION").add(PROMPT_DISPLAYED);
     },
 
 
     /*
      * _showLoginNotification
      *
      * Displays a notification doorhanger.
-     * @param aName
-     *        Name of notification
      * @param aTitle
      *        Object with title and optional resource to display with the title, such as a favicon key
      * @param aBody
      *        String message to be displayed in the doorhanger
      * @param aButtons
      *        Buttons to display with the doorhanger
      * @param aActionText
      *        Object with text to be displayed as clickable, along with a bundle to create an action
      *
      */
-    _showLoginNotification : function (aName, aTitle, aBody, aButtons, aActionText) {
-        this.log("Adding new " + aName + " notification bar");
+    _showLoginNotification : function (aTitle, aBody, aButtons, aActionText) {
         let notifyWin = this._window.top;
         let chromeWin = this._getChromeWindow(notifyWin).wrappedJSObject;
         let browser = chromeWin.BrowserApp.getBrowserForWindow(notifyWin);
         let tabID = chromeWin.BrowserApp.getTabForBrowser(browser).id;
 
         // The page we're going to hasn't loaded yet, so we want to persist
         // across the first location change.
 
@@ -171,17 +168,17 @@ LoginManagerPrompter.prototype = {
             persistWhileVisible: true,
             timeout: Date.now() + 10000,
             title: aTitle,
             actionText: aActionText
         }
 
         var nativeWindow = this._getNativeWindow();
         if (nativeWindow)
-            nativeWindow.doorhanger.show(aBody, aName, aButtons, tabID, options, "LOGIN");
+            nativeWindow.doorhanger.show(aBody, "password", aButtons, tabID, options, "LOGIN");
     },
 
 
     /*
      * _showSaveLoginNotification
      *
      * Displays a notification doorhanger (rather than a popup), to allow the user to
      * save the specified login. This allows the user to see the results of
@@ -227,17 +224,17 @@ LoginManagerPrompter.prototype = {
                         aLogin.password = response["password"] || aLogin.password;
                     }
                     pwmgr.addLogin(aLogin);
                     promptHistogram.add(PROMPT_ADD);
                 }
             }
         ];
 
-        this._showLoginNotification("password-save", title, notificationText, buttons, actionText);
+        this._showLoginNotification(title, notificationText, buttons, actionText);
     },
 
     /*
      * promptToChangePassword
      *
      * Called when we think we detect a password change for an existing
      * login, when the form being submitted contains multiple password
      * fields.
@@ -284,17 +281,17 @@ LoginManagerPrompter.prototype = {
                 label: this._getLocalizedString("updateButton"),
                 callback:  function() {
                     self._updateLogin(aOldLogin, aNewPassword);
                     promptHistogram.add(PROMPT_UPDATE);
                 }
             }
         ];
 
-        this._showLoginNotification("password-change", title, notificationText, buttons);
+        this._showLoginNotification(title, notificationText, buttons);
     },
 
 
     /*
      * promptToChangePasswordWithUsernames
      *
      * Called when we detect a password change in a form submission, but we
      * don't know which existing login (username) it's for. Asks the user