| 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.ticket_items', function() { | 5 cr.define('print_preview.ticket_items', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Page range ticket item whose value is a {@code string} that represents | 9 * Page range ticket item whose value is a {@code string} that represents |
| 10 * which pages in the document should be printed. | 10 * which pages in the document should be printed. |
| 11 * @param {!print_preview.DocumentInfo} documentInfo Information about the | 11 * @param {!print_preview.DocumentInfo} documentInfo Information about the |
| 12 * document to print. | 12 * document to print. |
| 13 * @constructor | 13 * @constructor |
| 14 * @extends {print_preview.ticket_items.TicketItem} | 14 * @extends {print_preview.ticket_items.TicketItem} |
| 15 */ | 15 */ |
| 16 function PageRange(documentInfo) { | 16 function PageRange(documentInfo) { |
| 17 print_preview.ticket_items.TicketItem.call( | 17 print_preview.ticket_items.TicketItem.call( |
| 18 this, | 18 this, null /*appState*/, null /*field*/, null /*destinationStore*/, |
| 19 null /*appState*/, | |
| 20 null /*field*/, | |
| 21 null /*destinationStore*/, | |
| 22 documentInfo); | 19 documentInfo); |
| 23 }; | 20 }; |
| 24 | 21 |
| 25 /** | 22 /** |
| 26 * Impossibly large page number. | 23 * Impossibly large page number. |
| 27 * @type {number} | 24 * @type {number} |
| 28 * @const | 25 * @const |
| 29 * @private | 26 * @private |
| 30 */ | 27 */ |
| 31 PageRange.MAX_PAGE_NUMBER_ = 1000000000; | 28 PageRange.MAX_PAGE_NUMBER_ = 1000000000; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 getDocumentNumPages: function() { | 89 getDocumentNumPages: function() { |
| 93 return this.getDocumentInfoInternal().pageCount; | 90 return this.getDocumentInfoInternal().pageCount; |
| 94 }, | 91 }, |
| 95 | 92 |
| 96 /** | 93 /** |
| 97 * @return {!PageRangeStatus} | 94 * @return {!PageRangeStatus} |
| 98 */ | 95 */ |
| 99 checkValidity: function() { | 96 checkValidity: function() { |
| 100 var pageRanges = pageRangeTextToPageRanges( | 97 var pageRanges = pageRangeTextToPageRanges( |
| 101 this.getValue(), this.getDocumentInfoInternal().pageCount); | 98 this.getValue(), this.getDocumentInfoInternal().pageCount); |
| 102 return pageRanges instanceof Array ? | 99 return pageRanges instanceof Array ? PageRangeStatus.NO_ERROR : |
| 103 PageRangeStatus.NO_ERROR : pageRanges; | 100 pageRanges; |
| 104 }, | 101 }, |
| 105 }; | 102 }; |
| 106 | 103 |
| 107 // Export | 104 // Export |
| 108 return { | 105 return {PageRange: PageRange}; |
| 109 PageRange: PageRange | |
| 110 }; | |
| 111 }); | 106 }); |
| OLD | NEW |