Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1294)

Side by Side Diff: chrome/browser/resources/md_history/history_list.js

Issue 2159773003: MD History: Add shortcuts for 'Delete' and 'Backspace' to delete selected items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@MDH_slash_key
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 Polymer({ 5 Polymer({
6 is: 'history-list', 6 is: 'history-list',
7 7
8 properties: { 8 properties: {
9 // The search term for the current query. Set when the query returns. 9 // The search term for the current query. Set when the query returns.
10 searchedTerm: { 10 searchedTerm: {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 }); 199 });
200 md_history.BrowserService.getInstance() 200 md_history.BrowserService.getInstance()
201 .deleteItems(toBeRemoved) 201 .deleteItems(toBeRemoved)
202 .then(function(items) { 202 .then(function(items) {
203 this.removeDeletedHistory_(items); 203 this.removeDeletedHistory_(items);
204 this.fire('unselect-all'); 204 this.fire('unselect-all');
205 }.bind(this)); 205 }.bind(this));
206 }, 206 },
207 207
208 /** 208 /**
209 * Return the number of history items to be deleted.
210 * @return {number}
211 */
212 numToBeDeleted: function() {
tsergeant 2016/07/19 05:09:41 Nit: Rename this to something like numSelected or
lshang 2016/07/20 01:19:09 I deleted this method and used 'toolbar.count' ins
213 return this.historyData_.filter(function(item) {
214 return item.selected;
215 }).length;
216 },
217
218 /**
209 * Called when the page is scrolled to near the bottom of the list. 219 * Called when the page is scrolled to near the bottom of the list.
210 * @private 220 * @private
211 */ 221 */
212 loadMoreData_: function() { 222 loadMoreData_: function() {
213 if (this.resultLoadingDisabled_ || this.querying) 223 if (this.resultLoadingDisabled_ || this.querying)
214 return; 224 return;
215 225
216 this.fire('load-more-history'); 226 this.fire('load-more-history');
217 }, 227 },
218 228
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 285
276 /** 286 /**
277 * @param {number} index 287 * @param {number} index
278 * @return {boolean} 288 * @return {boolean}
279 * @private 289 * @private
280 */ 290 */
281 isFirstItem_: function(index) { 291 isFirstItem_: function(index) {
282 return index == 0; 292 return index == 0;
283 } 293 }
284 }); 294 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698