| 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 CSS backgrounds. | 10 * print CSS backgrounds. |
| 11 * @param {!print_preview.AppState} appState App state to persist CSS | 11 * @param {!print_preview.AppState} appState App state to persist CSS |
| 12 * background value. | 12 * background 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 * @constructor | 15 * @constructor |
| 16 * @extends {print_preview.ticket_items.TicketItem} | 16 * @extends {print_preview.ticket_items.TicketItem} |
| 17 */ | 17 */ |
| 18 function CssBackground(appState, documentInfo) { | 18 function CssBackground(appState, documentInfo) { |
| 19 print_preview.ticket_items.TicketItem.call( | 19 print_preview.ticket_items.TicketItem.call( |
| 20 this, | 20 this, appState, print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED, |
| 21 appState, | 21 null /*destinationStore*/, documentInfo); |
| 22 print_preview.AppState.Field.IS_CSS_BACKGROUND_ENABLED, | |
| 23 null /*destinationStore*/, | |
| 24 documentInfo); | |
| 25 }; | 22 }; |
| 26 | 23 |
| 27 CssBackground.prototype = { | 24 CssBackground.prototype = { |
| 28 __proto__: print_preview.ticket_items.TicketItem.prototype, | 25 __proto__: print_preview.ticket_items.TicketItem.prototype, |
| 29 | 26 |
| 30 /** @override */ | 27 /** @override */ |
| 31 wouldValueBeValid: function(value) { | 28 wouldValueBeValid: function(value) { |
| 32 return true; | 29 return true; |
| 33 }, | 30 }, |
| 34 | 31 |
| 35 /** @override */ | 32 /** @override */ |
| 36 isCapabilityAvailable: function() { | 33 isCapabilityAvailable: function() { |
| 37 return this.getDocumentInfoInternal().isModifiable; | 34 return this.getDocumentInfoInternal().isModifiable; |
| 38 }, | 35 }, |
| 39 | 36 |
| 40 /** @override */ | 37 /** @override */ |
| 41 getDefaultValueInternal: function() { | 38 getDefaultValueInternal: function() { |
| 42 return false; | 39 return false; |
| 43 }, | 40 }, |
| 44 | 41 |
| 45 /** @override */ | 42 /** @override */ |
| 46 getCapabilityNotAvailableValueInternal: function() { | 43 getCapabilityNotAvailableValueInternal: function() { |
| 47 return false; | 44 return false; |
| 48 } | 45 } |
| 49 }; | 46 }; |
| 50 | 47 |
| 51 // Export | 48 // Export |
| 52 return { | 49 return {CssBackground: CssBackground}; |
| 53 CssBackground: CssBackground | |
| 54 }; | |
| 55 }); | 50 }); |
| OLD | NEW |