Bug 1226292 - Add telemetry for Find in Page r=liuche a=ritu
authorMark Finkle <mfinkle@mozilla.com>
Tue, 24 Nov 2015 00:21:16 -0500
changeset 305830 5a1f8e8a63a8757a35964f0201efd3c23583a38c
parent 305827 ad87069605122c4c951874216bd941bea00c6c04
child 305831 9177f28fc28e7b7ab7185553e24b6af5b5796a17
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, ritu
bugs1226292
milestone44.0
Bug 1226292 - Add telemetry for Find in Page r=liuche a=ritu
mobile/android/base/FindInPageBar.java
--- a/mobile/android/base/FindInPageBar.java
+++ b/mobile/android/base/FindInPageBar.java
@@ -1,14 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko;
 
+import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.util.GeckoEventListener;
 import org.mozilla.gecko.util.GeckoRequest;
 import org.mozilla.gecko.util.NativeJSObject;
 import org.mozilla.gecko.util.ThreadUtils;
 
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -144,16 +145,19 @@ public class FindInPageBar extends Linea
     }
 
     // View.OnClickListener implementation
 
     @Override
     public void onClick(View v) {
         final int viewId = v.getId();
 
+        String extras = getResources().getResourceEntryName(viewId);
+        Telemetry.sendUIEvent(TelemetryContract.Event.ACTION, TelemetryContract.Method.BUTTON, extras);
+
         if (viewId == R.id.find_matchcase) {
             // Toggle matchcase state (color).
             mMatchCase.toggle();
 
             // Repeat the find after a matchcase change.
             sendRequestToFinderHelper("FindInPage:Find", mFindText.getText().toString());
             getInputMethodManager(mFindText).hideSoftInputFromWindow(mFindText.getWindowToken(), 0);
             return;