Bug 1520336 - Removed unused 'where' parameter from BrowserSearch.recordOneoffSearchInTelemetry. r=adw

Differential Revision: https://phabricator.services.mozilla.com/D16617

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-01-16 01:21:24 +00:00
parent 0575720a12
commit 1619ba50da
4 changed files with 7 additions and 23 deletions

View File

@ -4155,10 +4155,8 @@ const BrowserSearch = {
* allowed values. * allowed values.
* @param type * @param type
* (string) Indicates how the user selected the search item. * (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 { try {
const details = {type, isOneOff: true}; const details = {type, isOneOff: true};
BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details); BrowserUsageTelemetry.recordSearch(gBrowser, engine, source, details);

View File

@ -699,8 +699,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
[url, postData] = [url, postData] =
this._parseAndRecordSearchEngineLoad(selectedOneOff.engine, this._parseAndRecordSearchEngineLoad(selectedOneOff.engine,
this.oneOffSearchQuery, this.oneOffSearchQuery,
event, where, event);
openUILinkParams);
} else if (action) { } else if (action) {
switch (action.type) { switch (action.type) {
case "visiturl": case "visiturl":
@ -776,8 +775,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
action.params.engineName, action.params.engineName,
action.params.searchSuggestion || action.params.searchQuery, action.params.searchSuggestion || action.params.searchQuery,
event, event,
where,
openUILinkParams,
actionDetails actionDetails
); );
break; break;
@ -904,8 +901,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
<parameter name="engineOrEngineName"/> <parameter name="engineOrEngineName"/>
<parameter name="query"/> <parameter name="query"/>
<parameter name="event"/> <parameter name="event"/>
<parameter name="openUILinkWhere"/>
<parameter name="openUILinkParams"/>
<parameter name="searchActionDetails"/> <parameter name="searchActionDetails"/>
<body><![CDATA[ <body><![CDATA[
let engine = let engine =
@ -913,7 +908,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
Services.search.getEngineByName(engineOrEngineName) : Services.search.getEngineByName(engineOrEngineName) :
engineOrEngineName; engineOrEngineName;
let isOneOff = this.popup.oneOffSearchButtons let isOneOff = this.popup.oneOffSearchButtons
.maybeRecordTelemetry(event, openUILinkWhere, openUILinkParams); .maybeRecordTelemetry(event);
// Infer the type of the event which triggered the search. // Infer the type of the event which triggered the search.
let eventType = "unknown"; let eventType = "unknown";
if (event instanceof KeyboardEvent) { if (event instanceof KeyboardEvent) {

View File

@ -987,13 +987,9 @@ class SearchOneOffs {
* *
* @param {Event} aEvent * @param {Event} aEvent
* An event, like a click on a one-off button. * 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. * @returns {boolean} True if telemetry was recorded and false if not.
*/ */
maybeRecordTelemetry(aEvent, aOpenUILinkWhere, aOpenUILinkParams) { maybeRecordTelemetry(aEvent) {
if (!aEvent) { if (!aEvent) {
return false; return false;
} }
@ -1029,11 +1025,7 @@ class SearchOneOffs {
source += "-" + this.telemetryOrigin; source += "-" + this.telemetryOrigin;
} }
let tabBackground = aOpenUILinkWhere == "tab" && BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type);
aOpenUILinkParams &&
aOpenUILinkParams.inBackground;
let where = tabBackground ? "tab-background" : aOpenUILinkWhere;
BrowserSearch.recordOneoffSearchInTelemetry(engine, source, type, where);
return true; return true;
} }

View File

@ -304,7 +304,7 @@ class MozSearchbar extends MozXULElement {
if (!selection || (selection.index == -1)) { if (!selection || (selection.index == -1)) {
oneOffRecorded = this.textbox.popup.oneOffButtons oneOffRecorded = this.textbox.popup.oneOffButtons
.maybeRecordTelemetry(aEvent, aWhere, aParams); .maybeRecordTelemetry(aEvent);
if (!oneOffRecorded) { if (!oneOffRecorded) {
let source = "unknown"; let source = "unknown";
let type = "unknown"; let type = "unknown";
@ -325,8 +325,7 @@ class MozSearchbar extends MozXULElement {
if (!aEngine) { if (!aEngine) {
aEngine = this.currentEngine; aEngine = this.currentEngine;
} }
BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type, BrowserSearch.recordOneoffSearchInTelemetry(aEngine, source, type);
aWhere);
} }
} }