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? |