OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Polymer({ | 5 Polymer({ |
6 is: 'history-list-container', | 6 is: 'history-list-container', |
7 | 7 |
8 properties: { | 8 properties: { |
9 // The path of the currently selected page. | 9 // The path of the currently selected page. |
10 selectedPage_: String, | 10 selectedPage_: String, |
(...skipping 23 matching lines...) Expand all Loading... | |
34 | 34 |
35 /** | 35 /** |
36 * @param {HistoryQuery} info An object containing information about the | 36 * @param {HistoryQuery} info An object containing information about the |
37 * query. | 37 * query. |
38 * @param {!Array<HistoryEntry>} results A list of results. | 38 * @param {!Array<HistoryEntry>} results A list of results. |
39 */ | 39 */ |
40 historyResult: function(info, results) { | 40 historyResult: function(info, results) { |
41 this.initializeResults_(info, results); | 41 this.initializeResults_(info, results); |
42 this.closeMenu_(); | 42 this.closeMenu_(); |
43 | 43 |
44 if (info.term != '' && !this.queryState.incremental) { | |
Dan Beam
2016/10/05 01:34:48
nit: if (info.term && !this.queryState.incremental
tsergeant
2016/10/05 01:57:32
Done.
| |
45 announceAccessibleMessage( | |
46 md_history.HistoryItem.searchResultsTitle(results.length, info.term)); | |
47 } | |
48 | |
44 if (this.selectedPage_ == 'grouped-list') { | 49 if (this.selectedPage_ == 'grouped-list') { |
45 this.$$('#grouped-list').historyData = results; | 50 this.$$('#grouped-list').historyData = results; |
46 return; | 51 return; |
47 } | 52 } |
48 | 53 |
49 var list = /** @type {HistoryListElement} */(this.$['infinite-list']); | 54 var list = /** @type {HistoryListElement} */(this.$['infinite-list']); |
50 list.addNewResults(results, this.queryState.incremental); | 55 list.addNewResults(results, this.queryState.incremental); |
51 if (info.finished) | 56 if (info.finished) |
52 list.disableResultLoading(); | 57 list.disableResultLoading(); |
53 }, | 58 }, |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 }.bind(this)); | 267 }.bind(this)); |
263 menu.closeMenu(); | 268 menu.closeMenu(); |
264 }, | 269 }, |
265 | 270 |
266 /** | 271 /** |
267 * @return {HTMLElement} | 272 * @return {HTMLElement} |
268 * @private | 273 * @private |
269 */ | 274 */ |
270 getSelectedList_: function() { return this.$.content.selectedItem; }, | 275 getSelectedList_: function() { return this.$.content.selectedItem; }, |
271 }); | 276 }); |
OLD | NEW |