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

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

Issue 2118383003: MD History: add shortcuts for search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test change Created 4 years, 5 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/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 721e621ac3142c69ce9fc27d7e5ced01f381345a..6c1a91d84a088c3c738919a88d0aa60c176fd91f 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -57,6 +57,10 @@ Polymer({
/** @override */
ready: function() {
this.grouped_ = loadTimeData.getBoolean('groupByDomain');
+
+ cr.ui.decorate('command', cr.ui.Command);
+ document.addEventListener('canExecute', this.onCanExecute_.bind(this));
+ document.addEventListener('command', this.onCommand_.bind(this));
},
/** @private */
@@ -120,6 +124,23 @@ Polymer({
searchDomain_: function(e) { this.$.toolbar.setSearchTerm(e.detail.domain); },
/**
+ * @param {Event} e
+ * @private
+ */
+ onCanExecute_: function(e) {
+ e.canExecute = true;
+ },
+
+ /**
+ * @param {Event} e
+ * @private
+ */
+ onCommand_: function(e) {
+ if (e.command.id == 'find-command')
+ this.$.toolbar.showSearchField();
+ },
+
+ /**
* @param {!Array<!ForeignSession>} sessionList Array of objects describing
* the sessions from other devices.
* @param {boolean} isTabSyncEnabled Is tab sync enabled for this profile?
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/compiled_resources2.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698