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

Unified Diff: third_party/WebKit/Source/core/input/KeyboardEventManager.cpp

Issue 2573073003: Collapse the API surface on WebInputEvent via accessor functions. (Closed)
Patch Set: Fix nits Created 3 years, 11 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/core/input/KeyboardEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp b/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp
index 96d73d23f2f4b6c88138da0a09f4b3c8286363ae..c27e4239e7f7b8a178a101b1bb83b47beb9fcc27 100644
--- a/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/KeyboardEventManager.cpp
@@ -139,8 +139,8 @@ bool KeyboardEventManager::handleAccessKey(const WebKeyboardEvent& evt) {
// correct element is matched based on Shift key state. Firefox only matches
// an access key if Shift is not pressed, and does that case-insensitively.
DCHECK(!(kAccessKeyModifiers & WebInputEvent::ShiftKey));
- if ((evt.modifiers & (WebKeyboardEvent::KeyModifiers &
- ~WebInputEvent::ShiftKey)) != kAccessKeyModifiers)
+ if ((evt.modifiers() & (WebKeyboardEvent::KeyModifiers &
+ ~WebInputEvent::ShiftKey)) != kAccessKeyModifiers)
return false;
String key = String(evt.unmodifiedText);
Element* elem = m_frame->document()->getElementByAccessKey(key.lower());
@@ -161,8 +161,8 @@ WebInputEventResult KeyboardEventManager::keyEvent(
DCHECK(RuntimeEnabledFeatures::middleClickAutoscrollEnabled());
// If a key is pressed while the middleClickAutoscroll is in progress then
// we want to stop.
- if (initialKeyEvent.type == WebInputEvent::KeyDown ||
- initialKeyEvent.type == WebInputEvent::RawKeyDown)
+ if (initialKeyEvent.type() == WebInputEvent::KeyDown ||
+ initialKeyEvent.type() == WebInputEvent::RawKeyDown)
m_scrollManager->stopAutoscroll();
// If we were in panscroll mode, we swallow the key event
@@ -188,13 +188,13 @@ WebInputEventResult KeyboardEventManager::keyEvent(
// currently match either Mac or Windows behavior, depending on whether they
// send combined KeyDown events.
bool matchedAnAccessKey = false;
- if (initialKeyEvent.type == WebInputEvent::KeyDown)
+ if (initialKeyEvent.type() == WebInputEvent::KeyDown)
matchedAnAccessKey = handleAccessKey(initialKeyEvent);
// FIXME: it would be fair to let an input method handle KeyUp events before
// DOM dispatch.
- if (initialKeyEvent.type == WebInputEvent::KeyUp ||
- initialKeyEvent.type == WebInputEvent::Char) {
+ if (initialKeyEvent.type() == WebInputEvent::KeyUp ||
+ initialKeyEvent.type() == WebInputEvent::Char) {
KeyboardEvent* domEvent = KeyboardEvent::create(
initialKeyEvent, m_frame->document()->domWindow());
@@ -203,7 +203,7 @@ WebInputEventResult KeyboardEventManager::keyEvent(
}
WebKeyboardEvent keyDownEvent = initialKeyEvent;
- if (keyDownEvent.type != WebInputEvent::RawKeyDown)
+ if (keyDownEvent.type() != WebInputEvent::RawKeyDown)
keyDownEvent.setType(WebInputEvent::RawKeyDown);
KeyboardEvent* keydown =
KeyboardEvent::create(keyDownEvent, m_frame->document()->domWindow());
@@ -222,7 +222,7 @@ WebInputEventResult KeyboardEventManager::keyEvent(
if (changedFocusedFrame)
return WebInputEventResult::HandledSystem;
- if (initialKeyEvent.type == WebInputEvent::RawKeyDown)
+ if (initialKeyEvent.type() == WebInputEvent::RawKeyDown)
return WebInputEventResult::NotHandled;
// Focus may have changed during keydown handling, so refetch node.
« no previous file with comments | « third_party/WebKit/Source/core/input/GestureManager.cpp ('k') | third_party/WebKit/Source/core/input/MouseEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698