Bug 1018433 - Add telemetry for "undo close tab". r=mfinkle

This commit is contained in:
Chenxia Liu 2014-06-04 10:37:32 -07:00
parent 07cb79cc65
commit a04fa01ea8
2 changed files with 9 additions and 0 deletions

View File

@ -64,6 +64,10 @@ public interface TelemetryContract {
// Sharing content.
SHARE("share.1"),
// Undoing a user action.
// Note: Only used in JavaScript for now, but here for completeness.
UNDO("undo.1"),
// Unpinning an item.
UNPIN("unpin.1"),
@ -137,6 +141,10 @@ public interface TelemetryContract {
// Action triggered from a suggestion provided to the user.
SUGGESTION("suggestion"),
// Action triggered from a SuperToast.
// Note: Only used in JavaScript for now, but here for completeness.
TOAST("toast"),
// VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
_TEST1("_test_method_1"),
_TEST2("_test_method_2"),

View File

@ -989,6 +989,7 @@ var BrowserApp = {
icon: "drawable://undo_button_icon",
label: Strings.browser.GetStringFromName("undoCloseToast.action2"),
callback: function() {
UITelemetry.addEvent("undo.1", "toast", null, "closetab");
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
ss.undoCloseTab(window, 0);
}