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 bb56ddba8fd8f4a17637580c017a1e3880187b65..b48db20b9a43817a5db53c8d1fc21992d64b110e 100644 |
| --- a/third_party/WebKit/Source/core/input/GestureManager.cpp |
| +++ b/third_party/WebKit/Source/core/input/GestureManager.cpp |
| @@ -254,14 +254,22 @@ 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()); |
|
dtapuska
2016/08/17 13:39:49
Seems reasonable. I'd like to see a test exercisin
hush (inactive)
2016/08/17 18:09:46
Is it OK for the test to be Android only? The adde
dtapuska
2016/08/17 18:12:46
I believe there are virtual LayoutTests for androi
|
| + HitTestResult hitTestResult = m_frame->eventHandler().hitTestResultAtPoint(hitTestPoint); |
| + |
| m_longTapShouldInvokeContextMenu = false; |
| - if (m_frame->eventHandler().handleDragDropIfPossible(targetedEvent)) { |
| + bool willTryDragDrop = true; |
| + |
| +#if OS(ANDROID) |
| + if (hitTestResult.URLElement() || !hitTestResult.absoluteLinkURL().isNull() || !hitTestResult.absoluteImageURL().isNull() || !hitTestResult.absoluteMediaURL().isNull()) |
| + willTryDragDrop = false; |
| +#endif |
| + if (willTryDragDrop && 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; |
| } |