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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2396693002: Convert drag event position to root frame. (Closed)
Patch Set: rebase Created 4 years, 2 months 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 | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index bb94c806e7896c8ece6b8ae922b69a8a9eea6be0..60e00f9dc306fa3a91436dd4678d41fb5ca8e098 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3782,11 +3782,14 @@ HitTestResult WebViewImpl::coreHitTestResultAt(
return hitTestResultForRootFramePos(pointInRootFrame);
}
-void WebViewImpl::dragSourceEndedAt(const WebPoint& clientPoint,
+void WebViewImpl::dragSourceEndedAt(const WebPoint& pointInViewport,
const WebPoint& screenPoint,
WebDragOperation operation) {
+ WebPoint pointInRootFrame(
+ page()->frameHost().visualViewport().viewportToRootFrame(
+ pointInViewport));
PlatformMouseEvent pme(
- clientPoint, screenPoint, WebPointerProperties::Button::Left,
+ pointInRootFrame, screenPoint, WebPointerProperties::Button::Left,
PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers,
PlatformMouseEvent::RealOrIndistinguishable,
WTF::monotonicallyIncreasingTime());
@@ -3805,7 +3808,7 @@ void WebViewImpl::dragSourceSystemDragEnded() {
WebDragOperation WebViewImpl::dragTargetDragEnter(
const WebDragData& webDragData,
- const WebPoint& clientPoint,
+ const WebPoint& pointInViewport,
const WebPoint& screenPoint,
WebDragOperationsMask operationsAllowed,
int modifiers) {
@@ -3814,18 +3817,18 @@ WebDragOperation WebViewImpl::dragTargetDragEnter(
m_currentDragData = DataObject::create(webDragData);
m_operationsAllowed = operationsAllowed;
- return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragEnter,
+ return dragTargetDragEnterOrOver(pointInViewport, screenPoint, DragEnter,
modifiers);
}
WebDragOperation WebViewImpl::dragTargetDragOver(
- const WebPoint& clientPoint,
+ const WebPoint& pointInViewport,
const WebPoint& screenPoint,
WebDragOperationsMask operationsAllowed,
int modifiers) {
m_operationsAllowed = operationsAllowed;
- return dragTargetDragEnterOrOver(clientPoint, screenPoint, DragOver,
+ return dragTargetDragEnterOrOver(pointInViewport, screenPoint, DragOver,
modifiers);
}
@@ -3844,9 +3847,13 @@ void WebViewImpl::dragTargetDragLeave() {
}
void WebViewImpl::dragTargetDrop(const WebDragData& webDragData,
- const WebPoint& clientPoint,
+ const WebPoint& pointInViewport,
const WebPoint& screenPoint,
int modifiers) {
+ WebPoint pointInRootFrame(
+ page()->frameHost().visualViewport().viewportToRootFrame(
+ pointInViewport));
+
DCHECK(m_currentDragData);
m_currentDragData = DataObject::create(webDragData);
@@ -3868,7 +3875,7 @@ void WebViewImpl::dragTargetDrop(const WebDragData& webDragData,
}
m_currentDragData->setModifiers(modifiers);
- DragData dragData(m_currentDragData.get(), clientPoint, screenPoint,
+ DragData dragData(m_currentDragData.get(), pointInRootFrame, screenPoint,
static_cast<DragOperation>(m_operationsAllowed));
UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture);
@@ -3905,14 +3912,18 @@ void WebViewImpl::removeSpellingMarkersUnderWords(
}
WebDragOperation WebViewImpl::dragTargetDragEnterOrOver(
- const WebPoint& clientPoint,
+ const WebPoint& pointInViewport,
const WebPoint& screenPoint,
DragAction dragAction,
int modifiers) {
DCHECK(m_currentDragData);
+ WebPoint pointInRootFrame(
+ page()->frameHost().visualViewport().viewportToRootFrame(
+ pointInViewport));
+
m_currentDragData->setModifiers(modifiers);
- DragData dragData(m_currentDragData.get(), clientPoint, screenPoint,
+ DragData dragData(m_currentDragData.get(), pointInRootFrame, screenPoint,
static_cast<DragOperation>(m_operationsAllowed));
DragSession dragSession;
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/public/web/WebView.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698