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. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 getDefaultValueInternal: function() { | 58 getDefaultValueInternal: function() { |
59 return ''; | 59 return ''; |
60 }, | 60 }, |
61 | 61 |
62 /** @override */ | 62 /** @override */ |
63 getCapabilityNotAvailableValueInternal: function() { | 63 getCapabilityNotAvailableValueInternal: function() { |
64 return ''; | 64 return ''; |
65 }, | 65 }, |
66 | 66 |
67 /** | 67 /** |
68 * @return {!Array.<Object.<{from: number, to: number}>>} A list of page | 68 * @return {!Array<Object<{from: number, to: number}>>} A list of page |
69 * ranges. | 69 * ranges. |
70 */ | 70 */ |
71 getPageRanges: function() { | 71 getPageRanges: function() { |
72 return pageRangeTextToPageRanges(this.getValue()) || []; | 72 return pageRangeTextToPageRanges(this.getValue()) || []; |
73 }, | 73 }, |
74 | 74 |
75 /** | 75 /** |
76 * @return {!Array.<object.<{from: number, to: number}>>} A list of page | 76 * @return {!Array<object<{from: number, to: number}>>} A list of page |
77 * ranges suitable for use in the native layer. | 77 * ranges suitable for use in the native layer. |
78 * TODO(vitalybuka): this should be removed when native layer switched to | 78 * TODO(vitalybuka): this should be removed when native layer switched to |
79 * page ranges. | 79 * page ranges. |
80 */ | 80 */ |
81 getDocumentPageRanges: function() { | 81 getDocumentPageRanges: function() { |
82 var pageRanges = pageRangeTextToPageRanges( | 82 var pageRanges = pageRangeTextToPageRanges( |
83 this.getValue(), this.getDocumentInfoInternal().pageCount); | 83 this.getValue(), this.getDocumentInfoInternal().pageCount); |
84 return pageRanges || []; | 84 return pageRanges || []; |
85 }, | 85 }, |
86 }; | 86 }; |
87 | 87 |
88 // Export | 88 // Export |
89 return { | 89 return { |
90 PageRange: PageRange | 90 PageRange: PageRange |
91 }; | 91 }; |
92 }); | 92 }); |
OLD | NEW |