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

Unified Diff: Source/web/WebInputEventConversion.cpp

Issue 1311233004: Cleanup IsKeyPad and IsAutoRepeat in PlatformKeyboardEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 | « Source/platform/PlatformKeyboardEvent.h ('k') | Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebInputEventConversion.cpp
diff --git a/Source/web/WebInputEventConversion.cpp b/Source/web/WebInputEventConversion.cpp
index 37c0861ba0561d80448b86cb3dac11ddde1fb200..df65059f3854eea1db3b53d39b914e98e04c179d 100644
--- a/Source/web/WebInputEventConversion.cpp
+++ b/Source/web/WebInputEventConversion.cpp
@@ -102,6 +102,16 @@ static unsigned toPlatformEventModifiers(int webModifiers)
return newModifiers;
}
+static unsigned toPlatformKeyboardEventModifiers(int webModifiers)
+{
+ unsigned newModifiers = toPlatformEventModifiers(webModifiers);
+ if (webModifiers & WebInputEvent::IsKeyPad)
+ newModifiers |= PlatformEvent::IsKeyPad;
+ if (webModifiers & WebInputEvent::IsAutoRepeat)
+ newModifiers |= PlatformEvent::IsAutoRepeat;
+ return newModifiers;
+}
+
unsigned toPlatformMouseEventModifiers(int webModifiers)
{
unsigned newModifiers = toPlatformEventModifiers(webModifiers);
@@ -303,15 +313,13 @@ PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder(const WebKeyboardEven
m_text = String(e.text);
m_unmodifiedText = String(e.unmodifiedText);
m_keyIdentifier = String(e.keyIdentifier);
- m_autoRepeat = (e.modifiers & WebInputEvent::IsAutoRepeat);
m_nativeVirtualKeyCode = e.nativeKeyCode;
- m_isKeypad = (e.modifiers & WebInputEvent::IsKeyPad);
m_isSystemKey = e.isSystemKey;
// TODO: BUG482880 Fix this initialization to lazy initialization.
m_code = Platform::current()->domCodeStringFromEnum(e.domCode);
m_key = Platform::current()->domKeyStringFromEnum(e.domKey);
- m_modifiers = toPlatformEventModifiers(e.modifiers);
+ m_modifiers = toPlatformKeyboardEventModifiers(e.modifiers);
// FIXME: PlatformKeyboardEvents expect a locational version of the keycode (e.g. VK_LSHIFT
// instead of VK_SHIFT). This should be changed so the location/keycode are stored separately,
« no previous file with comments | « Source/platform/PlatformKeyboardEvent.h ('k') | Source/web/tests/WebPluginContainerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698