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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 ticketStore.isFitToPageEnabled() != this.isFitToPageEnabled_ || | 251 ticketStore.isFitToPageEnabled() != this.isFitToPageEnabled_ || |
252 !ticketStore.getPageNumberSet().equals(this.pageNumberSet_) || | 252 !ticketStore.getPageNumberSet().equals(this.pageNumberSet_) || |
253 (ticketStore.getMarginsType() != this.marginsType_ && | 253 (ticketStore.getMarginsType() != this.marginsType_ && |
254 ticketStore.getMarginsType() != | 254 ticketStore.getMarginsType() != |
255 print_preview.ticket_items.MarginsType.Value.CUSTOM) || | 255 print_preview.ticket_items.MarginsType.Value.CUSTOM) || |
256 (ticketStore.getMarginsType() == | 256 (ticketStore.getMarginsType() == |
257 print_preview.ticket_items.MarginsType.Value.CUSTOM && | 257 print_preview.ticket_items.MarginsType.Value.CUSTOM && |
258 !ticketStore.getCustomMargins().equals( | 258 !ticketStore.getCustomMargins().equals( |
259 ticketStore.getDocumentMargins())) || | 259 ticketStore.getDocumentMargins())) || |
260 (this.selectedDestination_ != | 260 (this.selectedDestination_ != |
261 this.destinationStore_.selectedDestination && | 261 this.destinationStore_.selectedDestination); |
262 (this.destinationStore_.selectedDestination.id == | |
263 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF || | |
264 this.selectedDestination_.id == | |
265 print_preview.Destination.GooglePromotedId.SAVE_AS_PDF)); | |
266 }, | 262 }, |
267 | 263 |
268 /** | 264 /** |
269 * Called when the page layout of the document is ready. Always occurs | 265 * Called when the page layout of the document is ready. Always occurs |
270 * as a result of a preview request. | 266 * as a result of a preview request. |
271 * @param {cr.Event} event Contains layout info about the document. | 267 * @param {cr.Event} event Contains layout info about the document. |
272 * @private | 268 * @private |
273 */ | 269 */ |
274 onPageLayoutReady_: function(event) { | 270 onPageLayoutReady_: function(event) { |
275 // NOTE: A request ID is not specified, so assuming its for the current | 271 // NOTE: A request ID is not specified, so assuming its for the current |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 // current one. | 380 // current one. |
385 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL); | 381 cr.dispatchSimpleEvent(this, PreviewGenerator.EventType.FAIL); |
386 } | 382 } |
387 }; | 383 }; |
388 | 384 |
389 // Export | 385 // Export |
390 return { | 386 return { |
391 PreviewGenerator: PreviewGenerator | 387 PreviewGenerator: PreviewGenerator |
392 }; | 388 }; |
393 }); | 389 }); |
OLD | NEW |