| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 historyDeleted: function() { | 95 historyDeleted: function() { |
| 96 // Do not reload the list when there are items checked. | 96 // Do not reload the list when there are items checked. |
| 97 if (this.getSelectedItemCount() > 0) | 97 if (this.getSelectedItemCount() > 0) |
| 98 return; | 98 return; |
| 99 | 99 |
| 100 // Reload the list with current search state. | 100 // Reload the list with current search state. |
| 101 this.queryHistory(false); | 101 this.queryHistory(false); |
| 102 }, | 102 }, |
| 103 | 103 |
| 104 /** @return {HTMLElement} */ | 104 /** @return {Element} */ |
| 105 getContentScrollTarget: function() { | 105 getContentScrollTarget: function() { |
| 106 return this.getSelectedList_(); | 106 return this.getSelectedList_(); |
| 107 }, | 107 }, |
| 108 | 108 |
| 109 /** @return {number} */ | 109 /** @return {number} */ |
| 110 getSelectedItemCount: function() { | 110 getSelectedItemCount: function() { |
| 111 return this.getSelectedList_().selectedPaths.size; | 111 return this.getSelectedList_().selectedPaths.size; |
| 112 }, | 112 }, |
| 113 | 113 |
| 114 unselectAllItems: function(count) { | 114 unselectAllItems: function(count) { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 if (index <= UMA_MAX_SUBSET_BUCKET_VALUE) { | 276 if (index <= UMA_MAX_SUBSET_BUCKET_VALUE) { |
| 277 browserService.recordHistogram( | 277 browserService.recordHistogram( |
| 278 'HistoryPage.RemoveEntryPositionSubset', index, | 278 'HistoryPage.RemoveEntryPositionSubset', index, |
| 279 UMA_MAX_SUBSET_BUCKET_VALUE); | 279 UMA_MAX_SUBSET_BUCKET_VALUE); |
| 280 } | 280 } |
| 281 }.bind(this)); | 281 }.bind(this)); |
| 282 menu.closeMenu(); | 282 menu.closeMenu(); |
| 283 }, | 283 }, |
| 284 | 284 |
| 285 /** | 285 /** |
| 286 * @return {HTMLElement} | 286 * @return {Element} |
| 287 * @private | 287 * @private |
| 288 */ | 288 */ |
| 289 getSelectedList_: function() { return this.$.content.selectedItem; }, | 289 getSelectedList_: function() { return this.$$('#' + this.selectedPage_); }, |
| 290 | 290 |
| 291 /** @private */ | 291 /** @private */ |
| 292 canDeleteHistory_: function() { | 292 canDeleteHistory_: function() { |
| 293 return loadTimeData.getBoolean('allowDeletingHistory'); | 293 return loadTimeData.getBoolean('allowDeletingHistory'); |
| 294 } | 294 } |
| 295 }); | 295 }); |
| OLD | NEW |