Bug 1257843 - Probe to measure when user enters text selection UI, r=sebastian
authorMark Capella <markcapella@twcny.rr.com>
Fri, 22 Apr 2016 16:44:47 -0400
changeset 332363 21c9846c176b04cda630cbccacaccc789a8c963b
parent 332362 9062049993e1fe1d4ca4d0c45155b6502206459c
child 332364 3bc647d9bb02ea0284ea7653161f49c9dd2982e4
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian
bugs1257843
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1257843 - Probe to measure when user enters text selection UI, r=sebastian
mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
--- a/mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
+++ b/mobile/android/base/java/org/mozilla/gecko/ActionBarTextSelection.java
@@ -13,16 +13,18 @@ import org.mozilla.gecko.gfx.LayerView.D
 import org.mozilla.gecko.menu.GeckoMenu;
 import org.mozilla.gecko.menu.GeckoMenuItem;
 import org.mozilla.gecko.text.TextSelection;
 import org.mozilla.gecko.util.FloatUtils;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.ThreadUtils;
 import org.mozilla.gecko.ActionModeCompat.Callback;
 import org.mozilla.gecko.AppConstants.Versions;
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
 
 import android.content.Context;
 import android.graphics.drawable.Drawable;
 import android.view.Menu;
 import android.view.MenuItem;
 
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -203,16 +205,19 @@ class ActionBarTextSelection extends Lay
                             TextSelectionHandle handle = getHandle(position.getString("handle"));
                             handle.setVisibility(position.getBoolean("hidden") ? View.GONE : View.VISIBLE);
                             handle.positionFromGecko(left, top, rtl);
                         }
 
                     } else if (event.equals("TextSelection:ActionbarInit")) {
                         // Init / Open the action bar. Note the current selectionID,
                         // cancel any pending actionBar close.
+                        Telemetry.sendUIEvent(TelemetryContract.Event.SHOW,
+                            TelemetryContract.Method.CONTENT, "text_selection");
+
                         selectionID = message.getString("selectionID");
                         mCurrentItems = null;
                         if (mActionModeTimerTask != null) {
                             mActionModeTimerTask.cancel();
                         }
 
                     } else if (event.equals("TextSelection:ActionbarStatus")) {
                         // Update the actionBar actions as provided by Gecko.
--- a/mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
+++ b/mobile/android/base/java/org/mozilla/gecko/text/FloatingToolbarTextSelection.java
@@ -8,18 +8,21 @@ import android.annotation.TargetApi;
 import android.app.Activity;
 import android.graphics.Rect;
 import android.os.Build;
 import android.util.Log;
 import android.view.ActionMode;
 
 import org.json.JSONException;
 import org.json.JSONObject;
+
 import org.mozilla.gecko.EventDispatcher;
 import org.mozilla.gecko.GeckoAppShell;
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.gfx.LayerView;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import java.util.List;
 
 import ch.boye.httpclientandroidlib.util.TextUtils;
 
@@ -108,16 +111,19 @@ public class FloatingToolbarTextSelectio
             public void run() {
                 handleOnMainThread(event, message);
             }
         });
     }
 
     private void handleOnMainThread(final String event, final JSONObject message) {
         if ("TextSelection:ActionbarInit".equals(event)) {
+            Telemetry.sendUIEvent(TelemetryContract.Event.SHOW,
+                TelemetryContract.Method.CONTENT, "text_selection");
+
             selectionID = message.optString("selectionID");
         } else if ("TextSelection:ActionbarStatus".equals(event)) {
             updateRect(message);
 
             if (!isRectVisible()) {
                 finishActionMode();
             } else {
                 startActionMode(TextAction.fromEventMessage(message));