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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 776483002: Use the setting to determine whether showing context menu on mouse up. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/web/WebViewImpl.cpp » ('j') | Source/web/WebViewImpl.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 841efd2396de7e5228d4b4ba9983e4debb4b1d07..519bab257a370acc8e2a2d846e5fa1387e5adf94 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -2827,15 +2827,15 @@ bool EventHandler::sendContextMenuEventForKey()
bool EventHandler::sendContextMenuEventForGesture(const GestureEventWithHitTestResults& targetedEvent)
{
-#if OS(WIN)
- PlatformEvent::Type eventType = PlatformEvent::MouseReleased;
-#else
+ unsigned modifiers = targetedEvent.event().modifiers();
PlatformEvent::Type eventType = PlatformEvent::MousePressed;
-#endif
+ if (m_frame->settings()->showContextMenuOnMouseUp())
+ eventType = PlatformEvent::MouseReleased;
+ else
+ modifiers |= PlatformEvent::RightButtonDown;
- unsigned modifiers = targetedEvent.event().modifiers();
PlatformMouseEvent mouseEvent(targetedEvent.event().position(), targetedEvent.event().globalPosition(), RightButton, eventType, 1,
- static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::RightButtonDown),
+ static_cast<PlatformEvent::Modifiers>(modifiers),
PlatformMouseEvent::FromTouch, WTF::currentTime());
// To simulate right-click behavior, we send a right mouse down and then
// context menu event.
« no previous file with comments | « no previous file | Source/web/WebViewImpl.cpp » ('j') | Source/web/WebViewImpl.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698