Bug 1301468 - Add telemetry to AS context menu (following the pattern of existing probes). r=ahunt
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 23 Nov 2016 17:10:04 +0100
changeset 324542 3a2e2cbe04c02d350eacf972a769607c9c09a6af
parent 324541 bab6db941756e7aab6efa7df421f554ca48b6aa0
child 324543 bf33178d80fae1c9b09534c342f0cb37485a5c26
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersahunt
bugs1301468
milestone53.0a1
Bug 1301468 - Add telemetry to AS context menu (following the pattern of existing probes). r=ahunt MozReview-Commit-ID: 91E0c9rPSbB
mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/menu/ActivityStreamContextMenu.java
@@ -137,17 +137,18 @@ public abstract class ActivityStreamCont
         }).execute();
     }
 
 
     @Override
     public boolean onNavigationItemSelected(MenuItem item) {
         switch (item.getItemId()) {
             case R.id.share:
-                Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.LIST, "menu");
+                Telemetry.sendUIEvent(TelemetryContract.Event.SHARE, TelemetryContract.Method.LIST, "as_contextmenu");
+
                 IntentHelper.openUriExternal(url, "text/plain", "", "", Intent.ACTION_SEND, title, false);
                 break;
 
             case R.id.bookmark:
                 ThreadUtils.postToBackgroundThread(new Runnable() {
                     @Override
                     public void run() {
                         final BrowserDB db = BrowserDB.from(context);
@@ -167,20 +168,24 @@ public abstract class ActivityStreamCont
                 break;
 
             case R.id.add_homescreen:
                 GeckoAppShell.createShortcut(title, url);
                 break;
 
             case R.id.open_new_tab:
                 onUrlOpenInBackgroundListener.onUrlOpenInBackground(url, EnumSet.noneOf(HomePager.OnUrlOpenInBackgroundListener.Flags.class));
+
+                Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.CONTEXT_MENU, "as_new_tab");
                 break;
 
             case R.id.open_new_private_tab:
                 onUrlOpenInBackgroundListener.onUrlOpenInBackground(url, EnumSet.of(HomePager.OnUrlOpenInBackgroundListener.Flags.PRIVATE));
+
+                Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.CONTEXT_MENU, "as_private_tab");
                 break;
 
             case R.id.dismiss:
                 ThreadUtils.postToBackgroundThread(new Runnable() {
                     @Override
                     public void run() {
                         BrowserDB.from(context)
                                 .blockActivityStreamSite(context.getContentResolver(),