OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.exportPath('print_preview'); | 5 cr.exportPath('print_preview'); |
6 | 6 |
7 /** | 7 /** |
8 * Enumeration of IDs shown in the preview area. | 8 * Enumeration of IDs shown in the preview area. |
9 * @enum {string} | 9 * @enum {string} |
10 * @private | 10 * @private |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 this.printTicketStore_.scaling] | 337 this.printTicketStore_.scaling] |
338 .forEach(function(setting) { | 338 .forEach(function(setting) { |
339 this.tracker.add( | 339 this.tracker.add( |
340 setting, print_preview.ticket_items.TicketItem.EventType.CHANGE, | 340 setting, print_preview.ticket_items.TicketItem.EventType.CHANGE, |
341 this.onTicketChange_.bind(this)); | 341 this.onTicketChange_.bind(this)); |
342 }.bind(this)); | 342 }.bind(this)); |
343 | 343 |
344 if (this.checkPluginCompatibility_()) { | 344 if (this.checkPluginCompatibility_()) { |
345 this.previewGenerator_ = new print_preview.PreviewGenerator( | 345 this.previewGenerator_ = new print_preview.PreviewGenerator( |
346 this.destinationStore_, this.printTicketStore_, this.nativeLayer_, | 346 this.destinationStore_, this.printTicketStore_, this.nativeLayer_, |
347 this.documentInfo_); | 347 this.documentInfo_, this.listenerTracker); |
348 this.tracker.add( | 348 this.tracker.add( |
349 this.previewGenerator_, | 349 this.previewGenerator_, |
350 print_preview.PreviewGenerator.EventType.PREVIEW_START, | 350 print_preview.PreviewGenerator.EventType.PREVIEW_START, |
351 this.onPreviewStart_.bind(this)); | 351 this.onPreviewStart_.bind(this)); |
352 this.tracker.add( | 352 this.tracker.add( |
353 this.previewGenerator_, | 353 this.previewGenerator_, |
354 print_preview.PreviewGenerator.EventType.PAGE_READY, | 354 print_preview.PreviewGenerator.EventType.PAGE_READY, |
355 this.onPagePreviewReady_.bind(this)); | 355 this.onPagePreviewReady_.bind(this)); |
356 this.tracker.add( | 356 this.tracker.add( |
357 this.previewGenerator_, | 357 this.previewGenerator_, |
358 print_preview.PreviewGenerator.EventType.DOCUMENT_READY, | 358 print_preview.PreviewGenerator.EventType.DOCUMENT_READY, |
359 this.onDocumentReady_.bind(this)); | 359 this.onDocumentReady_.bind(this)); |
360 this.previewGenerator_.addWebUIEventListeners(this.listenerTracker); | |
361 } else { | 360 } else { |
362 this.showCustomMessage(loadTimeData.getString('noPlugin')); | 361 this.showCustomMessage(loadTimeData.getString('noPlugin')); |
363 } | 362 } |
364 }, | 363 }, |
365 | 364 |
366 /** @override */ | 365 /** @override */ |
367 exitDocument: function() { | 366 exitDocument: function() { |
368 print_preview.Component.prototype.exitDocument.call(this); | 367 print_preview.Component.prototype.exitDocument.call(this); |
369 this.overlayEl_ = null; | 368 this.overlayEl_ = null; |
370 this.openSystemDialogButton_ = null; | 369 this.openSystemDialogButton_ = null; |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 // pointer events will be sent to the frame. When dragging the margins, | 663 // pointer events will be sent to the frame. When dragging the margins, |
665 // we don't want this to happen as it can cause the margin to stop | 664 // we don't want this to happen as it can cause the margin to stop |
666 // being draggable. | 665 // being draggable. |
667 this.plugin_.style.pointerEvents = isDragging ? 'none' : 'auto'; | 666 this.plugin_.style.pointerEvents = isDragging ? 'none' : 'auto'; |
668 }, | 667 }, |
669 }; | 668 }; |
670 | 669 |
671 // Export | 670 // Export |
672 return {PreviewArea: PreviewArea}; | 671 return {PreviewArea: PreviewArea}; |
673 }); | 672 }); |
OLD | NEW |