Bug 1124472 - Add telemetry for the Saved Passwords dialog. r=dolske

--HG--
extra : rebase_source : 0405769a2c3a17b66642c869b5ffd08b1da6183f
This commit is contained in:
Matthew Noorenberghe 2015-03-28 21:50:40 -07:00
Родитель 8d01823d19
Коммит c2820f3e9d
3 изменённых файлов: 50 добавлений и 1 удалений

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

@ -26,8 +26,12 @@ function SignonsStartup() {
// filter the table if requested by caller
if (window.arguments &&
window.arguments[0] &&
window.arguments[0].filterString)
window.arguments[0].filterString) {
setFilter(window.arguments[0].filterString);
Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(1);
} else {
Services.telemetry.getHistogramById("PWMGR_MANAGE_OPENED").add(0);
}
FocusFilterBox();
}
@ -154,6 +158,7 @@ function DeleteAllSignons() {
signonsTreeView._filterSet.length ? signonsTreeView._filterSet : signons,
deletedSignons, "removeSignon", "removeAllSignons");
FinalizeSignonDeletions(syncNeeded);
Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED_ALL").add(1);
}
function TogglePasswordVisible() {
@ -170,6 +175,7 @@ function TogglePasswordVisible() {
Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService)
.notifyObservers(null, "passwordmgr-password-toggle-complete", null);
Services.telemetry.getHistogramById("PWMGR_MANAGE_VISIBILITY_TOGGLED").add(showingPasswords);
}
function AskUserShowPasswords() {
@ -186,6 +192,7 @@ function AskUserShowPasswords() {
function FinalizeSignonDeletions(syncNeeded) {
for (var s=0; s<deletedSignons.length; s++) {
passwordmanager.removeLogin(deletedSignons[s]);
Services.telemetry.getHistogramById("PWMGR_MANAGE_DELETED").add(1);
}
// If the deletion has been performed in a filtered view, reflect the deletion in the unfiltered table.
// See bug 405389.
@ -357,6 +364,7 @@ function CopyPassword() {
var row = document.getElementById("signonsTree").currentIndex;
var password = signonsTreeView.getCellText(row, {id : "passwordCol" });
clipboard.copyString(password, document);
Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_PASSWORD").add(1);
}
function CopyUsername() {
@ -366,6 +374,7 @@ function CopyUsername() {
var row = document.getElementById("signonsTree").currentIndex;
var username = signonsTreeView.getCellText(row, {id : "userCol" });
clipboard.copyString(username);
Services.telemetry.getHistogramById("PWMGR_MANAGE_COPIED_USERNAME").add(1);
}
function UpdateCopyPassword() {

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

@ -4,6 +4,8 @@
/*** =================== INITIALISATION CODE =================== ***/
Components.utils.import("resource://gre/modules/Services.jsm");
var kObserverService;
// interface variables
@ -169,6 +171,7 @@ function HandleTreeColumnClick(sortFunction, event) {
}
sortFunction(sortField);
Services.telemetry.getKeyedHistogramById("PWMGR_MANAGE_SORTED").add(sortField);
}
function SortTree(tree, view, table, column, lastSortColumn, lastSortAscending, updateSelection) {

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

@ -7618,6 +7618,43 @@
"n_values" : 20,
"description": "The result of auto-filling a login form. See http://mzl.la/1Mbs6jL for bucket descriptions."
},
"PWMGR_MANAGE_COPIED_PASSWORD": {
"expires_in_version": "never",
"kind": "count",
"description": "Count of passwords copied from the password management interface"
},
"PWMGR_MANAGE_COPIED_USERNAME": {
"expires_in_version": "never",
"kind": "count",
"description": "Count of usernames copied from the password management interface"
},
"PWMGR_MANAGE_DELETED": {
"expires_in_version": "never",
"kind": "count",
"description": "Count of passwords deleted from the password management interface (including via Remove All)"
},
"PWMGR_MANAGE_DELETED_ALL": {
"expires_in_version": "never",
"kind": "count",
"description": "Count of times that Remove All was used from the password management interface"
},
"PWMGR_MANAGE_OPENED": {
"expires_in_version": "never",
"kind": "enumerated",
"n_values" : 5,
"description": "Accumulates how the password management interface was opened. (0=Preferences, 1=Page Info)"
},
"PWMGR_MANAGE_SORTED": {
"expires_in_version": "never",
"keyed": true,
"kind": "count",
"description": "Reports the column that logins are sorted by"
},
"PWMGR_MANAGE_VISIBILITY_TOGGLED": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Whether the visibility of passwords was toggled (0=Hide, 1=Show)"
},
"PWMGR_NUM_PASSWORDS_PER_HOSTNAME": {
"expires_in_version": "never",
"kind": "linear",