Index: chrome/browser/resources/md_history/history_list.js |
diff --git a/chrome/browser/resources/md_history/history_list.js b/chrome/browser/resources/md_history/history_list.js |
index d0718e23b3160ab99de107e6eb7b55d65cebec98..8c5a9bd88874e50849eef095f832f92eb6be1104 100644 |
--- a/chrome/browser/resources/md_history/history_list.js |
+++ b/chrome/browser/resources/md_history/history_list.js |
@@ -29,6 +29,7 @@ Polymer({ |
'infinite-list.scroll': 'closeMenu_', |
'tap': 'closeMenu_', |
'toggle-menu': 'toggleMenu_', |
+ 'remove-bookmark-stars': 'removeBookmarkStars_', |
}, |
/** |
@@ -51,6 +52,24 @@ Polymer({ |
target, e.detail.item); |
}, |
+ /** |
+ * Remove bookmark star of an url's all history items. |
calamity
2016/06/29 07:36:05
nit: Remove bookmark star for history items with m
lshang
2016/07/01 01:15:16
Done.
|
+ * @param {{detail: !string}} e |
+ * @private |
+ */ |
+ removeBookmarkStars_: function(e) { |
+ var url = e.detail; |
+ |
+ if (this.historyData_ === undefined) |
+ return; |
+ |
+ for (var i = 0; i < this.historyData_.length; i++) { |
+ if (this.historyData_[i].url == url) { |
calamity
2016/06/29 07:36:05
nit: No braces needed for single line if.
lshang
2016/07/01 01:15:16
Done.
|
+ this.set('historyData_.' + i + '.starred', false); |
+ } |
+ } |
+ }, |
+ |
/** @private */ |
onMoreFromSiteTap_: function() { |
var menu = /** @type {CrSharedMenuElement} */(this.$.sharedMenu); |