Bug 1520336 - Removed unused 'where' parameter from BrowserSearch.recordOneoffSearchInTelemetry. r=adw
authorMark Banner <standard8@mozilla.com>
Wed, 16 Jan 2019 01:21:24 +0000
changeset 454077 2fc4ce319e749d9d8b672bfdbc9d3fe1fb7276a6
parent 454076 c93c9bc7d63a0d096818cbd52274460dfaee58c5
child 454078 a0588068456ca1002798e5d358dfade5d7879bc3
push id76154
push usermbanner@mozilla.com
push dateWed, 16 Jan 2019 07:54:21 +0000
treeherderautoland@2fc4ce319e74 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1520336
milestone66.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 1520336 - Removed unused 'where' parameter from BrowserSearch.recordOneoffSearchInTelemetry. r=adw Differential Revision: https://phabricator.services.mozilla.com/D16617
browser/base/content/browser.js
browser/base/content/urlbarBindings.xml
browser/components/search/content/search-one-offs.js
browser/components/search/content/searchbar.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4150,20 +4150,18 @@ const BrowserSearch = {
    *
    * @param engine
    *        (nsISearchEngine) The engine handling the search.
    * @param source
    *        (string) Where the search originated from. See BrowserUsageTelemetry for
    *        allowed values.
    * @param type
    *        (string) Indicates how the user selected the search item.
-   * @param where
-   *        (string) Where was the search link opened (e.g. new tab, current tab, ..).
    */
-  recordOneoffSearchInTelemetry(engine, source, type, where) {
+  recordOneoffSearchInTelemetry(engine, source, type) {
     try {
       const details = {type, isOneOff: true};
       BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details);
     } catch (ex) {
       Cu.reportError(ex);
     }
   },
 };
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -694,18 +694,17 @@ file, You can obtain one at http://mozil
           let action = this._parseActionUrl(url);
 
           if (selectedOneOff && selectedOneOff.engine) {
             // If there's a selected one-off button then load a search using
             // the one-off's engine.
             [url, postData] =
               this._parseAndRecordSearchEngineLoad(selectedOneOff.engine,
                                                    this.oneOffSearchQuery,
-                                                   event, where,
-                                                   openUILinkParams);
+                                                   event);
           } else if (action) {
             switch (action.type) {
               case "visiturl":
                 // Unifiedcomplete uses fixupURI to tell if something is a visit
                 // or a search, and passes out the fixedURI as the url param.
                 // By using that uri we would end up passing a different string
                 // to the docshell that may run a different not-found heuristic.
                 // For example, "mozilla/run" would be fixed by unifiedcomplete
@@ -771,18 +770,16 @@ file, You can obtain one at http://mozil
                 const actionDetails = {
                   isSuggestion: !!action.params.searchSuggestion,
                   alias: action.params.alias,
                 };
                 [url, postData] = this._parseAndRecordSearchEngineLoad(
                   action.params.engineName,
                   action.params.searchSuggestion || action.params.searchQuery,
                   event,
-                  where,
-                  openUILinkParams,
                   actionDetails
                 );
                 break;
               case "extension":
                 this.handleRevert();
                 // Give the extension control of handling the command.
                 let searchString = action.params.content;
                 let keyword = action.params.keyword;
@@ -899,26 +896,24 @@ file, You can obtain one at http://mozil
           this.selectionStart = this.selectionEnd = 0;
         ]]></body>
       </method>
 
       <method name="_parseAndRecordSearchEngineLoad">
         <parameter name="engineOrEngineName"/>
         <parameter name="query"/>
         <parameter name="event"/>
-        <parameter name="openUILinkWhere"/>
-        <parameter name="openUILinkParams"/>
         <parameter name="searchActionDetails"/>
         <body><![CDATA[
           let engine =
             typeof(engineOrEngineName) == "string" ?
               Services.search.getEngineByName(engineOrEngineName) :
               engineOrEngineName;
           let isOneOff = this.popup.oneOffSearchButtons
-              .maybeRecordTelemetry(event, openUILinkWhere, openUILinkParams);
+              .maybeRecordTelemetry(event);
           // Infer the type of the event which triggered the search.
           let eventType = "unknown";
           if (event instanceof KeyboardEvent) {
             eventType = "key";
           } else if (event instanceof MouseEvent) {
             eventType = "mouse";
           }
           // Augment the search action details object.
--- a/browser/components/search/content/search-one-offs.js
+++ b/browser/components/search/content/search-one-offs.js
@@ -982,23 +982,19 @@ class SearchOneOffs {
 
   /**
    * If the given event is related to the one-offs, this method records
    * one-off telemetry for it.  this.telemetryOrigin will be appended to the
    * computed source, so make sure you set that first.
    *
    * @param {Event} aEvent
    *        An event, like a click on a one-off button.
-   * @param {string} aOpenUILinkWhere
-   *        The "where" passed to openUILink.
-   * @param {object} aOpenUILinkParams
-   *        The "params" passed to openUILink.
    * @returns {boolean} True if telemetry was recorded and false if not.
    */
-  maybeRecordTelemetry(aEvent, aOpenUILinkWhere, aOpenUILinkParams) {
+  maybeRecordTelemetry(aEvent) {
     if (!aEvent) {
       return false;
     }
 
     let source = null;
     let type = "unknown";
     let engine = null;
     let target = aEvent.originalTarget;
@@ -1024,21 +1020,17 @@ class SearchOneOffs {
     if (!source) {
       return false;
     }
 
     if (this.telemetryOrigin) {
       source += "-" + this.telemetryOrigin;
     }
 
-    let tabBackground = aOpenUILinkWhere == "tab" &&
-      aOpenUILinkParams &&
-      aOpenUILinkParams.inBackground;
-    let where = tabBackground ? "tab-background" : aOpenUILinkWhere;
-    BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type, where);
+    BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type);
     return true;
   }
 
   _resetAddEngineMenuTimeout() {
     if (this._addEngineMenuTimeout) {
       clearTimeout(this._addEngineMenuTimeout);
     }
     this._addEngineMenuTimeout = setTimeout(() => {
--- a/browser/components/search/content/searchbar.js
+++ b/browser/components/search/content/searchbar.js
@@ -299,17 +299,17 @@ class MozSearchbar extends MozXULElement
 
     BrowserUsageTelemetry.recordSearchbarSelectedResultMethod(
       aEvent,
       selection ? selection.index : -1
     );
 
     if (!selection || (selection.index == -1)) {
       oneOffRecorded = this.textbox.popup.oneOffButtons
-        .maybeRecordTelemetry(aEvent, aWhere, aParams);
+        .maybeRecordTelemetry(aEvent);
       if (!oneOffRecorded) {
         let source = "unknown";
         let type = "unknown";
         let target = aEvent.originalTarget;
         if (aEvent instanceof KeyboardEvent) {
           type = "key";
         } else if (aEvent instanceof MouseEvent) {
           type = "mouse";
@@ -320,18 +320,17 @@ class MozSearchbar extends MozXULElement
         } else if (aEvent instanceof XULCommandEvent) {
           if (target.getAttribute("anonid") == "paste-and-search") {
             source = "paste";
           }
         }
         if (!aEngine) {
           aEngine = this.currentEngine;
         }
-        BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type,
-          aWhere);
+        BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type);
       }
     }
 
     // This is a one-off search only if oneOffRecorded is true.
     this.doSearch(textValue, aWhere, aEngine, aParams, oneOffRecorded);
 
     if (aWhere == "tab" && aParams && aParams.inBackground)
       this.focus();