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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 232573002: Deliver Menu key event after sending context menu event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix for Layout test failure on windows Created 6 years, 8 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 | « LayoutTests/platform/win/fast/events/keydown-menu-key-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 6e2085bdb363d92e0573da816a9c952436ebeece..5edb2e537221bcde08d316c511d0824b500e14ef 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -915,6 +915,19 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
RefPtr<LocalFrame> frame = toLocalFrame(focusedFrame.get());
+ PlatformKeyboardEventBuilder evt(event);
+
+ if (frame->eventHandler().keyEvent(evt)) {
+ if (WebInputEvent::RawKeyDown == event.type) {
+ // Suppress the next keypress event unless the focused node is a plug-in node.
+ // (Flash needs these keypress events to handle non-US keyboards.)
+ Element* element = focusedElement();
+ if (!element || !element->renderer() || !element->renderer()->isEmbeddedObject())
+ m_suppressNextKeypressEvent = true;
+ }
+ return true;
+ }
+
#if !OS(MACOSX)
const WebInputEvent::Type contextMenuTriggeringEventType =
#if OS(WIN)
@@ -931,19 +944,6 @@ bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
}
#endif // !OS(MACOSX)
- PlatformKeyboardEventBuilder evt(event);
-
- if (frame->eventHandler().keyEvent(evt)) {
- if (WebInputEvent::RawKeyDown == event.type) {
- // Suppress the next keypress event unless the focused node is a plug-in node.
- // (Flash needs these keypress events to handle non-US keyboards.)
- Element* element = focusedElement();
- if (!element || !element->renderer() || !element->renderer()->isEmbeddedObject())
- m_suppressNextKeypressEvent = true;
- }
- return true;
- }
-
return keyEventDefault(event);
}
« no previous file with comments | « LayoutTests/platform/win/fast/events/keydown-menu-key-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698