OLD | NEW |
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 * Scaling ticket item whose value is a {@code string} that indicates what the | 9 * Scaling ticket item whose value is a {@code string} that indicates what the |
10 * scaling (in percent) of the document should be. The ticket item is backed | 10 * scaling (in percent) of the document should be. The ticket item is backed |
11 * by a string since the user can textually input the scaling value. | 11 * by a string since the user can textually input the scaling value. |
12 * @param {!print_preview.AppState} appState App state to persist item value. | 12 * @param {!print_preview.AppState} appState App state to persist item value. |
13 * @param {!print_preview.DocumentInfo} documentInfo Information about the | 13 * @param {!print_preview.DocumentInfo} documentInfo Information about the |
14 * document to print. | 14 * document to print. |
15 * @param {!print_preview.DestinationStore} destinationStore Used to determine | 15 * @param {!print_preview.DestinationStore} destinationStore Used to determine |
16 * whether fit to page should be available. | 16 * whether fit to page should be available. |
17 * @constructor | 17 * @constructor |
18 * @extends {print_preview.ticket_items.TicketItem} | 18 * @extends {print_preview.ticket_items.TicketItem} |
19 */ | 19 */ |
20 function Scaling(appState, destinationStore, documentInfo) { | 20 function Scaling(appState, destinationStore, documentInfo) { |
21 print_preview.ticket_items.TicketItem.call( | 21 print_preview.ticket_items.TicketItem.call( |
22 this, | 22 this, |
23 appState, | 23 appState, |
24 print_preview.AppState.Field.SCALING, | 24 print_preview.AppStateField.SCALING, |
25 destinationStore, | 25 destinationStore, |
26 documentInfo); | 26 documentInfo); |
27 }; | 27 } |
28 | 28 |
29 Scaling.prototype = { | 29 Scaling.prototype = { |
30 __proto__: print_preview.ticket_items.TicketItem.prototype, | 30 __proto__: print_preview.ticket_items.TicketItem.prototype, |
31 | 31 |
32 /** @override */ | 32 /** @override */ |
33 wouldValueBeValid: function(value) { | 33 wouldValueBeValid: function(value) { |
34 return true; | 34 return true; |
35 }, | 35 }, |
36 | 36 |
37 /** @override */ | 37 /** @override */ |
38 isValueEqual: function(value) { | 38 isValueEqual: function(value) { |
39 return this.getValueAsNumber() == value; | 39 return this.getValueAsNumber() == value; |
40 }, | 40 }, |
41 | 41 |
42 /** @override */ | 42 /** @override */ |
43 isCapabilityAvailable: function() { | 43 isCapabilityAvailable: function() { |
44 // This is not a function of the printer, but should be disabled if we are | 44 // This is not a function of the printer, but should be disabled if we are |
45 // saving a PDF to a PDF. | 45 // saving a PDF to a PDF. |
(...skipping 20 matching lines...) Expand all Loading... |
66 getCapabilityNotAvailableValueInternal: function() { | 66 getCapabilityNotAvailableValueInternal: function() { |
67 return '100'; | 67 return '100'; |
68 }, | 68 }, |
69 }; | 69 }; |
70 | 70 |
71 // Export | 71 // Export |
72 return { | 72 return { |
73 Scaling: Scaling | 73 Scaling: Scaling |
74 }; | 74 }; |
75 }); | 75 }); |
OLD | NEW |