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

Unified Diff: webkit/plugins/ppapi/usb_key_code_conversion_mac.cc

Issue 12320014: Switch Pepper Linux to use shared USB<->native key conversion table. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix missed kInvalidKeycode. Created 7 years, 10 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
Index: webkit/plugins/ppapi/usb_key_code_conversion_mac.cc
diff --git a/webkit/plugins/ppapi/usb_key_code_conversion_mac.cc b/webkit/plugins/ppapi/usb_key_code_conversion_mac.cc
index fab38b6ef006267eb77256f60a40eda88df1fdb6..82d109b73198aa9f4969fdbfcdab4f7a1fb321bf 100644
--- a/webkit/plugins/ppapi/usb_key_code_conversion_mac.cc
+++ b/webkit/plugins/ppapi/usb_key_code_conversion_mac.cc
@@ -18,18 +18,10 @@ namespace {
#include "ui/base/keycodes/usb_keycode_map.h"
#undef USB_KEYMAP
-} // anonymous namespace
+} // anonymous namespace
uint32_t UsbKeyCodeForKeyboardEvent(const WebKeyboardEvent& key_event) {
- if (key_event.nativeKeyCode < 0 || key_event.nativeKeyCode > 0x7f)
- return 0;
-
- for (uint i = 0; i < arraysize(usb_keycode_map); i++) {
- if (usb_keycode_map[i].native_keycode == key_event.nativeKeyCode)
- return usb_keycode_map[i].usb_keycode;
- }
-
- return 0;
+ return NativeKeycodeToUsbKeycode(key_event.nativeKeyCode);
}
} // namespace ppapi
« no previous file with comments | « webkit/plugins/ppapi/usb_key_code_conversion_linux.cc ('k') | webkit/plugins/ppapi/usb_key_code_conversion_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698