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 6d3f5d4e2d111d016111463a05fa1550b1bec366..18df6abd69253c827e6fe66b1bb9a12272d05c19 100644 |
--- a/chrome/browser/resources/md_history/app.js |
+++ b/chrome/browser/resources/md_history/app.js |
@@ -118,7 +118,17 @@ Polymer({ |
* @private |
*/ |
onCanExecute_: function(e) { |
- e.canExecute = true; |
+ e = /** @type {cr.ui.CanExecuteEvent} */(e); |
+ switch (e.command.id) { |
+ case 'find-command': |
+ e.canExecute = true; |
+ break; |
+ case 'slash-command': |
+ e.canExecute = |
+ !(this.$.toolbar.searchBar.showingSearch && |
+ this.$.toolbar.searchBar.isSearchFocused()); |
+ break; |
+ } |
}, |
/** |
@@ -126,7 +136,7 @@ Polymer({ |
* @private |
*/ |
onCommand_: function(e) { |
- if (e.command.id == 'find-command') |
+ if (e.command.id == 'find-command' || e.command.id == 'slash-command') |
this.$.toolbar.showSearchField(); |
}, |