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/core/events/KeyboardEvent.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Created 4 years 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/core/events/KeyboardEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
index 03975fd5c0e8ab23ed6d61a04db2c2d41d5bac03..a78f873303c875cb767da5f43d24b970a6bb13f9 100644
--- a/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
+++ b/third_party/WebKit/Source/core/events/KeyboardEvent.cpp
@@ -54,11 +54,11 @@ const AtomicString& eventTypeForKeyboardEventType(WebInputEvent::Type type) {
}
KeyboardEvent::KeyLocationCode keyLocationCode(const WebInputEvent& key) {
- if (key.modifiers & WebInputEvent::IsKeyPad)
+ if (key.modifiers() & WebInputEvent::IsKeyPad)
return KeyboardEvent::kDomKeyLocationNumpad;
- if (key.modifiers & WebInputEvent::IsLeft)
+ if (key.modifiers() & WebInputEvent::IsLeft)
return KeyboardEvent::kDomKeyLocationLeft;
- if (key.modifiers & WebInputEvent::IsRight)
+ if (key.modifiers() & WebInputEvent::IsRight)
return KeyboardEvent::kDomKeyLocationRight;
return KeyboardEvent::kDomKeyLocationStandard;
}
@@ -89,13 +89,13 @@ KeyboardEvent::KeyboardEvent() : m_location(kDomKeyLocationStandard) {}
KeyboardEvent::KeyboardEvent(const WebKeyboardEvent& key,
LocalDOMWindow* domWindow)
: UIEventWithKeyState(
- eventTypeForKeyboardEventType(key.type),
+ eventTypeForKeyboardEventType(key.type()),
true,
true,
domWindow,
0,
- static_cast<PlatformEvent::Modifiers>(key.modifiers),
- key.timeStampSeconds,
+ static_cast<PlatformEvent::Modifiers>(key.modifiers()),
+ key.timeStampSeconds(),
InputDeviceCapabilities::doesntFireTouchEventsSourceCapabilities()),
m_keyEvent(WTF::makeUnique<WebKeyboardEvent>(key)),
// TODO(crbug.com/482880): Fix this initialization to lazy initialization.

Powered by Google App Engine
This is Rietveld 408576698