| Index: chrome/browser/resources/print_preview/preview_generator.js
|
| diff --git a/chrome/browser/resources/print_preview/preview_generator.js b/chrome/browser/resources/print_preview/preview_generator.js
|
| index 39c6d697af3175b4f36784c1f47bae38c6ecc46e..f63636aa0cc889ce7dd6fb84b55e76a0724f5fd8 100644
|
| --- a/chrome/browser/resources/print_preview/preview_generator.js
|
| +++ b/chrome/browser/resources/print_preview/preview_generator.js
|
| @@ -18,7 +18,7 @@ cr.define('print_preview', function() {
|
| * @extends {cr.EventTarget}
|
| */
|
| function PreviewGenerator(
|
| - destinationStore, printTicketStore, nativeLayer, documentInfo) {
|
| + destinationStore, printTicketStore, nativeLayer, documentInfo) {
|
| cr.EventTarget.call(this);
|
|
|
| /**
|
| @@ -204,10 +204,8 @@ cr.define('print_preview', function() {
|
|
|
| this.inFlightRequestId_++;
|
| this.nativeLayer_.startGetPreview(
|
| - this.destinationStore_.selectedDestination,
|
| - this.printTicketStore_,
|
| - this.documentInfo_,
|
| - this.inFlightRequestId_);
|
| + this.destinationStore_.selectedDestination, this.printTicketStore_,
|
| + this.documentInfo_, this.inFlightRequestId_);
|
| return true;
|
| },
|
|
|
| @@ -270,13 +268,13 @@ cr.define('print_preview', function() {
|
| * @private
|
| */
|
| dispatchPreviewStartEvent_: function(previewUid, index) {
|
| - var previewStartEvent = new Event(
|
| - PreviewGenerator.EventType.PREVIEW_START);
|
| + var previewStartEvent =
|
| + new Event(PreviewGenerator.EventType.PREVIEW_START);
|
| if (!this.documentInfo_.isModifiable) {
|
| index = -1;
|
| }
|
| - previewStartEvent.previewUrl = 'chrome://print/' +
|
| - previewUid.toString() + '/' + index + '/print.pdf';
|
| + previewStartEvent.previewUrl = 'chrome://print/' + previewUid.toString() +
|
| + '/' + index + '/print.pdf';
|
| this.dispatchEvent(previewStartEvent);
|
| },
|
|
|
| @@ -296,21 +294,21 @@ cr.define('print_preview', function() {
|
| !ticketStore.scaling.isValueEqual(this.scalingValue_) ||
|
| !ticketStore.fitToPage.isValueEqual(this.isFitToPageEnabled_) ||
|
| this.pageRanges_ == null ||
|
| - !areRangesEqual(ticketStore.pageRange.getPageRanges(),
|
| - this.pageRanges_) ||
|
| + !areRangesEqual(
|
| + ticketStore.pageRange.getPageRanges(), this.pageRanges_) ||
|
| (!ticketStore.marginsType.isValueEqual(this.marginsType_) &&
|
| - !ticketStore.marginsType.isValueEqual(
|
| - print_preview.ticket_items.MarginsType.Value.CUSTOM)) ||
|
| + !ticketStore.marginsType.isValueEqual(
|
| + print_preview.ticket_items.MarginsType.Value.CUSTOM)) ||
|
| (ticketStore.marginsType.isValueEqual(
|
| - print_preview.ticket_items.MarginsType.Value.CUSTOM) &&
|
| - !ticketStore.customMargins.isValueEqual(
|
| - this.documentInfo_.margins)) ||
|
| + print_preview.ticket_items.MarginsType.Value.CUSTOM) &&
|
| + !ticketStore.customMargins.isValueEqual(
|
| + this.documentInfo_.margins)) ||
|
| !ticketStore.cssBackground.isValueEqual(
|
| this.isCssBackgroundEnabled_) ||
|
| !ticketStore.selectionOnly.isValueEqual(
|
| this.isSelectionOnlyEnabled_) ||
|
| (this.selectedDestination_ !=
|
| - this.destinationStore_.selectedDestination);
|
| + this.destinationStore_.selectedDestination);
|
| },
|
|
|
| /**
|
| @@ -324,8 +322,7 @@ cr.define('print_preview', function() {
|
| // in-flight request.
|
|
|
| var origin = new print_preview.Coordinate2d(
|
| - event.pageLayout.printableAreaX,
|
| - event.pageLayout.printableAreaY);
|
| + event.pageLayout.printableAreaX, event.pageLayout.printableAreaY);
|
| var size = new print_preview.Size(
|
| event.pageLayout.printableAreaWidth,
|
| event.pageLayout.printableAreaHeight);
|
| @@ -338,16 +335,14 @@ cr.define('print_preview', function() {
|
|
|
| var o = print_preview.ticket_items.CustomMargins.Orientation;
|
| var pageSize = new print_preview.Size(
|
| - event.pageLayout.contentWidth +
|
| - margins.get(o.LEFT) + margins.get(o.RIGHT),
|
| - event.pageLayout.contentHeight +
|
| - margins.get(o.TOP) + margins.get(o.BOTTOM));
|
| + event.pageLayout.contentWidth + margins.get(o.LEFT) +
|
| + margins.get(o.RIGHT),
|
| + event.pageLayout.contentHeight + margins.get(o.TOP) +
|
| + margins.get(o.BOTTOM));
|
|
|
| this.documentInfo_.updatePageInfo(
|
| - new print_preview.PrintableArea(origin, size),
|
| - pageSize,
|
| - event.hasCustomPageSizeStyle,
|
| - margins);
|
| + new print_preview.PrintableArea(origin, size), pageSize,
|
| + event.hasCustomPageSizeStyle, margins);
|
| },
|
|
|
| /**
|
| @@ -358,7 +353,7 @@ cr.define('print_preview', function() {
|
| */
|
| onPageCountReady_: function(event) {
|
| if (this.inFlightRequestId_ != event.previewResponseId) {
|
| - return; // Ignore old response.
|
| + return; // Ignore old response.
|
| }
|
| this.documentInfo_.updatePageCount(event.pageCount);
|
| this.pageRanges_ = this.printTicketStore_.pageRange.getPageRanges();
|
| @@ -372,7 +367,7 @@ cr.define('print_preview', function() {
|
| */
|
| onPagePreviewReady_: function(event) {
|
| if (this.inFlightRequestId_ != event.previewResponseId) {
|
| - return; // Ignore old response.
|
| + return; // Ignore old response.
|
| }
|
| var pageNumber = event.pageIndex + 1;
|
| var pageNumberSet = this.printTicketStore_.pageRange.getPageNumberSet();
|
| @@ -394,7 +389,7 @@ cr.define('print_preview', function() {
|
| */
|
| onPreviewGenerationDone_: function(event) {
|
| if (this.inFlightRequestId_ != event.previewResponseId) {
|
| - return; // Ignore old response.
|
| + return; // Ignore old response.
|
| }
|
| // Dispatch a PREVIEW_START event since non-modifiable documents don't
|
| // trigger PAGE_READY events.
|
| @@ -416,7 +411,5 @@ cr.define('print_preview', function() {
|
| };
|
|
|
| // Export
|
| - return {
|
| - PreviewGenerator: PreviewGenerator
|
| - };
|
| + return {PreviewGenerator: PreviewGenerator};
|
| });
|
|
|