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

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

Issue 2160983003: [ContextMenu] Shift+F10 should trigger contextmenu on keydown to match system behavior (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index b5c1dda24e90c95843c812982ca998fafeec7b74..ef9f70f900b3bfe002f3c28b1393310ccb62d128 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -1070,16 +1070,18 @@ WebInputEventResult WebFrameWidgetImpl::handleKeyEvent(const WebKeyboardEvent& e
}
#if !OS(MACOSX)
- const WebInputEvent::Type contextMenuTriggeringEventType =
+ const WebInputEvent::Type contextMenuKeyTriggeringEventType =
#if OS(WIN)
WebInputEvent::KeyUp;
#else
WebInputEvent::RawKeyDown;
#endif
+ const WebInputEvent::Type shiftF10TriggeringEventType = WebInputEvent::RawKeyDown;
bool isUnmodifiedMenuKey = !(event.modifiers & WebInputEvent::InputModifiers) && event.windowsKeyCode == VKEY_APPS;
bool isShiftF10 = (event.modifiers & WebInputEvent::InputModifiers) == WebInputEvent::ShiftKey && event.windowsKeyCode == VKEY_F10;
- if ((isUnmodifiedMenuKey || isShiftF10) && event.type == contextMenuTriggeringEventType) {
+ if ((isUnmodifiedMenuKey && event.type == contextMenuKeyTriggeringEventType)
+ || (isShiftF10 && event.type == shiftF10TriggeringEventType)) {
view()->sendContextMenuEvent(event);
return WebInputEventResult::HandledSystem;
}

Powered by Google App Engine
This is Rietveld 408576698