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

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

Issue 2475443003: Drag-and-drop: Move startDrag out of WebView/RenderView. (Closed)
Patch Set: Addressed comments by dcheng@. Rebased. 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/ChromeClientImpl.cpp
diff --git a/third_party/WebKit/Source/web/ChromeClientImpl.cpp b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
index 9a15330d50765bcedde5fba60c91fe238ad266b7..2525bf67bc479160a78886b180451b707d8a87d4 100644
--- a/third_party/WebKit/Source/web/ChromeClientImpl.cpp
+++ b/third_party/WebKit/Source/web/ChromeClientImpl.cpp
@@ -260,7 +260,15 @@ void ChromeClientImpl::startDragging(LocalFrame* frame,
WebDragOperationsMask mask,
const WebImage& dragImage,
const WebPoint& dragImageOffset) {
- m_webView->startDragging(frame, dragData, mask, dragImage, dragImageOffset);
+ WebLocalFrameImpl* webFrame = WebLocalFrameImpl::fromFrame(frame);
+ WebFrameWidgetBase* frameWidget = webFrame->localRoot()->frameWidget();
+ if (!frameWidget || !frameWidget->client())
dcheng 2016/11/07 21:11:00 Nit: do we need to null-check client or widget her
paulmeyer 2016/11/07 22:18:13 Probably not. Removed.
+ return;
+
+ WebReferrerPolicy policy = webFrame->document().referrerPolicy();
+ m_webView->setDoingDragAndDrop(true);
+ frameWidget->client()->startDragging(policy, dragData, mask, dragImage,
+ dragImageOffset);
}
bool ChromeClientImpl::acceptsLoadDrops() const {

Powered by Google App Engine
This is Rietveld 408576698