| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 whenSearchDone.push(this.$$('#advancedPageTemplate').get().then( | 129 whenSearchDone.push(this.$$('#advancedPageTemplate').get().then( |
| 130 function(advancedPage) { | 130 function(advancedPage) { |
| 131 return settings.getSearchManager().search(query, advancedPage); | 131 return settings.getSearchManager().search(query, advancedPage); |
| 132 })); | 132 })); |
| 133 } | 133 } |
| 134 | 134 |
| 135 return Promise.all(whenSearchDone).then(function(requests) { | 135 return Promise.all(whenSearchDone).then(function(requests) { |
| 136 // Combine the SearchRequests results to a single SearchResult object. | 136 // Combine the SearchRequests results to a single SearchResult object. |
| 137 return { | 137 return { |
| 138 canceled: requests.some(function(r) { return r.canceled; }), | 138 canceled: requests.some(function(r) { return r.canceled; }), |
| 139 didFindMatches: requests.every(function(r) { | 139 didFindMatches: requests.some(function(r) { |
| 140 return !r.didFindMatches(); | 140 return r.didFindMatches(); |
| 141 }), | 141 }), |
| 142 // All requests correspond to the same user query, so only need to check | 142 // All requests correspond to the same user query, so only need to check |
| 143 // one of them. | 143 // one of them. |
| 144 wasClearSearch: requests[0].isSame(''), | 144 wasClearSearch: requests[0].isSame(''), |
| 145 }; | 145 }; |
| 146 }); | 146 }); |
| 147 }, | 147 }, |
| 148 | 148 |
| 149 // <if expr="chromeos"> | 149 // <if expr="chromeos"> |
| 150 /** | 150 /** |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 /** | 242 /** |
| 243 * @param {boolean} opened Whether the menu is expanded. | 243 * @param {boolean} opened Whether the menu is expanded. |
| 244 * @return {string} Icon name. | 244 * @return {string} Icon name. |
| 245 * @private | 245 * @private |
| 246 */ | 246 */ |
| 247 getArrowIcon_: function(opened) { | 247 getArrowIcon_: function(opened) { |
| 248 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; | 248 return opened ? 'cr:arrow-drop-up' : 'cr:arrow-drop-down'; |
| 249 }, | 249 }, |
| 250 }); | 250 }); |
| OLD | NEW |