Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index 0950ee8417e53b43d20c191c89ed6af2afcd5163..113dd035853abf2417bea124f57b95edc81eb378 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -445,10 +445,10 @@ void BrowserPluginGuest::EndSystemDragIfApplicable() { |
RenderViewHostImpl* guest_rvh = static_cast<RenderViewHostImpl*>( |
GetWebContents()->GetRenderViewHost()); |
guest_rvh->DragSourceSystemDragEnded(); |
- |
last_drag_status_ = blink::WebDragStatusUnknown; |
seen_embedder_system_drag_ended_ = false; |
seen_embedder_drag_source_ended_at_ = false; |
+ dragged_url_ = GURL(); |
} |
} |
@@ -674,10 +674,13 @@ void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, |
blink::WebDragOperationsMask mask, |
const gfx::Point& location) { |
RenderViewHost* host = GetWebContents()->GetRenderViewHost(); |
+ auto embedder = owner_web_contents_->GetBrowserPluginEmbedder(); |
switch (drag_status) { |
case blink::WebDragStatusEnter: |
- owner_web_contents_->GetBrowserPluginEmbedder()->DragEnteredGuest( |
- this); |
+ // Only track the URL being dragged over the guest if the link isn't |
+ // coming from the guest. |
+ if (!embedder->DragEnteredGuest(this)) |
+ dragged_url_ = drop_data.url; |
lazyboy
2015/02/23 17:11:10
Just double checking, if the drop data doesn't hav
Fady Samuel
2015/02/23 19:57:07
Yup, the GURL is not valid, and spec() is empty st
|
host->DragTargetDragEnter(drop_data, location, location, mask, 0); |
break; |
case blink::WebDragStatusOver: |
@@ -689,6 +692,10 @@ void BrowserPluginGuest::OnDragStatusUpdate(int browser_plugin_instance_id, |
break; |
case blink::WebDragStatusDrop: |
host->DragTargetDrop(location, location, 0); |
+ if (dragged_url_.is_valid()) { |
+ delegate_->DidDropLink(dragged_url_); |
+ dragged_url_ = GURL(); |
+ } |
break; |
case blink::WebDragStatusUnknown: |
NOTREACHED(); |