| 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. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 }, | 96 }, |
| 97 | 97 |
| 98 /** @override */ | 98 /** @override */ |
| 99 updateValueInternal: function(value) { | 99 updateValueInternal: function(value) { |
| 100 var updateMargins = !this.isValueEqual(value); | 100 var updateMargins = !this.isValueEqual(value); |
| 101 print_preview.ticket_items.TicketItem.prototype.updateValueInternal.call( | 101 print_preview.ticket_items.TicketItem.prototype.updateValueInternal.call( |
| 102 this, value); | 102 this, value); |
| 103 if (updateMargins) { | 103 if (updateMargins) { |
| 104 // Reset the user set margins when page orientation changes. | 104 // Reset the user set margins when page orientation changes. |
| 105 this.marginsType_.updateValue( | 105 this.marginsType_.updateValue( |
| 106 print_preview.ticket_items.MarginsType.Value.DEFAULT); | 106 print_preview.ticket_items.MarginsTypeValue.DEFAULT); |
| 107 this.customMargins_.updateValue(null); | 107 this.customMargins_.updateValue(null); |
| 108 } | 108 } |
| 109 }, | 109 }, |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * @return {boolean} Whether capability contains the |value|. | 112 * @return {boolean} Whether capability contains the |value|. |
| 113 * @param {string} value Option to check. | 113 * @param {string} value Option to check. |
| 114 */ | 114 */ |
| 115 hasOption: function(value) { | 115 hasOption: function(value) { |
| 116 var cap = this.getPageOrientationCapability_(); | 116 var cap = this.getPageOrientationCapability_(); |
| (...skipping 16 matching lines...) Expand all 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 |