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

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

Issue 1648803003: MD History: Drop-down menu allows searching for history-items by domain name. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_functionality
Patch Set: Address reviewer comments and small fixes. Created 4 years, 10 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/history_card_manager.js
diff --git a/chrome/browser/resources/md_history/history_card_manager.js b/chrome/browser/resources/md_history/history_card_manager.js
index f7cd51bbc4fe2ba9f1dee84bb9218b79e5a9340d..42b7e0dd12fbece9785853e64f490edac4aa7f25 100644
--- a/chrome/browser/resources/md_history/history_card_manager.js
+++ b/chrome/browser/resources/md_history/history_card_manager.js
@@ -26,8 +26,8 @@ Polymer({
},
menuIdentifier: {
- type: Number,
- value: 0
+ type: Object,
+ value: function() { return {}; }
},
searchTerm: {
@@ -58,6 +58,15 @@ Polymer({
},
/**
+ * Search history based on the domain name associated with the pop-up menu.
+ * @private
+ */
+ onMoreFromSiteTap_: function() {
+ this.fire('refresh-results', {search: this.menuIdentifier.domain});
+ this.closeMenu();
+ },
+
+ /**
* Clear the page completely so the page can display new results (search).
*/
resetHistoryResults: function() {
@@ -73,13 +82,15 @@ Polymer({
*/
toggleMenu_: function(e) {
var menu = this.$['overflow-menu'];
+ var itemId = e.detail.itemIdentifier;
// Menu closes if the same button is clicked.
- if (this.menuOpen && this.menuIdentifier == e.detail.accessTime) {
+ if (this.menuOpen && (this.menuIdentifier.url == itemId.url) &&
+ (this.menuIdentifier.timestamps == itemId.timestamps)) {
this.closeMenu();
} else {
this.menuOpen = true;
- this.menuIdentifier = e.detail.accessTime;
+ this.menuIdentifier = itemId;
cr.ui.positionPopupAtPoint(e.detail.x + this.X_OFFSET_, e.detail.y, menu,
cr.ui.AnchorType.BEFORE);
@@ -88,6 +99,11 @@ Polymer({
}
},
+ menuEquals_: function(menu, item) {
+ console.log((menu.url == item.url) && (menu.timestamps == item.timestamps));
tsergeant 2016/02/12 00:48:55 Remove this log
+ return ((menu.url == item.url) && (menu.timestamps == item.timestamps));
tsergeant 2016/02/12 00:48:55 You can get rid of the outer parens
+ },
+
/**
* Reformat the search results so they all have the same dateRelativeDay (will
* all display on the same card). Also so the date displays instead of time.

Powered by Google App Engine
This is Rietveld 408576698