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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
98 assert(!this.hasExpandedSection_); | 98 assert(!this.hasExpandedSection_); |
99 } | 99 } |
100 | 100 |
101 MainPageBehaviorImpl.currentRouteChanged.call(this, newRoute, oldRoute); | 101 MainPageBehaviorImpl.currentRouteChanged.call(this, newRoute, oldRoute); |
102 }, | 102 }, |
103 | 103 |
104 /** | 104 /** |
105 * Queues a task to search the basic sections, then another for the advanced | 105 * Queues a task to search the basic sections, then another for the advanced |
106 * sections. | 106 * sections. |
107 * @param {string} query The text to search for. | 107 * @param {string} query The text to search for. |
108 * @return {!Promise<!settings.SearchRequest>} A signal indicating that | 108 * @return {!Promise<!Array<!settings.SearchRequest>>} A signal indicating |
109 * searching finished. | 109 * that searching finished. |
110 */ | 110 */ |
111 searchContents: function(query) { | 111 searchContents: function(query) { |
112 var whenSearchDone = settings.getSearchManager().search( | 112 var whenSearchDone = [ |
113 query, assert(this.$$('#basicPage'))); | 113 settings.getSearchManager().search( |
Dan Beam
2017/03/14 00:44:27
wrong indent, when you add less indent dare you to
dpapad
2017/03/14 03:28:11
Done.
| |
114 query, assert(this.$$('#basicPage'))), | |
115 ]; | |
114 | 116 |
115 if (this.pageVisibility.advancedSettings !== false) { | 117 if (this.pageVisibility.advancedSettings !== false) { |
116 assert(whenSearchDone === settings.getSearchManager().search( | 118 whenSearchDone.push(settings.getSearchManager().search( |
117 query, assert(this.$$('#advancedPageTemplate').get()))); | 119 query, assert(this.$$('#advancedPageTemplate').get()))); |
118 } | 120 } |
119 | 121 |
120 return whenSearchDone; | 122 return Promise.all(whenSearchDone); |
121 }, | 123 }, |
122 | 124 |
123 // <if expr="chromeos"> | 125 // <if expr="chromeos"> |
124 /** | 126 /** |
125 * @return {boolean} | 127 * @return {boolean} |
126 * @private | 128 * @private |
127 */ | 129 */ |
128 computeShowSecondaryUserBanner_: function() { | 130 computeShowSecondaryUserBanner_: function() { |
129 return !this.hasExpandedSection_ && | 131 return !this.hasExpandedSection_ && |
130 loadTimeData.getBoolean('isSecondaryUser'); | 132 loadTimeData.getBoolean('isSecondaryUser'); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
215 | 217 |
216 /** | 218 /** |
217 * @param {boolean} opened Whether the menu is expanded. | 219 * @param {boolean} opened Whether the menu is expanded. |
218 * @return {string} Icon name. | 220 * @return {string} Icon name. |
219 * @private | 221 * @private |
220 */ | 222 */ |
221 getArrowIcon_: function(opened) { | 223 getArrowIcon_: function(opened) { |
222 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | 224 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; |
223 }, | 225 }, |
224 }); | 226 }); |
OLD | NEW |