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

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

Issue 2097003002: MD History: Remove bookmark when clicking bookmark star (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor change Created 4 years, 6 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_item.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/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..68f626d159a7467eb5014116d5f6882ed250641d 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,23 @@ Polymer({
target, e.detail.item);
},
+ /**
+ * Remove bookmark star for history items with matching URLs.
+ * @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)
+ this.set('historyData_.' + i + '.starred', false);
+ }
+ },
+
/** @private */
onMoreFromSiteTap_: function() {
var menu = /** @type {CrSharedMenuElement} */(this.$.sharedMenu);
« no previous file with comments | « chrome/browser/resources/md_history/history_item.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