Bug 1026003 - UI telemetry for opening pages in new tabs from web content contextmenu r=liuche, a=sylvestre
authorMark Finkle <mfinkle@mozilla.com>
Tue, 17 Jun 2014 00:20:06 -0400
changeset 208239 122393de469cc38d60f8c0ebfef6e418eeb24319
parent 208238 71f5fa1512d20a1b94c6cdc779df38ef61d28c50
child 208240 823d7509bf7b48c39deb2c54061d1e96e329fb49
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, sylvestre
bugs1026003
milestone32.0a2
Bug 1026003 - UI telemetry for opening pages in new tabs from web content contextmenu r=liuche, a=sylvestre
mobile/android/chrome/content/browser.js
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -479,32 +479,36 @@ var BrowserApp = {
     WebappRT.init(status, url, callback);
   },
 
   initContextMenu: function ba_initContextMenu() {
     // TODO: These should eventually move into more appropriate classes
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.openInNewTab"),
       NativeWindow.contextmenus.linkOpenableNonPrivateContext,
       function(aTarget) {
+        UITelemetry.addEvent("loadurl.1", "contextmenu", null);
+
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal);
         let tab = BrowserApp.addTab(url, { selected: false, parentId: BrowserApp.selectedTab.id });
 
         let newtabStrings = Strings.browser.GetStringFromName("newtabpopup.opened");
         let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
         // Bug 1023407: ButtonToasts interact badly with touch events, blocking
         // interaction with the rest of the system until the ButtonToast expires
         // or is otherwise dismissed (Bug 1019735). Until this is fixed, we'll
         // just use regular system Toasts.
         NativeWindow.toast.show(label, "short");
       });
 
     NativeWindow.contextmenus.add(Strings.browser.GetStringFromName("contextmenu.openInPrivateTab"),
       NativeWindow.contextmenus.linkOpenableContext,
       function(aTarget) {
+        UITelemetry.addEvent("loadurl.1", "contextmenu", null);
+
         let url = NativeWindow.contextmenus._getLinkURL(aTarget);
         ContentAreaUtils.urlSecurityCheck(url, aTarget.ownerDocument.nodePrincipal);
         let tab = BrowserApp.addTab(url, { selected: false, parentId: BrowserApp.selectedTab.id, isPrivate: true });
 
         let newtabStrings = Strings.browser.GetStringFromName("newprivatetabpopup.opened");
         let label = PluralForm.get(1, newtabStrings).replace("#1", 1);
         // Bug 1023407: ButtonToasts interact badly with touch events, blocking
         // interaction with the rest of the system until the ButtonToast expires