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..07effee8f46ac89c546bf921db57ab489299a6ab 100644 |
--- a/chrome/browser/resources/md_history/app.js |
+++ b/chrome/browser/resources/md_history/app.js |
@@ -118,7 +118,18 @@ 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': |
+ if (this.$.toolbar.showingSearchField()) |
Dan Beam
2016/07/15 03:07:40
don't you actually want whether the search field i
tsergeant
2016/07/15 04:06:21
Yeah, there can be cases where the field is showin
lshang
2016/07/15 05:02:09
Yep, good point!
I changed to regard forward slash
|
+ e.canExecute = false; |
+ else |
+ e.canExecute = true; |
Dan Beam
2016/07/15 03:07:40
e.canExecute = !this.$.toolbar.showingSearchField(
lshang
2016/07/15 05:02:09
Done.
|
+ break; |
+ } |
}, |
/** |
@@ -126,7 +137,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(); |
}, |