Bug 988648 - Telemetry for Bookmarking/Saving r=liuche
authorMark Finkle <mfinkle@mozilla.com>
Mon, 28 Jul 2014 15:32:51 -0400
changeset 196499 72928fbc2e04a915395b2b7ea5a90f350156a296
parent 196498 76f97d51a1a092e2aa7279848023caa8ef024cd5
child 196500 92bfe30723a6766ee64bc522b598ca132ea00995
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersliuche
bugs988648
milestone34.0a1
Bug 988648 - Telemetry for Bookmarking/Saving r=liuche
mobile/android/base/BrowserApp.java
mobile/android/base/TelemetryContract.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -2540,20 +2540,22 @@ public class BrowserApp extends GeckoApp
         // 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
@@ -57,31 +57,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"),
         ;