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

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

Issue 2207323002: [MD History] Factor out a common HistoryListBehavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/browser/resources/md_history/grouped_list.js
diff --git a/chrome/browser/resources/md_history/grouped_list.js b/chrome/browser/resources/md_history/grouped_list.js
index 9d14bfc9e458fd1572a93cb7e6ee5cd46b7e15a2..b7520466a6f4d0ce81cab5d00e59323773ea7fab 100644
--- a/chrome/browser/resources/md_history/grouped_list.js
+++ b/chrome/browser/resources/md_history/grouped_list.js
@@ -21,6 +21,8 @@ var HistoryGroup;
Polymer({
is: 'history-grouped-list',
+ behaviors: [HistoryListBehavior],
+
properties: {
// An array of history entries in reverse chronological order.
historyData: {
@@ -156,21 +158,36 @@ Polymer({
visits, itemIndex, this.searchedTerm);
},
- hasResults_: function(historyDataLength) {
- return historyDataLength > 0;
+ /**
+ * @param {number} groupIndex
+ * @param {number} domainIndex
+ * @param {number} itemIndex
+ * @return {string}
+ * @private
+ */
+ pathForItem_: function(groupIndex, domainIndex, itemIndex) {
+ return [
+ 'groupedHistoryData_', groupIndex, 'domains', domainIndex, 'visits',
+ itemIndex
+ ].join('.');
},
+ /**
+ * @param {HistoryDomain} domain
+ * @return {string}
+ * @private
+ */
getWebsiteIconStyle_: function(domain) {
return 'background-image: ' +
cr.icon.getFaviconImageSet(domain.visits[0].url);
},
+ /**
+ * @param {boolean} expanded
+ * @return {string}
+ * @private
+ */
getDropdownIcon_: function(expanded) {
return expanded ? 'cr:expand-less' : 'cr:expand-more';
},
-
- noResultsMessage_: function(searchedTerm) {
- var messageId = searchedTerm !== '' ? 'noSearchResults' : 'noResults';
- return loadTimeData.getString(messageId);
- },
});

Powered by Google App Engine
This is Rietveld 408576698