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

Unified Diff: chrome/browser/resources/extensions/extension_command_list.js

Issue 10827441: Add support for Command key for Extension Commands (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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 | content/browser/renderer_host/native_web_keyboard_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/extensions/extension_command_list.js
===================================================================
--- chrome/browser/resources/extensions/extension_command_list.js (revision 152319)
+++ chrome/browser/resources/extensions/extension_command_list.js (working copy)
@@ -33,6 +33,8 @@
*/
function keystrokeToString(event) {
var output = '';
+ if (cr.isMac && event.metaKey)
+ output = 'Command+';
if (event.ctrlKey)
output = 'Ctrl+';
if (!event.ctrlKey && event.altKey)
@@ -232,8 +234,8 @@
event.preventDefault();
event.stopPropagation();
- if (!event.ctrlKey && !event.altKey)
- return; // Ctrl or Alt is a must.
+ if (!event.ctrlKey && !event.altKey && (!cr.isMac || !event.metaKey))
+ return; // Ctrl or Alt is a must (or Cmd on Mac).
var keystroke = keystrokeToString(event);
event.target.textContent = keystroke;
« no previous file with comments | « no previous file | content/browser/renderer_host/native_web_keyboard_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698