Chromium Code Reviews| Index: third_party/WebKit/Source/core/input/GestureManager.cpp |
| diff --git a/third_party/WebKit/Source/core/input/GestureManager.cpp b/third_party/WebKit/Source/core/input/GestureManager.cpp |
| index 8d4d8390eb015b979de2c88dc43261cbc08c0766..4367b8a8a9f9d88d33829c452f5876b5ab8995fd 100644 |
| --- a/third_party/WebKit/Source/core/input/GestureManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/GestureManager.cpp |
| @@ -254,14 +254,18 @@ WebInputEventResult GestureManager::handleGestureLongPress(const GestureEventWit |
| // supplied HitTestResult), but that will require some overhaul of the touch drag-and-drop code |
| // and LongPress is such a special scenario that it's unlikely to matter much in practice. |
| + IntPoint hitTestPoint = m_frame->view()->rootFrameToContents(gestureEvent.position()); |
| + HitTestResult hitTestResult = m_frame->eventHandler().hitTestResultAtPoint(hitTestPoint); |
| + |
| m_longTapShouldInvokeContextMenu = false; |
| - if (m_frame->eventHandler().handleDragDropIfPossible(targetedEvent)) { |
| + bool hitTestContainsLinks = hitTestResult.URLElement() || !hitTestResult.absoluteLinkURL().isNull() || !hitTestResult.absoluteImageURL().isNull() || !hitTestResult.absoluteMediaURL().isNull(); |
|
dcheng
2016/08/29 19:45:08
This isn't just links, right? It's images and vide
hush (inactive)
2016/08/29 20:49:49
Yes. Long pressing on images and videos should ope
dcheng
2016/08/29 21:10:03
As discussed offline, I think we can just check Hi
hush (inactive)
2016/08/29 21:14:53
Done.
|
| + |
| + if (!hitTestContainsLinks && m_frame->eventHandler().handleDragDropIfPossible(targetedEvent)) { |
| m_longTapShouldInvokeContextMenu = true; |
| return WebInputEventResult::HandledSystem; |
| } |
| - IntPoint hitTestPoint = m_frame->view()->rootFrameToContents(gestureEvent.position()); |
| - HitTestResult result = m_frame->eventHandler().hitTestResultAtPoint(hitTestPoint); |
| - if (m_selectionController->handleGestureLongPress(gestureEvent, result)) { |
| + |
| + if (m_selectionController->handleGestureLongPress(gestureEvent, hitTestResult)) { |
| m_frame->eventHandler().focusDocumentView(); |
| return WebInputEventResult::HandledSystem; |
| } |