| 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-app', | 6 is: 'history-app', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 // The id of the currently selected page. | 9 // The id of the currently selected page. |
| 10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, | 10 selectedPage_: {type: String, value: 'history', observer: 'unselectAll'}, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 * @private | 78 * @private |
| 79 */ | 79 */ |
| 80 unselectAll: function() { | 80 unselectAll: function() { |
| 81 var listContainer = | 81 var listContainer = |
| 82 /** @type {HistoryListContainerElement} */ (this.$['history']); | 82 /** @type {HistoryListContainerElement} */ (this.$['history']); |
| 83 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); | 83 var toolbar = /** @type {HistoryToolbarElement} */ (this.$.toolbar); |
| 84 listContainer.unselectAllItems(toolbar.count); | 84 listContainer.unselectAllItems(toolbar.count); |
| 85 toolbar.count = 0; | 85 toolbar.count = 0; |
| 86 }, | 86 }, |
| 87 | 87 |
| 88 /** | |
| 89 * Listens for call to delete all selected items and loops through all items | |
| 90 * to determine which ones are selected and deletes these. | |
| 91 */ | |
| 92 deleteSelected: function() { | 88 deleteSelected: function() { |
| 93 if (!loadTimeData.getBoolean('allowDeletingHistory')) | 89 this.$.history.deleteSelectedWithPrompt(); |
| 94 return; | |
| 95 | |
| 96 // TODO(hsampson): add a popup to check whether the user definitely | |
| 97 // wants to delete the selected items. | |
| 98 /** @type {HistoryListContainerElement} */ (this.$['history']) | |
| 99 .deleteSelected(); | |
| 100 }, | 90 }, |
| 101 | 91 |
| 102 /** | 92 /** |
| 103 * @param {HistoryQuery} info An object containing information about the | 93 * @param {HistoryQuery} info An object containing information about the |
| 104 * query. | 94 * query. |
| 105 * @param {!Array<HistoryEntry>} results A list of results. | 95 * @param {!Array<HistoryEntry>} results A list of results. |
| 106 */ | 96 */ |
| 107 historyResult: function(info, results) { | 97 historyResult: function(info, results) { |
| 108 this.set('queryState_.querying', false); | 98 this.set('queryState_.querying', false); |
| 109 this.set('queryResult_.info', info); | 99 this.set('queryResult_.info', info); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 * @param {boolean} incremental | 146 * @param {boolean} incremental |
| 157 * @param {string} searchTerm | 147 * @param {string} searchTerm |
| 158 * @return {boolean} Whether a loading spinner should be shown (implies the | 148 * @return {boolean} Whether a loading spinner should be shown (implies the |
| 159 * backend is querying a new search term). | 149 * backend is querying a new search term). |
| 160 * @private | 150 * @private |
| 161 */ | 151 */ |
| 162 shouldShowSpinner_: function(querying, incremental, searchTerm) { | 152 shouldShowSpinner_: function(querying, incremental, searchTerm) { |
| 163 return querying && !incremental && searchTerm != ''; | 153 return querying && !incremental && searchTerm != ''; |
| 164 }, | 154 }, |
| 165 }); | 155 }); |
| OLD | NEW |