Bug 1301468 - Add telemetry to AS context menu (following the pattern of existing probes). r?ahunt draft
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 23 Nov 2016 17:10:04 +0100
changeset 442957 07a61d0a6de451d38ff9b44e9f6a881d7adbf093
parent 442956 1b4a0387064476050072bf68c0a91d17e5e0d6d0
child 442958 2fc2fea2aba4478b5359fd3b4a00cae0098f231d
child 443013 51c8716902d0df2d2e1edd1b1962699a7d7ff793
child 443021 07726b002b16bf13ae81f026e2b9579e7fe0e1d5
push id36876
push users.kaspari@gmail.com
push dateWed, 23 Nov 2016 16:25:14 +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(),