| 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 /** | 5 /** |
| 6 * @typedef {Object|number|boolean|string} | 6 * @typedef {Object|number|boolean|string} |
| 7 */ | 7 */ |
| 8 print_preview.ValueType; | 8 print_preview.ValueType; |
| 9 | 9 |
| 10 cr.define('print_preview.ticket_items', function() { | 10 cr.define('print_preview.ticket_items', function() { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 throw Error('Abstract method not overridden'); | 98 throw Error('Abstract method not overridden'); |
| 99 }, | 99 }, |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * @return {boolean} Whether the print destination capability is available. | 102 * @return {boolean} Whether the print destination capability is available. |
| 103 */ | 103 */ |
| 104 isCapabilityAvailable: function() { | 104 isCapabilityAvailable: function() { |
| 105 throw Error('Abstract method not overridden'); | 105 throw Error('Abstract method not overridden'); |
| 106 }, | 106 }, |
| 107 | 107 |
| 108 /** @return {!Object} The value of the ticket item. */ | 108 /** @return {print_preview.ValueType} The value of the ticket item. */ |
| 109 getValue: function() { | 109 getValue: function() { |
| 110 if (this.isCapabilityAvailable()) { | 110 if (this.isCapabilityAvailable()) { |
| 111 if (this.value_ == null) { | 111 if (this.value_ == null) { |
| 112 return this.getDefaultValueInternal(); | 112 return this.getDefaultValueInternal(); |
| 113 } else { | 113 } else { |
| 114 return this.value_; | 114 return this.value_; |
| 115 } | 115 } |
| 116 } else { | 116 } else { |
| 117 return this.getCapabilityNotAvailableValueInternal(); | 117 return this.getCapabilityNotAvailableValueInternal(); |
| 118 } | 118 } |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 this.dispatchChangeEventInternal.bind(this)); | 239 this.dispatchChangeEventInternal.bind(this)); |
| 240 } | 240 } |
| 241 }, | 241 }, |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 // Export | 244 // Export |
| 245 return { | 245 return { |
| 246 TicketItem: TicketItem | 246 TicketItem: TicketItem |
| 247 }; | 247 }; |
| 248 }); | 248 }); |
| OLD | NEW |