Merge pull request #16453 from calixteman/gv_telemetry
[GeckoView] Add some telemetry for the toolbar buttons (bug 1829216)
This commit is contained in:
commit
094fb3c783
@ -601,7 +601,8 @@ const PDFViewerApplication = {
|
|||||||
appConfig.toolbar,
|
appConfig.toolbar,
|
||||||
eventBus,
|
eventBus,
|
||||||
this.l10n,
|
this.l10n,
|
||||||
await this._nimbusDataPromise
|
await this._nimbusDataPromise,
|
||||||
|
this.externalServices
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -25,14 +25,18 @@ class Toolbar {
|
|||||||
|
|
||||||
#eventBus;
|
#eventBus;
|
||||||
|
|
||||||
|
#externalServices;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ToolbarOptions} options
|
* @param {ToolbarOptions} options
|
||||||
* @param {EventBus} eventBus
|
* @param {EventBus} eventBus
|
||||||
* @param {IL10n} _l10n - Localization service.
|
* @param {IL10n} _l10n - Localization service.
|
||||||
* @param {Object} nimbusData - Nimbus configuration.
|
* @param {Object} nimbusData - Nimbus configuration.
|
||||||
|
* @param {Object} externalServices - Interface for external services.
|
||||||
*/
|
*/
|
||||||
constructor(options, eventBus, _l10n, nimbusData) {
|
constructor(options, eventBus, _l10n, nimbusData, externalServices) {
|
||||||
this.#eventBus = eventBus;
|
this.#eventBus = eventBus;
|
||||||
|
this.#externalServices = externalServices;
|
||||||
const buttons = [
|
const buttons = [
|
||||||
{
|
{
|
||||||
element: options.download,
|
element: options.download,
|
||||||
@ -84,6 +88,10 @@ class Toolbar {
|
|||||||
element.addEventListener("click", evt => {
|
element.addEventListener("click", evt => {
|
||||||
if (eventName !== null) {
|
if (eventName !== null) {
|
||||||
this.#eventBus.dispatch(eventName, { source: this, ...eventDetails });
|
this.#eventBus.dispatch(eventName, { source: this, ...eventDetails });
|
||||||
|
this.#externalServices.reportTelemetry({
|
||||||
|
type: "gv-buttons",
|
||||||
|
data: { id: `${element.id}_tapped` },
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user