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 * Landscape ticket item whose value is a {@code boolean} that indicates | 9 * Landscape ticket item whose value is a {@code boolean} that indicates |
10 * whether the document should be printed in landscape orientation. | 10 * whether the document should be printed in landscape orientation. |
11 * @param {!print_preview.AppState} appState App state object used to persist | 11 * @param {!print_preview.AppState} appState App state object used to persist |
12 * ticket item values. | 12 * ticket item values. |
13 * @param {!print_preview.DestinationStore} destinationStore Destination store | 13 * @param {!print_preview.DestinationStore} destinationStore Destination store |
14 * used to determine the default landscape value and if landscape | 14 * used to determine the default landscape value and if landscape |
15 * printing is available. | 15 * printing is available. |
16 * @param {!print_preview.DocumentInfo} documentInfo Information about the | 16 * @param {!print_preview.DocumentInfo} documentInfo Information about the |
17 * document to print. | 17 * document to print. |
18 * @param {!print_preview.ticket_items.MarginsType} marginsType Reset when | 18 * @param {!print_preview.ticket_items.MarginsType} marginsType Reset when |
19 * landscape value changes. | 19 * landscape value changes. |
20 * @param {!print_preview.ticket_items.CustomMargins} customMargins Reset when | 20 * @param {!print_preview.ticket_items.CustomMargins} customMargins Reset when |
21 * landscape value changes. | 21 * landscape value changes. |
22 * @constructor | 22 * @constructor |
23 * @extends {print_preview.ticket_items.TicketItem} | 23 * @extends {print_preview.ticket_items.TicketItem} |
24 */ | 24 */ |
25 function Landscape(appState, destinationStore, documentInfo, marginsType, | 25 function Landscape(appState, destinationStore, documentInfo, marginsType, |
26 customMargins) { | 26 customMargins) { |
27 print_preview.ticket_items.TicketItem.call( | 27 print_preview.ticket_items.TicketItem.call( |
28 this, | 28 this, |
29 appState, | 29 appState, |
30 print_preview.AppState.Field.IS_LANDSCAPE_ENABLED, | 30 print_preview.AppStateField.IS_LANDSCAPE_ENABLED, |
31 destinationStore, | 31 destinationStore, |
32 documentInfo); | 32 documentInfo); |
33 | 33 |
34 /** | 34 /** |
35 * Margins ticket item. Reset when landscape ticket item changes. | 35 * Margins ticket item. Reset when landscape ticket item changes. |
36 * @type {!print_preview.ticket_items.MarginsType} | 36 * @type {!print_preview.ticket_items.MarginsType} |
37 * @private | 37 * @private |
38 */ | 38 */ |
39 this.marginsType_ = marginsType; | 39 this.marginsType_ = marginsType; |
40 | 40 |
41 /** | 41 /** |
42 * Custom margins ticket item. Reset when landscape ticket item changes. | 42 * Custom margins ticket item. Reset when landscape ticket item changes. |
43 * @type {!print_preview.ticket_items.CustomMargins} | 43 * @type {!print_preview.ticket_items.CustomMargins} |
44 * @private | 44 * @private |
45 */ | 45 */ |
46 this.customMargins_ = customMargins; | 46 this.customMargins_ = customMargins; |
47 }; | 47 } |
48 | 48 |
49 Landscape.prototype = { | 49 Landscape.prototype = { |
50 __proto__: print_preview.ticket_items.TicketItem.prototype, | 50 __proto__: print_preview.ticket_items.TicketItem.prototype, |
51 | 51 |
52 /** @override */ | 52 /** @override */ |
53 wouldValueBeValid: function(value) { | 53 wouldValueBeValid: function(value) { |
54 return true; | 54 return true; |
55 }, | 55 }, |
56 | 56 |
57 /** @override */ | 57 /** @override */ |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 dest.capabilities.printer.page_orientation) || | 133 dest.capabilities.printer.page_orientation) || |
134 null; | 134 null; |
135 } | 135 } |
136 }; | 136 }; |
137 | 137 |
138 // Export | 138 // Export |
139 return { | 139 return { |
140 Landscape: Landscape | 140 Landscape: Landscape |
141 }; | 141 }; |
142 }); | 142 }); |
OLD | NEW |