Chromium Code Reviews| 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 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or | 8 // TODO(rltoscano): Maybe clear print ticket when destination changes. Or |
| 9 // better yet, carry over any print ticket state that is possible. I.e. if | 9 // better yet, carry over any print ticket state that is possible. I.e. if |
| 10 // destination changes, the new destination might not support duplex anymore, | 10 // destination changes, the new destination might not support duplex anymore, |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 // will be valid even if no preview can be generated. | 44 // will be valid even if no preview can be generated. |
| 45 var initialPageSize = new print_preview.Size(612, 792); // 8.5"x11" | 45 var initialPageSize = new print_preview.Size(612, 792); // 8.5"x11" |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * Information about the document to print. | 48 * Information about the document to print. |
| 49 * @type {!print_preview.DocumentInfo} | 49 * @type {!print_preview.DocumentInfo} |
| 50 * @private | 50 * @private |
| 51 */ | 51 */ |
| 52 this.documentInfo_ = new print_preview.DocumentInfo(); | 52 this.documentInfo_ = new print_preview.DocumentInfo(); |
| 53 this.documentInfo_.isModifiable = true; | 53 this.documentInfo_.isModifiable = true; |
| 54 this.documentInfo_.pageCount = 1; | 54 this.documentInfo_.pageCount = 0; |
| 55 this.documentInfo_.pageSize = initialPageSize; | 55 this.documentInfo_.pageSize = initialPageSize; |
| 56 this.documentInfo_.printableArea = new print_preview.PrintableArea( | 56 this.documentInfo_.printableArea = new print_preview.PrintableArea( |
| 57 new print_preview.Coordinate2d(0, 0), initialPageSize); | 57 new print_preview.Coordinate2d(0, 0), initialPageSize); |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Printing capabilities of Chromium and the currently selected destination. | 60 * Printing capabilities of Chromium and the currently selected destination. |
| 61 * @type {!print_preview.CapabilitiesHolder} | 61 * @type {!print_preview.CapabilitiesHolder} |
| 62 * @private | 62 * @private |
| 63 */ | 63 */ |
| 64 this.capabilitiesHolder_ = new print_preview.CapabilitiesHolder(); | 64 this.capabilitiesHolder_ = new print_preview.CapabilitiesHolder(); |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 580 }, | 580 }, |
| 581 | 581 |
| 582 /** | 582 /** |
| 583 * @return {boolean} Whether the current page range string is defines a | 583 * @return {boolean} Whether the current page range string is defines a |
| 584 * valid page number set. | 584 * valid page number set. |
| 585 */ | 585 */ |
| 586 isPageRangeValid: function() { | 586 isPageRangeValid: function() { |
| 587 return this.pageRange_.isValid(); | 587 return this.pageRange_.isValid(); |
| 588 }, | 588 }, |
| 589 | 589 |
| 590 /** @return {string} String representation of the page range. */ | 590 /** |
| 591 getPageRangeStr: function() { | 591 * @return {!print_preview.ticket_items.PageRange} Current page ranges. |
| 592 return this.pageRange_.getValue(); | 592 */ |
| 593 getPageRange: function() { | |
|
Toscano
2013/02/11 21:25:13
This is not consistent. None of the ticket_items a
Vitaly Buka (NO REVIEWS)
2013/02/12 00:46:44
Done.
| |
| 594 return this.pageRange_; | |
| 593 }, | 595 }, |
| 594 | 596 |
| 595 /** | 597 /** |
| 596 * @return {!print_preview.PageNumberSet} Page number set specified by the | 598 * @return {!print_preview.PageNumberSet} Page number set specified by the |
| 597 * string representation of the page range string. | 599 * string representation of the page range string. |
| 598 */ | 600 */ |
| 599 getPageNumberSet: function() { | 601 getPageNumberSet: function() { |
| 600 return this.pageRange_.getPageNumberSet(); | 602 return this.pageRange_.getPageNumberSet(); |
| 601 }, | 603 }, |
| 602 | 604 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 744 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE); | 746 this, PrintTicketStore.EventType.CAPABILITIES_CHANGE); |
| 745 } | 747 } |
| 746 } | 748 } |
| 747 }; | 749 }; |
| 748 | 750 |
| 749 // Export | 751 // Export |
| 750 return { | 752 return { |
| 751 PrintTicketStore: PrintTicketStore | 753 PrintTicketStore: PrintTicketStore |
| 752 }; | 754 }; |
| 753 }); | 755 }); |
| OLD | NEW |