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

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

Issue 8773003: Implement Accelerator::GetShortcutText for non-Windows Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/base/accelerators/accelerator.cc
diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
index 74d9f031894a2cd55083493cb28f19c0bf538e8b..bd5d9e551a41edcd7e31478459520bd443aefbb7 100644
--- a/ui/base/accelerators/accelerator.cc
+++ b/ui/base/accelerators/accelerator.cc
@@ -17,6 +17,10 @@
#include "grit/ui_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#if !defined(OS_WIN) && defined(USE_AURA)
+#include "ui/base/keycodes/keyboard_code_conversion.h"
+#endif
+
namespace ui {
string16 Accelerator::GetShortcutText() const {
@@ -83,6 +87,11 @@ string16 Accelerator::GetShortcutText() const {
else
key = LOWORD(::MapVirtualKeyW(key_code_, MAPVK_VK_TO_CHAR));
shortcut += key;
+#elif defined(USE_AURA)
+ const uint16 c = GetCharacterFromKeyCode(key_code_, false);
+ if (c != 0) {
+ shortcut += static_cast<string16::value_type>(base::ToUpperASCII(c));
+ }
#elif defined(TOOLKIT_USES_GTK)
const gchar* name = NULL;
switch (key_code_) {
« 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