Bug 1291346 - Fix updateLoginAnchor's search for form logins and delay it until the pref check. r=dolske

It's possible to write a test for this but that's already covered by bug 1164018 and this code should be removed in bug 1286718.

MozReview-Commit-ID: 1LUG3MM4Op3
This commit is contained in:
Matthew Noorenberghe 2016-08-05 13:07:21 -07:00
Родитель ae959f8295
Коммит c8989954aa
1 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -509,6 +509,12 @@ var LoginManagerParent = {
},
updateLoginAnchor: Task.async(function* (browser) {
// Once this preference is removed, this version of the fill doorhanger
// should be enabled for Desktop only, and not for Android or B2G.
if (!Services.prefs.getBoolPref("signon.ui.experimental")) {
return;
}
// Copy the state to use for this execution of the task. These will not
// change during this execution of the asynchronous function, but in case a
// change happens in the state, the function will be retriggered.
@ -519,17 +525,11 @@ var LoginManagerParent = {
// Check if there are form logins for the site, ignoring formSubmitURL.
let hasLogins = loginFormOrigin &&
LoginHelper.searchLoginsWithObject({
formSubmitURL: "",
httpRealm: null,
hostname: loginFormOrigin,
schemeUpgrades: LoginHelper.schemeUpgrades,
}).length > 0;
// Once this preference is removed, this version of the fill doorhanger
// should be enabled for Desktop only, and not for Android or B2G.
if (!Services.prefs.getBoolPref("signon.ui.experimental")) {
return;
}
let showLoginAnchor = loginFormPresent || hasLogins;
let fillDoorhanger = LoginDoorhangers.FillDoorhanger.find({ browser });