Bug 1124888 - Record the effect of the saved formSubmitURL on autofilling login forms. r=dolske

This commit is contained in:
Matthew Noorenberghe 2015-02-20 16:21:05 -08:00
parent e869f1d45d
commit 04cadfbb86
2 changed files with 18 additions and 1 deletions

View File

@ -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,

View File

@ -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",