| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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', function() { | 5 cr.define('print_preview', function() { |
| 6 'use strict'; | 6 'use strict'; |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Modal dialog for print destination's advanced settings. | 9 * Modal dialog for print destination's advanced settings. |
| 10 * @param {!print_preview.PrintTicketStore} printTicketStore Contains the | 10 * @param {!print_preview.PrintTicketStore} printTicketStore Contains the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 this.printTicketStore_ = printTicketStore; | 22 this.printTicketStore_ = printTicketStore; |
| 23 | 23 |
| 24 /** | 24 /** |
| 25 * Used to record usage statistics. | 25 * Used to record usage statistics. |
| 26 * @private {!print_preview.PrintSettingsUiMetricsContext} | 26 * @private {!print_preview.PrintSettingsUiMetricsContext} |
| 27 */ | 27 */ |
| 28 this.metrics_ = new print_preview.PrintSettingsUiMetricsContext(); | 28 this.metrics_ = new print_preview.PrintSettingsUiMetricsContext(); |
| 29 | 29 |
| 30 /** @private {!print_preview.SearchBox} */ | 30 /** @private {!print_preview.SearchBox} */ |
| 31 this.searchBox_ = new print_preview.SearchBox( | 31 this.searchBox_ = new print_preview.SearchBox( |
| 32 localStrings.getString('advancedSettingsSearchBoxPlaceholder')); | 32 loadTimeData.getString('advancedSettingsSearchBoxPlaceholder')); |
| 33 this.addChild(this.searchBox_); | 33 this.addChild(this.searchBox_); |
| 34 | 34 |
| 35 /** @private {print_preview.Destination} */ | 35 /** @private {print_preview.Destination} */ |
| 36 this.destination_ = null; | 36 this.destination_ = null; |
| 37 | 37 |
| 38 /** @private {!Array.<!print_preview.AdvancedSettingsItem>} */ | 38 /** @private {!Array.<!print_preview.AdvancedSettingsItem>} */ |
| 39 this.items_ = []; | 39 this.items_ = []; |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * CSS classes used by the component. | 43 * CSS classes used by the component. |
| 44 * @enum {string} | 44 * @enum {string} |
| 45 * @private | 45 * @private |
| 46 */ | 46 */ |
| 47 AdvancedSettings.Classes_ = { | 47 AdvancedSettings.Classes_ = { |
| 48 EXTRA_PADDING: 'advanced-settings-item-extra-padding' | 48 EXTRA_PADDING: 'advanced-settings-item-extra-padding' |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 AdvancedSettings.prototype = { | 51 AdvancedSettings.prototype = { |
| 52 __proto__: print_preview.Overlay.prototype, | 52 __proto__: print_preview.Overlay.prototype, |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * @param {!print_preview.Destination} destination Destination to show | 55 * @param {!print_preview.Destination} destination Destination to show |
| 56 * advanced settings for. | 56 * advanced settings for. |
| 57 */ | 57 */ |
| 58 showForDestination: function(destination) { | 58 showForDestination: function(destination) { |
| 59 assert(!this.destination_); | 59 assert(!this.destination_); |
| 60 this.destination_ = destination; | 60 this.destination_ = destination; |
| 61 this.getChildElement('.advanced-settings-title').textContent = | 61 this.getChildElement('.advanced-settings-title').textContent = |
| 62 localStrings.getStringF('advancedSettingsDialogTitle', | 62 loadTimeData.getStringF('advancedSettingsDialogTitle', |
| 63 this.destination_.displayName); | 63 this.destination_.displayName); |
| 64 this.setIsVisible(true); | 64 this.setIsVisible(true); |
| 65 this.renderSettings_(); | 65 this.renderSettings_(); |
| 66 }, | 66 }, |
| 67 | 67 |
| 68 /** @override */ | 68 /** @override */ |
| 69 enterDocument: function() { | 69 enterDocument: function() { |
| 70 print_preview.Overlay.prototype.enterDocument.call(this); | 70 print_preview.Overlay.prototype.enterDocument.call(this); |
| 71 | 71 |
| 72 this.tracker.add( | 72 this.tracker.add( |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 | 224 |
| 225 this.printTicketStore_.vendorItems.updateValue(values); | 225 this.printTicketStore_.vendorItems.updateValue(values); |
| 226 } | 226 } |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 // Export | 229 // Export |
| 230 return { | 230 return { |
| 231 AdvancedSettings: AdvancedSettings | 231 AdvancedSettings: AdvancedSettings |
| 232 }; | 232 }; |
| 233 }); | 233 }); |
| OLD | NEW |