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

Unified Diff: third_party/WebKit/Source/web/WebInputEvent.cpp

Issue 2120153003: Remove keyIdentifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_key_identifier_3a
Patch Set: Rebase Created 4 years, 5 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: third_party/WebKit/Source/web/WebInputEvent.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEvent.cpp b/third_party/WebKit/Source/web/WebInputEvent.cpp
index e13981655e9e11aa55dfef1ba81a58f5d9d465c6..bf8e4db7274fbd6c2ab1876159dafec517e3e1cf 100644
--- a/third_party/WebKit/Source/web/WebInputEvent.cpp
+++ b/third_party/WebKit/Source/web/WebInputEvent.cpp
@@ -43,7 +43,7 @@ struct SameSizeAsWebInputEvent {
};
struct SameSizeAsWebKeyboardEvent : public SameSizeAsWebInputEvent {
- int keyboardData[14];
+ int keyboardData[9];
};
struct SameSizeAsWebMouseEvent : public SameSizeAsWebInputEvent {
@@ -70,133 +70,4 @@ static_assert(sizeof(WebMouseWheelEvent) == sizeof(SameSizeAsWebMouseWheelEvent)
static_assert(sizeof(WebGestureEvent) == sizeof(SameSizeAsWebGestureEvent), "WebGestureEvent should not have gaps");
static_assert(sizeof(WebTouchEvent) == sizeof(SameSizeAsWebTouchEvent), "WebTouchEvent should not have gaps");
-static const char* staticKeyIdentifiers(unsigned short keyCode)
-{
- switch (keyCode) {
- case VKEY_MENU:
- return "Alt";
- case VKEY_CONTROL:
- return "Control";
- case VKEY_SHIFT:
- return "Shift";
- case VKEY_CAPITAL:
- return "CapsLock";
- case VKEY_LWIN:
- case VKEY_RWIN:
- return "Win";
- case VKEY_CLEAR:
- return "Clear";
- case VKEY_DOWN:
- return "Down";
- case VKEY_END:
- return "End";
- case 0x0A: // Carriage return
- case VKEY_RETURN:
- return "Enter";
- case VKEY_EXECUTE:
- return "Execute";
- case VKEY_F1:
- return "F1";
- case VKEY_F2:
- return "F2";
- case VKEY_F3:
- return "F3";
- case VKEY_F4:
- return "F4";
- case VKEY_F5:
- return "F5";
- case VKEY_F6:
- return "F6";
- case VKEY_F7:
- return "F7";
- case VKEY_F8:
- return "F8";
- case VKEY_F9:
- return "F9";
- case VKEY_F10:
- return "F10";
- case VKEY_F11:
- return "F11";
- case VKEY_F12:
- return "F12";
- case VKEY_F13:
- return "F13";
- case VKEY_F14:
- return "F14";
- case VKEY_F15:
- return "F15";
- case VKEY_F16:
- return "F16";
- case VKEY_F17:
- return "F17";
- case VKEY_F18:
- return "F18";
- case VKEY_F19:
- return "F19";
- case VKEY_F20:
- return "F20";
- case VKEY_F21:
- return "F21";
- case VKEY_F22:
- return "F22";
- case VKEY_F23:
- return "F23";
- case VKEY_F24:
- return "F24";
- case VKEY_HELP:
- return "Help";
- case VKEY_HOME:
- return "Home";
- case VKEY_INSERT:
- return "Insert";
- case VKEY_LEFT:
- return "Left";
- case VKEY_NEXT:
- return "PageDown";
- case VKEY_PRIOR:
- return "PageUp";
- case VKEY_PAUSE:
- return "Pause";
- case VKEY_SNAPSHOT:
- return "PrintScreen";
- case VKEY_RIGHT:
- return "Right";
- case VKEY_SCROLL:
- return "Scroll";
- case VKEY_SELECT:
- return "Select";
- case VKEY_UP:
- return "Up";
- case VKEY_DELETE:
- return "U+007F"; // Standard says that DEL becomes U+007F.
- case VKEY_MEDIA_NEXT_TRACK:
- return "MediaNextTrack";
- case VKEY_MEDIA_PREV_TRACK:
- return "MediaPreviousTrack";
- case VKEY_MEDIA_STOP:
- return "MediaStop";
- case VKEY_MEDIA_PLAY_PAUSE:
- return "MediaPlayPause";
- case VKEY_VOLUME_MUTE:
- return "VolumeMute";
- case VKEY_VOLUME_DOWN:
- return "VolumeDown";
- case VKEY_VOLUME_UP:
- return "VolumeUp";
- default:
- return 0;
- }
-}
-
-void WebKeyboardEvent::setKeyIdentifierFromWindowsKeyCode()
-{
- const char* id = staticKeyIdentifiers(windowsKeyCode);
- if (id) {
- strncpy(keyIdentifier, id, sizeof(keyIdentifier) - 1);
- keyIdentifier[sizeof(keyIdentifier) - 1] = '\0';
- } else {
- snprintf(keyIdentifier, sizeof(keyIdentifier), "U+%04X", toASCIIUpper(windowsKeyCode));
- }
-}
-
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698