diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index c63c240a8ac..9a692f7e0c6 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -573,15 +573,15 @@ var LoginManagerContent = { /* * _fillform * - * Fill the form with the provided login information. - * The logins are returned so they can be reused for - * optimization. Success of action is also returned in format - * [success, foundLogins]. + * Attempt to find the username and password fields in a form, and fill them + * in using the provided logins. * * - autofillForm denotes if we should fill the form in automatically + * - clobberPassword controls if an existing password value can be + * overwritten * - userTriggered is an indication of whether this filling was triggered by * the user - * - foundLogins is an array of nsILoginInfo + * - foundLogins is an array of nsILoginInfo that could be used for the form */ _fillForm : function (form, autofillForm, clobberPassword, userTriggered, foundLogins) { @@ -613,7 +613,7 @@ var LoginManagerContent = { if (foundLogins.length == 0) { // We don't log() here since this is a very common case. recordAutofillResult(AUTOFILL_RESULT.NO_SAVED_LOGINS); - return [false, foundLogins]; + return; } // Heuristically determine what the user/pass fields are @@ -627,14 +627,14 @@ var LoginManagerContent = { if (passwordField == null) { log("not filling form, no password field found"); recordAutofillResult(AUTOFILL_RESULT.NO_PASSWORD_FIELD); - return [false, foundLogins]; + return; } // If the password field is disabled or read-only, there's nothing to do. if (passwordField.disabled || passwordField.readOnly) { log("not filling form, password field disabled or read-only"); recordAutofillResult(AUTOFILL_RESULT.PASSWORD_DISABLED_READONLY); - return [false, foundLogins]; + return; } // Discard logins which have username/password values that don't @@ -662,7 +662,7 @@ var LoginManagerContent = { if (logins.length == 0) { log("form not filled, none of the logins fit in the field"); recordAutofillResult(AUTOFILL_RESULT.NO_LOGINS_FIT); - return [false, foundLogins]; + return; } // The reason we didn't end up filling the form, if any. We include @@ -683,7 +683,7 @@ var LoginManagerContent = { passwordField, foundLogins, null); log("form not filled, the password field was already filled"); recordAutofillResult(AUTOFILL_RESULT.EXISTING_PASSWORD); - return [false, foundLogins]; + return; } // If the form has an autocomplete=off attribute in play, don't @@ -770,16 +770,10 @@ var LoginManagerContent = { } didFillForm = true; } else if (selectedLogin && !autofillForm) { - // For when autofillForm is false, but we still have the information - // to fill a form, we notify observers. didntFillReason = "noAutofillForms"; - Services.obs.notifyObservers(form, "passwordmgr-found-form", didntFillReason); log("autofillForms=false but form can be filled; notified observers"); } else if (selectedLogin && isFormDisabled) { - // For when autocomplete is off, but we still have the information - // to fill a form, we notify observers. didntFillReason = "autocompleteOff"; - Services.obs.notifyObservers(form, "passwordmgr-found-form", didntFillReason); log("autocomplete=off but form can be filled; notified observers"); } @@ -807,8 +801,6 @@ var LoginManagerContent = { } recordAutofillResult(autofillResult); } - - return [didFillForm, foundLogins]; }, diff --git a/toolkit/components/passwordmgr/nsILoginManager.idl b/toolkit/components/passwordmgr/nsILoginManager.idl index 77c5dbbbc9c..2df13cf0361 100644 --- a/toolkit/components/passwordmgr/nsILoginManager.idl +++ b/toolkit/components/passwordmgr/nsILoginManager.idl @@ -13,7 +13,7 @@ interface nsIDOMHTMLInputElement; interface nsIDOMHTMLFormElement; interface nsIPropertyBag; -[scriptable, uuid(f0c5ca21-db71-4b32-993e-ab63054cc6f5)] +[scriptable, uuid(38c7f6af-7df9-49c7-b558-2776b24e6cc1)] interface nsILoginManager : nsISupports { /** * This promise is resolved when initialization is complete, and is rejected @@ -215,16 +215,6 @@ interface nsILoginManager : nsISupports { in nsIDOMHTMLInputElement aElement, in nsIFormAutoCompleteObserver aListener); - /** - * Fill a form with login information if we have it. This method will fill - * aForm regardless of the signon.autofillForms preference. - * - * @param aForm - * The form to fill - * @return Promise that is resolved with whether or not the form was filled. - */ - jsval fillForm(in nsIDOMHTMLFormElement aForm); - /** * Search for logins in the login manager. An array is always returned; * if there are no logins the array is empty. diff --git a/toolkit/components/passwordmgr/test/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest.ini index 912ff386644..5a0475b3b51 100644 --- a/toolkit/components/passwordmgr/test/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest.ini @@ -31,7 +31,6 @@ support-files = [test_basic_form_0pw.html] [test_basic_form_1pw.html] [test_basic_form_1pw_2.html] -[test_basic_form_2.html] [test_basic_form_2pw_1.html] [test_basic_form_2pw_2.html] [test_basic_form_3pw_1.html] @@ -40,7 +39,6 @@ skip-if = toolkit == 'android' [test_case_differences.html] skip-if = toolkit == 'android' [test_basic_form_html5.html] -[test_basic_form_observer_autofillForms.html] [test_basic_form_observer_foundLogins.html] [test_basic_form_pwevent.html] [test_basic_form_pwonly.html] diff --git a/toolkit/components/passwordmgr/test/test_basic_form_2.html b/toolkit/components/passwordmgr/test/test_basic_form_2.html deleted file mode 100644 index b8813fce341..00000000000 --- a/toolkit/components/passwordmgr/test/test_basic_form_2.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Test for Login Manager - - - - - -Login Manager test: simple form fill with autofillForms disabled - - -

- -
- -
-

This is form 1.

- - - - - -
- -
- -
-
-
- - diff --git a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html b/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html deleted file mode 100644 index 75e13ef5061..00000000000 --- a/toolkit/components/passwordmgr/test/test_basic_form_observer_autofillForms.html +++ /dev/null @@ -1,104 +0,0 @@ - - - - Test for Login Manager - - - - - -Login Manager test: simple form with autofillForms disabled and notifying observers - - -

- -
- -
-

This is form 1.

- - - - - -
- -
- -
-
-
- -