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.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Interface to the Chromium print preview generator. | 9 * Interface to the Chromium print preview generator. |
10 * @param {!print_preview.DestinationStore} destinationStore Used to get the | 10 * @param {!print_preview.DestinationStore} destinationStore Used to get the |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 /** | 103 /** |
104 * Page ranges setting used used to generate the last preview. | 104 * Page ranges setting used used to generate the last preview. |
105 * @type {!Array<object<{from: number, to: number}>>} | 105 * @type {!Array<object<{from: number, to: number}>>} |
106 * @private | 106 * @private |
107 */ | 107 */ |
108 this.pageRanges_ = null; | 108 this.pageRanges_ = null; |
109 | 109 |
110 /** | 110 /** |
111 * Margins type used to generate the last preview. | 111 * Margins type used to generate the last preview. |
112 * @type {!print_preview.ticket_items.MarginsType.Value} | 112 * @type {!print_preview.ticket_items.MarginsTypeValue} |
113 * @private | 113 * @private |
114 */ | 114 */ |
115 this.marginsType_ = print_preview.ticket_items.MarginsType.Value.DEFAULT; | 115 this.marginsType_ = print_preview.ticket_items.MarginsTypeValue.DEFAULT; |
116 | 116 |
117 /** | 117 /** |
118 * Whether the document should have element CSS backgrounds printed. | 118 * Whether the document should have element CSS backgrounds printed. |
119 * @type {boolean} | 119 * @type {boolean} |
120 * @private | 120 * @private |
121 */ | 121 */ |
122 this.isCssBackgroundEnabled_ = false; | 122 this.isCssBackgroundEnabled_ = false; |
123 | 123 |
124 /** | 124 /** |
125 * Destination that was selected for the last preview. | 125 * Destination that was selected for the last preview. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 !ticketStore.landscape.isValueEqual(this.isLandscapeEnabled_) || | 284 !ticketStore.landscape.isValueEqual(this.isLandscapeEnabled_) || |
285 !ticketStore.headerFooter.isValueEqual(this.isHeaderFooterEnabled_) || | 285 !ticketStore.headerFooter.isValueEqual(this.isHeaderFooterEnabled_) || |
286 !ticketStore.color.isValueEqual(this.colorValue_) || | 286 !ticketStore.color.isValueEqual(this.colorValue_) || |
287 !ticketStore.scaling.isValueEqual(this.scalingValue_) || | 287 !ticketStore.scaling.isValueEqual(this.scalingValue_) || |
288 !ticketStore.fitToPage.isValueEqual(this.isFitToPageEnabled_) || | 288 !ticketStore.fitToPage.isValueEqual(this.isFitToPageEnabled_) || |
289 this.pageRanges_ == null || | 289 this.pageRanges_ == null || |
290 !areRangesEqual(ticketStore.pageRange.getPageRanges(), | 290 !areRangesEqual(ticketStore.pageRange.getPageRanges(), |
291 this.pageRanges_) || | 291 this.pageRanges_) || |
292 (!ticketStore.marginsType.isValueEqual(this.marginsType_) && | 292 (!ticketStore.marginsType.isValueEqual(this.marginsType_) && |
293 !ticketStore.marginsType.isValueEqual( | 293 !ticketStore.marginsType.isValueEqual( |
294 print_preview.ticket_items.MarginsType.Value.CUSTOM)) || | 294 print_preview.ticket_items.MarginsTypeValue.CUSTOM)) || |
295 (ticketStore.marginsType.isValueEqual( | 295 (ticketStore.marginsType.isValueEqual( |
296 print_preview.ticket_items.MarginsType.Value.CUSTOM) && | 296 print_preview.ticket_items.MarginsTypeValue.CUSTOM) && |
297 !ticketStore.customMargins.isValueEqual( | 297 !ticketStore.customMargins.isValueEqual( |
298 this.documentInfo_.margins)) || | 298 this.documentInfo_.margins)) || |
299 !ticketStore.cssBackground.isValueEqual( | 299 !ticketStore.cssBackground.isValueEqual( |
300 this.isCssBackgroundEnabled_) || | 300 this.isCssBackgroundEnabled_) || |
301 !ticketStore.selectionOnly.isValueEqual( | 301 !ticketStore.selectionOnly.isValueEqual( |
302 this.isSelectionOnlyEnabled_) || | 302 this.isSelectionOnlyEnabled_) || |
303 (this.selectedDestination_ != | 303 (this.selectedDestination_ != |
304 this.destinationStore_.selectedDestination); | 304 this.destinationStore_.selectedDestination); |
305 }, | 305 }, |
306 | 306 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // current one. | 404 // current one. |
405 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL); | 405 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL); |
406 } | 406 } |
407 }; | 407 }; |
408 | 408 |
409 // Export | 409 // Export |
410 return { | 410 return { |
411 PreviewGenerator: PreviewGenerator | 411 PreviewGenerator: PreviewGenerator |
412 }; | 412 }; |
413 }); | 413 }); |
OLD | NEW |