Bug 1213430 - Add more Toast telemetry. r=liuche, a=sylvestre
authorMark Finkle <mfinkle@mozilla.com>
Fri, 09 Oct 2015 19:54:32 -0400
changeset 296384 977151d42625244a85fa1fb8399914c61464f20d
parent 296383 446a398ed58e6bd0f98139a0fb84e62c53048417
child 296385 36a1cee1aca8ee25483caab8681f104e93d7c15a
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sylvestre
bugs1213430
milestone43.0a2
Bug 1213430 - Add more Toast telemetry. r=liuche, a=sylvestre
mobile/android/base/BrowserApp.java
--- a/mobile/android/base/BrowserApp.java
+++ b/mobile/android/base/BrowserApp.java
@@ -586,16 +586,18 @@ public class BrowserApp extends GeckoApp
         getButtonToast().show(false,
                 message,
                 ButtonToast.LENGTH_SHORT,
                 getResources().getString(R.string.switch_button_message),
                 R.drawable.switch_button_icon,
                 new ButtonToast.ToastListener() {
                     @Override
                     public void onButtonClicked() {
+                        Telemetry.sendUIEvent(TelemetryContract.Event.SHOW, TelemetryContract.Method.TOAST, "reading_list");
+
                         final String aboutPageUrl = AboutPages.getURLForBuiltinPanelType(PanelType.READING_LIST);
                         Tabs.getInstance().loadUrlInTab(aboutPageUrl);
                     }
 
                     @Override
                     public void onToastHidden(ButtonToast.ReasonHidden reason) { }
                 });
     }
@@ -3737,16 +3739,18 @@ public class BrowserApp extends GeckoApp
         // for a race between opening the tab and closing it, and switching to
         // it. We could also switch to the Tab explicitly, but we don't want to
         // hold a reference to the Tab itself in the anonymous listener class.
         final int newTabId = newTab.getId();
 
         final ToastListener listener = new ButtonToast.ToastListener() {
             @Override
             public void onButtonClicked() {
+                Telemetry.sendUIEvent(TelemetryContract.Event.SHOW, TelemetryContract.Method.TOAST, "switchtab");
+
                 maybeSwitchToTab(newTabId);
             }
 
             @Override
             public void onToastHidden(ButtonToast.ReasonHidden reason) { }
         };
 
         final String message = isPrivate ?