From 04cadfbb869b542c6eaa5bdeb12117988608864f Mon Sep 17 00:00:00 2001 From: Matthew Noorenberghe Date: Fri, 20 Feb 2015 16:21:05 -0800 Subject: [PATCH] Bug 1124888 - Record the effect of the saved formSubmitURL on autofilling login forms. r=dolske --- .../components/passwordmgr/LoginManagerParent.jsm | 13 ++++++++++++- toolkit/components/telemetry/Histograms.json | 6 ++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/toolkit/components/passwordmgr/LoginManagerParent.jsm b/toolkit/components/passwordmgr/LoginManagerParent.jsm index 418ab6dcfc2..9fa46e573da 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 cf171cb1bc5..fa39248b15f 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",