Bug 1301468 - AS Top Sites: Add LOAD_URL telemetry. r=ahunt
authorSebastian Kaspari <s.kaspari@gmail.com>
Wed, 23 Nov 2016 16:52:20 +0100
changeset 324539 5bb4e5f0635a6da9c734bdb89b143229ce043c70
parent 324538 ac823431b8adfdf8062022558fadb4dbe255aa9c
child 324540 3c810092f3980ec1b1bebfe4af76c707ae1cb449
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersahunt
bugs1301468
milestone53.0a1
Bug 1301468 - AS Top Sites: Add LOAD_URL telemetry. r=ahunt MozReview-Commit-ID: 2vgWB2KxPMK
mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java
--- a/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java
+++ b/mobile/android/base/java/org/mozilla/gecko/home/activitystream/topsites/TopSitesCard.java
@@ -7,16 +7,18 @@ package org.mozilla.gecko.home.activitys
 import android.graphics.Color;
 import android.support.v7.widget.RecyclerView;
 import android.view.View;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
 import android.widget.TextView;
 
 import org.mozilla.gecko.R;
+import org.mozilla.gecko.Telemetry;
+import org.mozilla.gecko.TelemetryContract;
 import org.mozilla.gecko.activitystream.ActivityStream;
 import org.mozilla.gecko.home.HomePager;
 import org.mozilla.gecko.home.activitystream.menu.ActivityStreamContextMenu;
 import org.mozilla.gecko.icons.IconCallback;
 import org.mozilla.gecko.icons.IconResponse;
 import org.mozilla.gecko.icons.Icons;
 import org.mozilla.gecko.util.DrawableUtil;
 import org.mozilla.gecko.util.ViewUtil;
@@ -88,16 +90,18 @@ class TopSitesCard extends RecyclerView.
         menuButton.setImageDrawable(
                 DrawableUtil.tintDrawable(menuButton.getContext(), R.drawable.menu, tintColor));
     }
 
     @Override
     public void onClick(View clickedView) {
         if (clickedView == itemView) {
             onUrlOpenListener.onUrlOpen(url, EnumSet.noneOf(HomePager.OnUrlOpenListener.Flags.class));
+
+            Telemetry.sendUIEvent(TelemetryContract.Event.LOAD_URL, TelemetryContract.Method.LIST_ITEM, "as_top_sites");
         } else if (clickedView == menuButton) {
             ActivityStreamContextMenu.show(clickedView.getContext(),
                     menuButton,
                     ActivityStreamContextMenu.MenuMode.TOPSITE,
                     title.getText().toString(), url,
                     onUrlOpenListener, onUrlOpenInBackgroundListener,
                     faviconView.getWidth(), faviconView.getHeight());
         }