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

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

Issue 2501213002: Drag-and-drop: dragSourceEndedAt, dragSourceSystemDragEnded (Closed)
Patch Set: Rebased. Added check for !GetWebWidget(). Created 4 years, 1 month 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
Index: third_party/WebKit/Source/web/WebFrameWidgetBase.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetBase.cpp b/third_party/WebKit/Source/web/WebFrameWidgetBase.cpp
index 91a656083d985593544d971c18fd9e5643382f86..26d39f4023ffc31cfd03dc57a06ab91ce218fde8 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetBase.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetBase.cpp
@@ -6,6 +6,7 @@
#include "core/frame/FrameHost.h"
#include "core/frame/VisualViewport.h"
+#include "core/input/EventHandler.h"
#include "core/page/DragActions.h"
#include "core/page/DragController.h"
#include "core/page/DragData.h"
@@ -91,6 +92,30 @@ void WebFrameWidgetBase::dragTargetDrop(const WebDragData& webDragData,
m_currentDragData = nullptr;
}
+void WebFrameWidgetBase::dragSourceEndedAt(const WebPoint& pointInViewport,
+ const WebPoint& screenPoint,
+ WebDragOperation operation) {
+ WebPoint pointInRootFrame(
+ page()->frameHost().visualViewport().viewportToRootFrame(
+ pointInViewport));
+ PlatformMouseEvent pme(
+ pointInRootFrame, screenPoint, WebPointerProperties::Button::Left,
+ PlatformEvent::MouseMoved, 0, PlatformEvent::NoModifiers,
+ PlatformMouseEvent::RealOrIndistinguishable,
+ WTF::monotonicallyIncreasingTime());
+ page()->deprecatedLocalMainFrame()->eventHandler().dragSourceEndedAt(
+ pme, static_cast<DragOperation>(operation));
+}
+
+void WebFrameWidgetBase::dragSourceSystemDragEnded() {
+ // It's possible for us to get this callback while not doing a drag if it's
+ // from a previous page that got unloaded.
+ if (view()->doingDragAndDrop()) {
+ page()->dragController().dragEnded();
+ view()->setDoingDragAndDrop(false);
+ }
+}
+
WebDragOperation WebFrameWidgetBase::dragTargetDragEnterOrOver(
const WebPoint& pointInViewport,
const WebPoint& screenPoint,

Powered by Google App Engine
This is Rietveld 408576698