[Editor] Add more telemetry for the 'add image' feature (bug 1853960)

This commit is contained in:
Calixte Denizet 2023-09-20 12:45:24 +02:00
parent b80e0d881d
commit 0a278ef0bc
5 changed files with 137 additions and 31 deletions

View file

@ -541,8 +541,6 @@ class AnnotationEditorUIManager {
#editorsToRescale = new Set();
#eventBus = null;
#filterFactory = null;
#idManager = new IdManager();
@ -706,11 +704,11 @@ class AnnotationEditorUIManager {
this.#container = container;
this.#viewer = viewer;
this.#altTextManager = altTextManager;
this.#eventBus = eventBus;
this.#eventBus._on("editingaction", this.#boundOnEditingAction);
this.#eventBus._on("pagechanging", this.#boundOnPageChanging);
this.#eventBus._on("scalechanging", this.#boundOnScaleChanging);
this.#eventBus._on("rotationchanging", this.#boundOnRotationChanging);
this._eventBus = eventBus;
this._eventBus._on("editingaction", this.#boundOnEditingAction);
this._eventBus._on("pagechanging", this.#boundOnPageChanging);
this._eventBus._on("scalechanging", this.#boundOnScaleChanging);
this._eventBus._on("rotationchanging", this.#boundOnRotationChanging);
this.#annotationStorage = pdfDocument.annotationStorage;
this.#filterFactory = pdfDocument.filterFactory;
this.#pageColors = pageColors;
@ -723,10 +721,10 @@ class AnnotationEditorUIManager {
destroy() {
this.#removeKeyboardManager();
this.#removeFocusManager();
this.#eventBus._off("editingaction", this.#boundOnEditingAction);
this.#eventBus._off("pagechanging", this.#boundOnPageChanging);
this.#eventBus._off("scalechanging", this.#boundOnScaleChanging);
this.#eventBus._off("rotationchanging", this.#boundOnRotationChanging);
this._eventBus._off("editingaction", this.#boundOnEditingAction);
this._eventBus._off("pagechanging", this.#boundOnPageChanging);
this._eventBus._off("scalechanging", this.#boundOnScaleChanging);
this._eventBus._off("rotationchanging", this.#boundOnRotationChanging);
for (const layer of this.#allLayers.values()) {
layer.destroy();
}
@ -1041,7 +1039,7 @@ class AnnotationEditorUIManager {
);
if (hasChanged) {
this.#eventBus.dispatch("annotationeditorstateschanged", {
this._eventBus.dispatch("annotationeditorstateschanged", {
source: this,
details: Object.assign(this.#previousStates, details),
});
@ -1049,7 +1047,7 @@ class AnnotationEditorUIManager {
}
#dispatchUpdateUI(details) {
this.#eventBus.dispatch("annotationeditorparamschanged", {
this._eventBus.dispatch("annotationeditorparamschanged", {
source: this,
details,
});
@ -1177,7 +1175,7 @@ class AnnotationEditorUIManager {
if (mode === this.#mode) {
return;
}
this.#eventBus.dispatch("switchannotationeditormode", {
this._eventBus.dispatch("switchannotationeditormode", {
source: this,
mode,
});