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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 * @param {string} query The text to search for. | 107 * @param {string} query The text to search for. |
108 * @return {!Promise<!settings.SearchResult>} A signal indicating that | 108 * @return {!Promise<!settings.SearchResult>} A signal indicating that |
109 * searching finished. | 109 * searching finished. |
110 */ | 110 */ |
111 searchContents: function(query) { | 111 searchContents: function(query) { |
112 var whenSearchDone = [ | 112 var whenSearchDone = [ |
113 settings.getSearchManager().search(query, assert(this.$$('#basicPage'))), | 113 settings.getSearchManager().search(query, assert(this.$$('#basicPage'))), |
114 ]; | 114 ]; |
115 | 115 |
116 if (this.pageVisibility.advancedSettings !== false) { | 116 if (this.pageVisibility.advancedSettings !== false) { |
117 whenSearchDone.push(settings.getSearchManager().search( | 117 whenSearchDone.push(this.$$('#advancedPageTemplate').get().then( |
118 query, assert(this.$$('#advancedPageTemplate').get()))); | 118 function(advancedPage) { |
| 119 return settings.getSearchManager().search(query, advancedPage); |
| 120 })); |
119 } | 121 } |
120 | 122 |
121 return Promise.all(whenSearchDone).then(function(requests) { | 123 return Promise.all(whenSearchDone).then(function(requests) { |
122 // Combine the SearchRequests results to a single SearchResult object. | 124 // Combine the SearchRequests results to a single SearchResult object. |
123 return { | 125 return { |
124 canceled: requests.some(function(r) { return r.canceled; }), | 126 canceled: requests.some(function(r) { return r.canceled; }), |
125 didFindMatches: requests.every(function(r) { | 127 didFindMatches: requests.every(function(r) { |
126 return !r.didFindMatches(); | 128 return !r.didFindMatches(); |
127 }), | 129 }), |
128 // All requests correspond to the same user query, so only need to check | 130 // All requests correspond to the same user query, so only need to check |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 | 229 |
228 /** | 230 /** |
229 * @param {boolean} opened Whether the menu is expanded. | 231 * @param {boolean} opened Whether the menu is expanded. |
230 * @return {string} Icon name. | 232 * @return {string} Icon name. |
231 * @private | 233 * @private |
232 */ | 234 */ |
233 getArrowIcon_: function(opened) { | 235 getArrowIcon_: function(opened) { |
234 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | 236 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; |
235 }, | 237 }, |
236 }); | 238 }); |
OLD | NEW |