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

Unified Diff: ui/base/accelerators/accelerator.cc

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 | « ui/base/accelerators/accelerator.h ('k') | ui/base/strings/ui_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/accelerators/accelerator.cc
===================================================================
--- ui/base/accelerators/accelerator.cc (revision 152319)
+++ ui/base/accelerators/accelerator.cc (working copy)
@@ -71,17 +71,21 @@
}
bool Accelerator::IsShiftDown() const {
- return (modifiers_ & EF_SHIFT_DOWN) == EF_SHIFT_DOWN;
+ return (modifiers_ & EF_SHIFT_DOWN) != 0;
}
bool Accelerator::IsCtrlDown() const {
- return (modifiers_ & EF_CONTROL_DOWN) == EF_CONTROL_DOWN;
+ return (modifiers_ & EF_CONTROL_DOWN) != 0;
}
bool Accelerator::IsAltDown() const {
- return (modifiers_ & EF_ALT_DOWN) == EF_ALT_DOWN;
+ return (modifiers_ & EF_ALT_DOWN) != 0;
}
+bool Accelerator::IsCmdDown() const {
+ return (modifiers_ & EF_COMMAND_DOWN) != 0;
+}
+
string16 Accelerator::GetShortcutText() const {
int string_id = 0;
switch(key_code_) {
@@ -194,6 +198,9 @@
else if (IsAltDown())
shortcut = l10n_util::GetStringFUTF16(IDS_APP_ALT_MODIFIER, shortcut);
+ if (IsCmdDown())
+ shortcut = l10n_util::GetStringFUTF16(IDS_APP_COMMAND_MODIFIER, shortcut);
+
// For some reason, menus in Windows ignore standard Unicode directionality
// marks (such as LRE, PDF, etc.). On RTL locales, we use RTL menus and
// therefore any text we draw for the menu items is drawn in an RTL context.
« no previous file with comments | « ui/base/accelerators/accelerator.h ('k') | ui/base/strings/ui_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698