| 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 /** | 5 /** |
| 6 * @typedef {{querying: boolean, | 6 * @typedef {{querying: boolean, |
| 7 * searchTerm: string, | 7 * searchTerm: string, |
| 8 * results: ?Array<!HistoryEntry>, | 8 * results: ?Array<!HistoryEntry>, |
| 9 * info: ?HistoryQuery, | 9 * info: ?HistoryQuery, |
| 10 * incremental: boolean, | 10 * incremental: boolean, |
| 11 * range: HistoryRange, | 11 * range: HistoryRange, |
| 12 * groupedOffset: number, | 12 * groupedOffset: number, |
| 13 * sessionList: ?Array<!ForeignSession>}} | 13 * sessionList: ?Array<!ForeignSession>}} |
| 14 */ | 14 */ |
| 15 var QueryState; | 15 var QueryState; |
| 16 | 16 |
| 17 Polymer({ | 17 Polymer({ |
| 18 is: 'history-app', | 18 is: 'history-app', |
| 19 | 19 |
| 20 properties: { | 20 properties: { |
| 21 // Whether to display the footer. |
| 22 showFooter: {type: Boolean, value: false}, |
| 23 |
| 21 // The id of the currently selected page. | 24 // The id of the currently selected page. |
| 22 selectedPage_: { | 25 selectedPage_: { |
| 23 type: String, | 26 type: String, |
| 24 value: 'history-list', | 27 value: 'history-list', |
| 25 observer: 'unselectAll' | 28 observer: 'unselectAll' |
| 26 }, | 29 }, |
| 27 | 30 |
| 28 // Whether domain-grouped history is enabled. | 31 // Whether domain-grouped history is enabled. |
| 29 grouped_: { | 32 grouped_: { |
| 30 type: Boolean, | 33 type: Boolean, |
| 31 reflectToAttribute: true | 34 reflectToAttribute: true |
| 32 }, | 35 }, |
| 33 | 36 |
| 34 // Whether the first set of results have returned. | 37 // Whether the first set of results have returned. |
| 35 firstLoad_: { type: Boolean, value: true }, | 38 firstLoad_: {type: Boolean, value: true}, |
| 36 | 39 |
| 37 // True if the history queries are disabled. | 40 // True if the history queries are disabled. |
| 38 queryingDisabled_: Boolean, | 41 queryingDisabled_: Boolean, |
| 39 | 42 |
| 40 /** @type {!QueryState} */ | 43 /** @type {!QueryState} */ |
| 41 // TODO(calamity): Split out readOnly data into a separate property which is | 44 // TODO(calamity): Split out readOnly data into a separate property which is |
| 42 // only set on result return. | 45 // only set on result return. |
| 43 queryState_: { | 46 queryState_: { |
| 44 type: Object, | 47 type: Object, |
| 45 value: function() { | 48 value: function() { |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 * @param {boolean} incremental | 263 * @param {boolean} incremental |
| 261 * @param {string} searchTerm | 264 * @param {string} searchTerm |
| 262 * @return {boolean} Whether a loading spinner should be shown (implies the | 265 * @return {boolean} Whether a loading spinner should be shown (implies the |
| 263 * backend is querying a new search term). | 266 * backend is querying a new search term). |
| 264 * @private | 267 * @private |
| 265 */ | 268 */ |
| 266 shouldShowSpinner_: function(querying, incremental, searchTerm) { | 269 shouldShowSpinner_: function(querying, incremental, searchTerm) { |
| 267 return querying && !incremental && searchTerm != ''; | 270 return querying && !incremental && searchTerm != ''; |
| 268 } | 271 } |
| 269 }); | 272 }); |
| OLD | NEW |