Chromium Code Reviews| 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) |