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

Unified Diff: ui/webui/resources/js/cr/ui/command.js

Issue 13532006: Check if a command can be executed before executing it via a shortcut. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/command.js
diff --git a/ui/webui/resources/js/cr/ui/command.js b/ui/webui/resources/js/cr/ui/command.js
index 83aa0b4f5db58d12b9161c319e9042e48e184633..1723dd7553c2892055d279c04ac746d970d890bb 100644
--- a/ui/webui/resources/js/cr/ui/command.js
+++ b/ui/webui/resources/js/cr/ui/command.js
@@ -262,6 +262,11 @@ cr.define('cr.ui', function() {
// We do not want any other element to handle this.
e.stopPropagation();
+ // When invoking a command via a shortcut, we have to manually check
+ // if it can be executed, since focus might not have been changed
+ // what would have updated the command's state.
+ command.canExecuteChange();
+
command.execute();
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698