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

Unified Diff: Source/web/WebViewImpl.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 | « Source/core/page/EventHandler.cpp ('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 441bc5f6fd3f7ad01955839f4e33b5d32c9af34f..a3f125b30fc821ad6a25fff0ca5bb97566be41b7 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -534,18 +534,17 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
closePagePopup(m_pagePopup.get());
}
- // Dispatch the contextmenu event regardless of if the click was swallowed.
Rick Byers 2014/12/02 19:33:06 This comment is still relevant - keep it.
zino 2014/12/03 12:32:24 Done.
-#if OS(WIN)
- // On Windows, we handle it on mouse up, not down.
-#elif OS(MACOSX)
- if (event.button == WebMouseEvent::ButtonRight
- || (event.button == WebMouseEvent::ButtonLeft
- && event.modifiers & WebMouseEvent::ControlKey))
- mouseContextMenu(event);
+ if (!page()->settings().showContextMenuOnMouseUp()) {
+#if OS(MACOSX)
+ if (event.button == WebMouseEvent::ButtonRight
+ || (event.button == WebMouseEvent::ButtonLeft
+ && event.modifiers & WebMouseEvent::ControlKey))
+ mouseContextMenu(event);
#else
- if (event.button == WebMouseEvent::ButtonRight)
- mouseContextMenu(event);
+ if (event.button == WebMouseEvent::ButtonRight)
+ mouseContextMenu(event);
#endif
+ }
}
void WebViewImpl::mouseContextMenu(const WebMouseEvent& event)
@@ -585,12 +584,12 @@ void WebViewImpl::handleMouseUp(LocalFrame& mainFrame, const WebMouseEvent& even
{
PageWidgetEventHandler::handleMouseUp(mainFrame, event);
-#if OS(WIN)
- // Dispatch the contextmenu event regardless of if the click was swallowed.
- // On Mac/Linux, we handle it on mouse down, not up.
- if (event.button == WebMouseEvent::ButtonRight)
- mouseContextMenu(event);
-#endif
+ if (page()->settings().showContextMenuOnMouseUp()) {
+ // Dispatch the contextmenu event regardless of if the click was swallowed.
+ // On Mac/Linux, we handle it on mouse down, not up.
+ if (event.button == WebMouseEvent::ButtonRight)
+ mouseContextMenu(event);
+ }
}
bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEvent& event)
« no previous file with comments | « Source/core/page/EventHandler.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698