Bug 988648 - Telemetry for Bookmarking/Saving r=liuche a=lmandel
authorMark Finkle <mfinkle@mozilla.com>
Mon, 28 Jul 2014 15:32:51 -0400
changeset 208191 68d81380f84c
parent 208190 92bb440bf6d6
child 208192 26341b100b6d
push id3759
push usermfinkle@mozilla.com
push date2014-07-29 18:23 +0000
treeherdermozilla-beta@68d81380f84c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, lmandel
bugs988648
milestone32.0
Bug 988648 - Telemetry for Bookmarking/Saving r=liuche a=lmandel
mobile/android/base/BrowserApp.java
mobile/android/base/TelemetryContract.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2441,20 +2441,22 @@ abstract public class BrowserApp extends
         // Track the menu action. We don't know much about the context, but we can use this to determine
         // the frequency of use for various actions.
         Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.MENU, getResources().getResourceEntryName(itemId));
 
         if (itemId == R.id.bookmark) {
             tab = Tabs.getInstance().getSelectedTab();
             if (tab != null) {
                 if (item.isChecked()) {
+                    Telemetry.sendUIEvent(TelemetryContract.Event.UNSAVE, TelemetryContract.Method.MENU, "bookmark");
                     tab.removeBookmark();
                     Toast.makeText(this, R.string.bookmark_removed, Toast.LENGTH_SHORT).show();
                     item.setIcon(R.drawable.ic_menu_bookmark_add);
                 } else {
+                    Telemetry.sendUIEvent(TelemetryContract.Event.SAVE, TelemetryContract.Method.MENU, "bookmark");
                     tab.addBookmark();
                     getButtonToast().show(false,
                         getResources().getString(R.string.bookmark_added),
                         getResources().getString(R.string.bookmark_options),
                         null,
                         new ButtonToast.ToastListener() {
                             @Override
                             public void onButtonClicked() {
--- a/mobile/android/base/TelemetryContract.java
+++ b/mobile/android/base/TelemetryContract.java
@@ -53,31 +53,29 @@ public interface TelemetryContract {
 
         // Outcome of data policy notification: can be true or false.
         POLICY_NOTIFICATION_SUCCESS("policynotification.success.1"),
 
         // Sanitizing private data.
         SANITIZE("sanitize.1"),
 
         // Saving a resource (reader, bookmark, etc) for viewing later.
-        // Note: Only used in JavaScript for now, but here for completeness.
         SAVE("save.1"),
 
         // 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"),
 
         // Stop holding a resource (reader, bookmark, etc) for viewing later.
-        // Note: Only used in JavaScript for now, but here for completeness.
         UNSAVE("unsave.1"),
 
         // VALUES BELOW THIS LINE ARE EXCLUSIVE TO TESTING.
         _TEST1("_test_event_1.1"),
         _TEST2("_test_event_2.1"),
         _TEST3("_test_event_3.1"),
         _TEST4("_test_event_4.1"),
         ;