| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 } | 752 } |
| 753 } | 753 } |
| 754 | 754 |
| 755 PageWidgetEventHandler::handleMouseDown(mainFrame, event); | 755 PageWidgetEventHandler::handleMouseDown(mainFrame, event); |
| 756 | 756 |
| 757 if (event.button == WebMouseEvent::Button::Left && m_mouseCaptureNode) | 757 if (event.button == WebMouseEvent::Button::Left && m_mouseCaptureNode) |
| 758 m_mouseCaptureGestureToken = | 758 m_mouseCaptureGestureToken = |
| 759 mainFrame.eventHandler().takeLastMouseDownGestureToken(); | 759 mainFrame.eventHandler().takeLastMouseDownGestureToken(); |
| 760 | 760 |
| 761 // Dispatch the contextmenu event regardless of if the click was swallowed. | 761 // Dispatch the contextmenu event regardless of if the click was swallowed. |
| 762 if (!page()->settings().showContextMenuOnMouseUp()) { | 762 if (!page()->settings().getShowContextMenuOnMouseUp()) { |
| 763 #if OS(MACOSX) | 763 #if OS(MACOSX) |
| 764 if (event.button == WebMouseEvent::Button::Right || | 764 if (event.button == WebMouseEvent::Button::Right || |
| 765 (event.button == WebMouseEvent::Button::Left && | 765 (event.button == WebMouseEvent::Button::Left && |
| 766 event.modifiers & WebMouseEvent::ControlKey)) | 766 event.modifiers & WebMouseEvent::ControlKey)) |
| 767 mouseContextMenu(event); | 767 mouseContextMenu(event); |
| 768 #else | 768 #else |
| 769 if (event.button == WebMouseEvent::Button::Right) | 769 if (event.button == WebMouseEvent::Button::Right) |
| 770 mouseContextMenu(event); | 770 mouseContextMenu(event); |
| 771 #endif | 771 #endif |
| 772 } | 772 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 803 targetLocalFrame->eventHandler().sendContextMenuEvent(pme, nullptr); | 803 targetLocalFrame->eventHandler().sendContextMenuEvent(pme, nullptr); |
| 804 } | 804 } |
| 805 // Actually showing the context menu is handled by the ContextMenuClient | 805 // Actually showing the context menu is handled by the ContextMenuClient |
| 806 // implementation... | 806 // implementation... |
| 807 } | 807 } |
| 808 | 808 |
| 809 void WebFrameWidgetImpl::handleMouseUp(LocalFrame& mainFrame, | 809 void WebFrameWidgetImpl::handleMouseUp(LocalFrame& mainFrame, |
| 810 const WebMouseEvent& event) { | 810 const WebMouseEvent& event) { |
| 811 PageWidgetEventHandler::handleMouseUp(mainFrame, event); | 811 PageWidgetEventHandler::handleMouseUp(mainFrame, event); |
| 812 | 812 |
| 813 if (page()->settings().showContextMenuOnMouseUp()) { | 813 if (page()->settings().getShowContextMenuOnMouseUp()) { |
| 814 // Dispatch the contextmenu event regardless of if the click was swallowed. | 814 // Dispatch the contextmenu event regardless of if the click was swallowed. |
| 815 // On Mac/Linux, we handle it on mouse down, not up. | 815 // On Mac/Linux, we handle it on mouse down, not up. |
| 816 if (event.button == WebMouseEvent::Button::Right) | 816 if (event.button == WebMouseEvent::Button::Right) |
| 817 mouseContextMenu(event); | 817 mouseContextMenu(event); |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 | 820 |
| 821 WebInputEventResult WebFrameWidgetImpl::handleMouseWheel( | 821 WebInputEventResult WebFrameWidgetImpl::handleMouseWheel( |
| 822 LocalFrame& mainFrame, | 822 LocalFrame& mainFrame, |
| 823 const WebMouseWheelEvent& event) { | 823 const WebMouseWheelEvent& event) { |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 return nullptr; | 1139 return nullptr; |
| 1140 } | 1140 } |
| 1141 | 1141 |
| 1142 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { | 1142 LocalFrame* WebFrameWidgetImpl::focusedLocalFrameAvailableForIme() const { |
| 1143 if (!m_imeAcceptEvents) | 1143 if (!m_imeAcceptEvents) |
| 1144 return nullptr; | 1144 return nullptr; |
| 1145 return focusedLocalFrameInWidget(); | 1145 return focusedLocalFrameInWidget(); |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 } // namespace blink | 1148 } // namespace blink |
| OLD | NEW |