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 * Ticket item whose value is a {@code boolean} that represents whether to | 9 * Ticket item whose value is a {@code boolean} that represents whether to |
10 * print selection only. | 10 * print selection only. |
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 SelectionOnly(documentInfo) { | 16 function SelectionOnly(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 SelectionOnly.prototype = { | 22 SelectionOnly.prototype = { |
26 __proto__: print_preview.ticket_items.TicketItem.prototype, | 23 __proto__: print_preview.ticket_items.TicketItem.prototype, |
27 | 24 |
28 /** @override */ | 25 /** @override */ |
29 wouldValueBeValid: function(value) { | 26 wouldValueBeValid: function(value) { |
30 return true; | 27 return true; |
31 }, | 28 }, |
32 | 29 |
33 /** @override */ | 30 /** @override */ |
34 isCapabilityAvailable: function() { | 31 isCapabilityAvailable: function() { |
35 return this.getDocumentInfoInternal().isModifiable && | 32 return this.getDocumentInfoInternal().isModifiable && |
36 this.getDocumentInfoInternal().hasSelection; | 33 this.getDocumentInfoInternal().hasSelection; |
37 }, | 34 }, |
38 | 35 |
39 /** @override */ | 36 /** @override */ |
40 getDefaultValueInternal: function() { | 37 getDefaultValueInternal: function() { |
41 return false; | 38 return false; |
42 }, | 39 }, |
43 | 40 |
44 /** @override */ | 41 /** @override */ |
45 getCapabilityNotAvailableValueInternal: function() { | 42 getCapabilityNotAvailableValueInternal: function() { |
46 return false; | 43 return false; |
47 } | 44 } |
48 }; | 45 }; |
49 | 46 |
50 // Export | 47 // Export |
51 return { | 48 return {SelectionOnly: SelectionOnly}; |
52 SelectionOnly: SelectionOnly | |
53 }; | |
54 }); | 49 }); |
OLD | NEW |