Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @fileoverview | 6 * @fileoverview |
| 7 * 'settings-basic-page' is the settings page containing the actual settings. | 7 * 'settings-basic-page' is the settings page containing the actual settings. |
| 8 */ | 8 */ |
| 9 Polymer({ | 9 Polymer({ |
| 10 is: 'settings-basic-page', | 10 is: 'settings-basic-page', |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 * @param {string} query The text to search for. | 95 * @param {string} query The text to search for. |
| 96 * @return {!Promise<!settings.SearchRequest>} A signal indicating that | 96 * @return {!Promise<!settings.SearchRequest>} A signal indicating that |
| 97 * searching finished. | 97 * searching finished. |
| 98 */ | 98 */ |
| 99 searchContents: function(query) { | 99 searchContents: function(query) { |
| 100 var whenSearchDone = settings.getSearchManager().search( | 100 var whenSearchDone = settings.getSearchManager().search( |
| 101 query, assert(this.$$('#basicPage'))); | 101 query, assert(this.$$('#basicPage'))); |
| 102 | 102 |
| 103 if (this.pageVisibility.advancedSettings !== false) { | 103 if (this.pageVisibility.advancedSettings !== false) { |
| 104 assert(whenSearchDone === settings.getSearchManager().search( | 104 assert(whenSearchDone === settings.getSearchManager().search( |
| 105 query, assert(this.$.advancedPageTemplate.get()))); | 105 query, assert(this.$$('#advancedPageTemplate').get()))); |
| 106 } | 106 } |
| 107 | 107 |
| 108 return whenSearchDone; | 108 return whenSearchDone; |
| 109 }, | 109 }, |
| 110 | 110 |
| 111 /** @private */ | 111 /** @private */ |
| 112 onResetDone_: function() { | 112 onResetDone_: function() { |
| 113 this.showResetProfileBanner_ = false; | 113 this.showResetProfileBanner_ = false; |
| 114 }, | 114 }, |
| 115 | 115 |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 129 */ | 129 */ |
| 130 onSubpageExpanded_: function() { | 130 onSubpageExpanded_: function() { |
| 131 this.hasExpandedSection_ = true; | 131 this.hasExpandedSection_ = true; |
| 132 }, | 132 }, |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Render the advanced page now (don't wait for idle). | 135 * Render the advanced page now (don't wait for idle). |
| 136 * @private | 136 * @private |
| 137 */ | 137 */ |
| 138 advancedToggleExpandedChanged_: function() { | 138 advancedToggleExpandedChanged_: function() { |
| 139 if (this.advancedToggleExpanded) | 139 if (this.advancedToggleExpanded) { |
| 140 this.$.advancedPageTemplate.get(); | 140 // Ensure any dom-if reflects the current properties. |
| 141 Polymer.dom.flush(); | |
|
dpapad
2017/02/14 19:06:00
We've been generally avoiding calling Polymer.dom.
dschuyler
2017/02/14 19:36:56
Done.
| |
| 142 this.$$('#advancedPageTemplate').get(); | |
| 143 } | |
| 141 }, | 144 }, |
| 142 | 145 |
| 143 /** | 146 /** |
| 144 * @param {boolean} inSearchMode | 147 * @param {boolean} inSearchMode |
| 145 * @param {boolean} hasExpandedSection | 148 * @param {boolean} hasExpandedSection |
| 146 * @return {boolean} | 149 * @return {boolean} |
| 147 * @private | 150 * @private |
| 148 */ | 151 */ |
| 149 showAdvancedToggle_: function(inSearchMode, hasExpandedSection) { | 152 showAdvancedToggle_: function(inSearchMode, hasExpandedSection) { |
| 150 return !inSearchMode && !hasExpandedSection; | 153 return !inSearchMode && !hasExpandedSection; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 | 192 |
| 190 /** | 193 /** |
| 191 * @param {boolean} opened Whether the menu is expanded. | 194 * @param {boolean} opened Whether the menu is expanded. |
| 192 * @return {string} Icon name. | 195 * @return {string} Icon name. |
| 193 * @private | 196 * @private |
| 194 */ | 197 */ |
| 195 getArrowIcon_: function(opened) { | 198 getArrowIcon_: function(opened) { |
| 196 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | 199 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; |
| 197 }, | 200 }, |
| 198 }); | 201 }); |
| OLD | NEW |