diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index 418ab6dcfc2a..9fa46e573da9 100644 --- a/toolkit/components/passwordmgr/LoginManagerParent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerParent.jsm @@ -107,8 +107,9 @@ var LoginManagerParent = { return; } + let allLoginsCount = Services.logins.countLogins(formOrigin, "", null); // If there are no logins for this site, bail out now. - if (!Services.logins.countLogins(formOrigin, "", null)) { + if (!allLoginsCount) { target.sendAsyncMessage("RemoteLogins:loginsFound", { requestId: requestId, logins: [] }); return; @@ -152,6 +153,16 @@ var LoginManagerParent = { var logins = Services.logins.findLogins({}, formOrigin, actionOrigin, null); target.sendAsyncMessage("RemoteLogins:loginsFound", { requestId: requestId, logins: logins }); + + const PWMGR_FORM_ACTION_EFFECT = Services.telemetry.getHistogramById("PWMGR_FORM_ACTION_EFFECT"); + if (logins.length == 0) { + PWMGR_FORM_ACTION_EFFECT.add(2); + } else if (logins.length == allLoginsCount) { + PWMGR_FORM_ACTION_EFFECT.add(0); + } else { + // logins.length < allLoginsCount + PWMGR_FORM_ACTION_EFFECT.add(1); + } }, doAutocompleteSearch: function({ formOrigin, actionOrigin, diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index cf171cb1bc5e..fa39248b15f1 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -7360,6 +7360,12 @@ "extended_statistics_ok": true, "description": "The number of sites for which the user has explicitly rejected saving logins" }, + "PWMGR_FORM_ACTION_EFFECT": { + "expires_in_version": "never", + "kind": "enumerated", + "n_values" : 5, + "description": "The effect of the form action on signon autofill. (0=No effect, 1=Fewer logins after considering the form action, 2=No logins match form origin and action." + }, "PWMGR_FORM_AUTOFILL_RESULT": { "expires_in_version": "never", "kind": "enumerated",