Chromium Code Reviews| Index: chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js |
| diff --git a/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js b/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js |
| index 3185ca2c3b913b1d1e44206f93ba43431a871a65..83e0aaf4a7c2c679bb7b14e2820779df1a3ff9e9 100644 |
| --- a/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js |
| +++ b/chrome/browser/resources/print_preview/settings/advanced_settings/advanced_settings.js |
| @@ -37,7 +37,7 @@ cr.define('print_preview', function() { |
| /** @private {!Array<!print_preview.AdvancedSettingsItem>} */ |
| this.items_ = []; |
| - }; |
| + } |
| /** |
| * CSS classes used by the component. |
| @@ -70,24 +70,24 @@ cr.define('print_preview', function() { |
| print_preview.Overlay.prototype.enterDocument.call(this); |
| this.tracker.add( |
| - this.getChildElement('.button-strip .cancel-button'), |
| + assert(this.getChildElement('.button-strip .cancel-button')), |
|
dpapad
2017/05/04 01:20:04
Follow up from previous comment: if we make getChi
rbpotter
2017/05/04 01:43:07
Acknowledged - will investigate getChildElement an
|
| 'click', |
| this.cancel.bind(this)); |
| this.tracker.add( |
| - this.getChildElement('.button-strip .done-button'), |
| + assert(this.getChildElement('.button-strip .done-button')), |
| 'click', |
| this.onApplySettings_.bind(this)); |
| this.tracker.add( |
| - this.searchBox_, |
| + assert(this.searchBox_), |
| print_preview.SearchBox.EventType.SEARCH, |
| this.onSearch_.bind(this)); |
| }, |
| /** @override */ |
| decorateInternal: function() { |
| - this.searchBox_.render(this.getChildElement('.search-box-area')); |
| + this.searchBox_.render(assert(this.getChildElement('.search-box-area'))); |
| }, |
| /** @override */ |
| @@ -131,7 +131,7 @@ cr.define('print_preview', function() { |
| /** |
| * Filters displayed settings with the given query. |
| - * @param {?string} query Query to filter settings by. |
| + * @param {?RegExp} query Query to filter settings by. |
| * @private |
| */ |
| filterLists_: function(query) { |
| @@ -145,9 +145,11 @@ cr.define('print_preview', function() { |
| lastVisibleItemWithBubble = item; |
| }); |
| setIsVisible( |
| - this.getChildElement('.no-settings-match-hint'), !atLeastOneMatch); |
| + assert(this.getChildElement('.no-settings-match-hint')), |
| + !atLeastOneMatch); |
| setIsVisible( |
| - this.getChildElement('.' + AdvancedSettings.Classes_.EXTRA_PADDING), |
| + assert(this.getChildElement( |
| + '.' + AdvancedSettings.Classes_.EXTRA_PADDING)), |
| !!lastVisibleItemWithBubble); |
| }, |
| @@ -187,16 +189,16 @@ cr.define('print_preview', function() { |
| vendorCapabilities.forEach(function(capability) { |
| var item = new print_preview.AdvancedSettingsItem( |
| - this.eventTarget_, this.printTicketStore_, capability); |
| + this.printTicketStore_, capability); |
| this.addChild(item); |
| - item.render(settingsEl); |
| + item.render(assert(settingsEl)); |
| this.items_.push(item); |
| }.bind(this)); |
| if (this.items_.length <= 1) { |
| - setIsVisible(this.getChildElement('.search-box-area'), false); |
| + setIsVisible(assert(this.getChildElement('.search-box-area')), false); |
|
dpapad
2017/05/04 01:20:04
Nit: Assertions are not free. Perhaps use a local
rbpotter
2017/05/04 01:43:06
Done.
|
| } else { |
| - setIsVisible(this.getChildElement('.search-box-area'), true); |
| + setIsVisible(assert(this.getChildElement('.search-box-area')), true); |
| this.searchBox_.focus(); |
| } |