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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2509933002: Drag-and-drop: Target drag messages (the sequel). (Closed)
Patch Set: 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 86257b48c45cb766d5dd5f20f7056b88c1bc4b9d..650b4cc575a09fbd86081f1056138c7b430742cd 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -80,6 +80,7 @@
#include "content/browser/webui/web_ui_impl.h"
#include "content/common/browser_plugin/browser_plugin_constants.h"
#include "content/common/browser_plugin/browser_plugin_messages.h"
+#include "content/common/drag_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
#include "content/common/page_messages.h"
@@ -3018,10 +3019,16 @@ void WebContentsImpl::NotifyWebContentsFocused() {
}
void WebContentsImpl::SystemDragEnded() {
- // TODO(paulmeyer): This will need to target the correct specific RWH to work
- // with OOPIF.
- if (GetRenderViewHost())
- GetRenderViewHost()->GetWidget()->DragSourceSystemDragEnded();
+ // TODO(lukasza/paulmeyer): Rather then sending the IPC to all widgets in the
+ // frame tree, it might be possible to send the IPC only to the widget where
+ // drag-start has fired.
+ for (RenderWidgetHostView* rwhv : GetRenderWidgetHostViewsInTree()) {
+ RenderWidgetHostViewBase* rwhvb =
+ static_cast<RenderWidgetHostViewBase*>(rwhv);
+ RenderWidgetHost* rwh = rwhvb->GetRenderWidgetHost();
+ rwh->Send(new DragMsg_SourceSystemDragEnded(rwh->GetRoutingID()));
dcheng 2016/11/17 17:44:19 We should definitely only be sending this to the d
+ }
+
if (browser_plugin_embedder_.get())
browser_plugin_embedder_->SystemDragEnded();
}

Powered by Google App Engine
This is Rietveld 408576698