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

Unified Diff: chrome/browser/resources/md_history/list_container.js

Issue 2207323002: [MD History] Factor out a common HistoryListBehavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nits Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/md_history/history_toolbar.js ('k') | chrome/browser/ui/webui/md_history_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index 93d430d098c6298aea140073b56f7115f9d31d2b..180861a06391ca3bf39015beb487330e97b89938 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -85,8 +85,7 @@ Polymer({
},
unselectAllItems: function(count) {
- /** @type {HistoryListElement} */ (this.$['infinite-list'])
- .unselectAllItems(count);
+ this.getSelectedList_().unselectAllItems(count);
},
/**
@@ -114,7 +113,6 @@ Polymer({
/** @private */
loadMoreHistory_: function() { this.queryHistory(true); },
-
/**
* @param {HistoryQuery} info
* @param {!Array<HistoryEntry>} results
@@ -140,7 +138,7 @@ Polymer({
/** @private */
onDialogConfirmTap_: function() {
- this.$['infinite-list'].deleteSelected();
+ this.getSelectedList_().deleteSelected();
this.$.dialog.close();
},
@@ -182,7 +180,7 @@ Polymer({
md_history.BrowserService.getInstance()
.deleteItems([menu.itemData])
.then(function(items) {
- this.$['infinite-list'].removeDeletedHistory_(items);
+ this.getSelectedList_().removeItemsByPath(items[0].path);
// This unselect-all is to reset the toolbar when deleting a selected
// item. TODO(tsergeant): Make this automatic based on observing list
// modifications.
@@ -190,4 +188,12 @@ Polymer({
}.bind(this));
menu.closeMenu();
},
+
+ /**
+ * @return {HTMLElement}
+ * @private
+ */
+ getSelectedList_: function() {
+ return this.$.content.selectedItem;
+ },
});
« no previous file with comments | « chrome/browser/resources/md_history/history_toolbar.js ('k') | chrome/browser/ui/webui/md_history_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698