| Index: chrome/browser/resources/print_preview/previewarea/preview_area.js
|
| diff --git a/chrome/browser/resources/print_preview/previewarea/preview_area.js b/chrome/browser/resources/print_preview/previewarea/preview_area.js
|
| index ca553a7c7a1102a1c5cf4aee36ab9b713ccaa22f..37e8e70f94ee393194233948987a78e91ff5b505 100644
|
| --- a/chrome/browser/resources/print_preview/previewarea/preview_area.js
|
| +++ b/chrome/browser/resources/print_preview/previewarea/preview_area.js
|
| @@ -105,8 +105,7 @@ cr.define('print_preview', function() {
|
| * @private
|
| */
|
| this.marginControlContainer_ = new print_preview.MarginControlContainer(
|
| - this.documentInfo_,
|
| - this.printTicketStore_.marginsType,
|
| + this.documentInfo_, this.printTicketStore_.marginsType,
|
| this.printTicketStore_.customMargins,
|
| this.printTicketStore_.measurementSystem,
|
| this.onMarginDragChanged_.bind(this));
|
| @@ -313,45 +312,33 @@ cr.define('print_preview', function() {
|
| print_preview.Component.prototype.enterDocument.call(this);
|
|
|
| this.tracker.add(
|
| - assert(this.openSystemDialogButton_),
|
| - 'click',
|
| + assert(this.openSystemDialogButton_), 'click',
|
| this.onOpenSystemDialogButtonClick_.bind(this));
|
|
|
| var TicketStoreEvent = print_preview.PrintTicketStore.EventType;
|
| - [
|
| - TicketStoreEvent.INITIALIZE,
|
| - TicketStoreEvent.TICKET_CHANGE,
|
| - TicketStoreEvent.CAPABILITIES_CHANGE,
|
| - TicketStoreEvent.DOCUMENT_CHANGE
|
| - ].forEach(function(eventType) {
|
| - this.tracker.add(this.printTicketStore_, eventType,
|
| - this.onTicketChange_.bind(this));
|
| - }.bind(this));
|
| -
|
| - [
|
| - this.printTicketStore_.color,
|
| - this.printTicketStore_.cssBackground,
|
| - this.printTicketStore_.customMargins,
|
| - this.printTicketStore_.fitToPage,
|
| - this.printTicketStore_.headerFooter,
|
| - this.printTicketStore_.landscape,
|
| - this.printTicketStore_.marginsType,
|
| - this.printTicketStore_.pageRange,
|
| - this.printTicketStore_.rasterize,
|
| - this.printTicketStore_.selectionOnly,
|
| - this.printTicketStore_.scaling
|
| - ].forEach(function(setting) {
|
| - this.tracker.add(
|
| - setting,
|
| - print_preview.ticket_items.TicketItem.EventType.CHANGE,
|
| - this.onTicketChange_.bind(this));
|
| - }.bind(this));
|
| + [TicketStoreEvent.INITIALIZE, TicketStoreEvent.TICKET_CHANGE,
|
| + TicketStoreEvent.CAPABILITIES_CHANGE, TicketStoreEvent.DOCUMENT_CHANGE]
|
| + .forEach(function(eventType) {
|
| + this.tracker.add(
|
| + this.printTicketStore_, eventType,
|
| + this.onTicketChange_.bind(this));
|
| + }.bind(this));
|
| +
|
| + [this.printTicketStore_.color, this.printTicketStore_.cssBackground,
|
| + this.printTicketStore_.customMargins, this.printTicketStore_.fitToPage,
|
| + this.printTicketStore_.headerFooter, this.printTicketStore_.landscape,
|
| + this.printTicketStore_.marginsType, this.printTicketStore_.pageRange,
|
| + this.printTicketStore_.rasterize, this.printTicketStore_.selectionOnly,
|
| + this.printTicketStore_.scaling]
|
| + .forEach(function(setting) {
|
| + this.tracker.add(
|
| + setting, print_preview.ticket_items.TicketItem.EventType.CHANGE,
|
| + this.onTicketChange_.bind(this));
|
| + }.bind(this));
|
|
|
| if (this.checkPluginCompatibility_()) {
|
| this.previewGenerator_ = new print_preview.PreviewGenerator(
|
| - this.destinationStore_,
|
| - this.printTicketStore_,
|
| - this.nativeLayer_,
|
| + this.destinationStore_, this.printTicketStore_, this.nativeLayer_,
|
| this.documentInfo_);
|
| this.tracker.add(
|
| this.previewGenerator_,
|
| @@ -441,7 +428,7 @@ cr.define('print_preview', function() {
|
| jumpingDotsEl.classList.add('jumping-dots');
|
| }
|
| var messageEl = this.getElement().getElementsByClassName(
|
| - PreviewArea.MessageIdClassMap_[messageId])[0];
|
| + PreviewArea.MessageIdClassMap_[messageId])[0];
|
| setIsVisible(messageEl, true);
|
|
|
| this.setOverlayVisible_(true);
|
| @@ -454,8 +441,7 @@ cr.define('print_preview', function() {
|
| */
|
| setOverlayVisible_: function(visible) {
|
| this.overlayEl_.classList.toggle(
|
| - PreviewArea.Classes_.INVISIBLE,
|
| - !visible);
|
| + PreviewArea.Classes_.INVISIBLE, !visible);
|
| this.overlayEl_.setAttribute('aria-hidden', !visible);
|
|
|
| // Hide/show all controls that will overlap when the overlay is visible.
|
| @@ -489,7 +475,7 @@ cr.define('print_preview', function() {
|
| return;
|
| }
|
|
|
| - this.plugin_ = /** @type {print_preview.PDFPlugin} */(
|
| + this.plugin_ = /** @type {print_preview.PDFPlugin} */ (
|
| PDFCreateOutOfProcessPlugin(srcUrl));
|
| this.plugin_.setKeyEventCallback(this.keyEventCallback_);
|
|
|
| @@ -500,8 +486,8 @@ cr.define('print_preview', function() {
|
| // chrome/renderer/printing/print_web_view_helper.cc actually references
|
| // it.
|
| this.plugin_.setAttribute('id', 'pdf-viewer');
|
| - this.getChildElement('.preview-area-plugin-wrapper').
|
| - appendChild(/** @type {Node} */(this.plugin_));
|
| + this.getChildElement('.preview-area-plugin-wrapper')
|
| + .appendChild(/** @type {Node} */ (this.plugin_));
|
|
|
|
|
| var pageNumbers =
|
| @@ -510,8 +496,8 @@ cr.define('print_preview', function() {
|
| this.plugin_.setLoadCallback(this.onPluginLoad_.bind(this));
|
| this.plugin_.setViewportChangedCallback(
|
| this.onPreviewVisualStateChange_.bind(this));
|
| - this.plugin_.resetPrintPreviewMode(srcUrl, grayscale, pageNumbers,
|
| - this.documentInfo_.isModifiable);
|
| + this.plugin_.resetPrintPreviewMode(
|
| + srcUrl, grayscale, pageNumbers, this.documentInfo_.isModifiable);
|
| },
|
|
|
| /**
|
| @@ -574,8 +560,8 @@ cr.define('print_preview', function() {
|
| var pageNumbers =
|
| this.printTicketStore_.pageRange.getPageNumberSet().asArray();
|
| var url = event.previewUrl;
|
| - this.plugin_.resetPrintPreviewMode(url, grayscale, pageNumbers,
|
| - this.documentInfo_.isModifiable);
|
| + this.plugin_.resetPrintPreviewMode(
|
| + url, grayscale, pageNumbers, this.documentInfo_.isModifiable);
|
| }
|
| cr.dispatchSimpleEvent(
|
| this, PreviewArea.EventType.PREVIEW_GENERATION_IN_PROGRESS);
|
| @@ -638,11 +624,8 @@ cr.define('print_preview', function() {
|
| * margins component if shown.
|
| * @private
|
| */
|
| - onPreviewVisualStateChange_: function(pageX,
|
| - pageY,
|
| - pageWidth,
|
| - viewportWidth,
|
| - viewportHeight) {
|
| + onPreviewVisualStateChange_: function(
|
| + pageX, pageY, pageWidth, viewportWidth, viewportHeight) {
|
| this.marginControlContainer_.updateTranslationTransform(
|
| new print_preview.Coordinate2d(pageX, pageY));
|
| this.marginControlContainer_.updateScaleTransform(
|
| @@ -669,7 +652,5 @@ cr.define('print_preview', function() {
|
| };
|
|
|
| // Export
|
| - return {
|
| - PreviewArea: PreviewArea
|
| - };
|
| + return {PreviewArea: PreviewArea};
|
| });
|
|
|