Merge pull request #15416 from calixteman/buttons_telemetry
Add some telemetry to know how often the buttons in the secondary toolbar are used (bug 1789883)
This commit is contained in:
		
						commit
						2d1d64b214
					
				| @ -613,7 +613,8 @@ const PDFViewerApplication = { | |||||||
| 
 | 
 | ||||||
|     this.secondaryToolbar = new SecondaryToolbar( |     this.secondaryToolbar = new SecondaryToolbar( | ||||||
|       appConfig.secondaryToolbar, |       appConfig.secondaryToolbar, | ||||||
|       eventBus |       eventBus, | ||||||
|  |       this.externalServices | ||||||
|     ); |     ); | ||||||
| 
 | 
 | ||||||
|     if (this.supportsFullscreen) { |     if (this.supportsFullscreen) { | ||||||
| @ -2917,6 +2918,10 @@ function webViewerKeyDown(evt) { | |||||||
|       case 80: // p
 |       case 80: // p
 | ||||||
|         PDFViewerApplication.requestPresentationMode(); |         PDFViewerApplication.requestPresentationMode(); | ||||||
|         handled = true; |         handled = true; | ||||||
|  |         PDFViewerApplication.externalServices.reportTelemetry({ | ||||||
|  |           type: "buttons", | ||||||
|  |           data: { id: "presentationModeKeyboard" }, | ||||||
|  |         }); | ||||||
|         break; |         break; | ||||||
|       case 71: // g
 |       case 71: // g
 | ||||||
|         // focuses input#pageNumber field
 |         // focuses input#pageNumber field
 | ||||||
|  | |||||||
| @ -51,7 +51,7 @@ class SecondaryToolbar { | |||||||
|    * @param {SecondaryToolbarOptions} options |    * @param {SecondaryToolbarOptions} options | ||||||
|    * @param {EventBus} eventBus |    * @param {EventBus} eventBus | ||||||
|    */ |    */ | ||||||
|   constructor(options, eventBus) { |   constructor(options, eventBus, externalServices) { | ||||||
|     this.toolbar = options.toolbar; |     this.toolbar = options.toolbar; | ||||||
|     this.toggleButton = options.toggleButton; |     this.toggleButton = options.toggleButton; | ||||||
|     this.buttons = [ |     this.buttons = [ | ||||||
| @ -150,6 +150,7 @@ class SecondaryToolbar { | |||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     this.eventBus = eventBus; |     this.eventBus = eventBus; | ||||||
|  |     this.externalServices = externalServices; | ||||||
|     this.opened = false; |     this.opened = false; | ||||||
| 
 | 
 | ||||||
|     // Bind the event listeners for click, cursor tool, and scroll/spread mode
 |     // Bind the event listeners for click, cursor tool, and scroll/spread mode
 | ||||||
| @ -212,6 +213,10 @@ class SecondaryToolbar { | |||||||
|         if (close) { |         if (close) { | ||||||
|           this.close(); |           this.close(); | ||||||
|         } |         } | ||||||
|  |         this.externalServices.reportTelemetry({ | ||||||
|  |           type: "buttons", | ||||||
|  |           data: { id: element.id }, | ||||||
|  |         }); | ||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user