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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 945333002: Implement <webview> droplink event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_bpe
Patch Set: Created 5 years, 10 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
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();

Powered by Google App Engine
This is Rietveld 408576698