summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 22:45:18 +0000
committerlazyboy@chromium.org <lazyboy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-23 22:45:18 +0000
commitb72a9890148a2f3d48e715af574bafc24a3ad7b2 (patch)
tree650f288d19be3dcb58444b5fec861ef8bf049bb9
parentbf74ff88f6c227d334292fef05b9840acb4826f6 (diff)
downloadchromium_src-b72a9890148a2f3d48e715af574bafc24a3ad7b2.zip
chromium_src-b72a9890148a2f3d48e715af574bafc24a3ad7b2.tar.gz
chromium_src-b72a9890148a2f3d48e715af574bafc24a3ad7b2.tar.bz2
<webview>: Fix incomplete drag operation to not make guest go stale.
If a drag starts in a <webview> and the drag source is not dropped to a target within the same <webview>, then this makes the <webview> go stale and not appear to accept any further inputs. This is because the SystemDragEnded() message is not passed to the guest RVH. The fix is to make SystemDragEnded() to be called. This is a winaura only issue because of the order of the following two methods: 1. BrowserPluginGuest::OnDragStatusUpdate() and 2. WebContents::SystemDragEnded(). On winaura, #2 is seen before DragLeave message appears from #1, where as for gtk, we see DragLeave message in #1 first and then #2. BUG=332362 Test=Load an app with <webview> where you can select some text within the <webview>. Now start dragging the text but keep the cursor within the bounds of the guest and release the mouse to prematurely end the drag on a non target. Now re-selecting text/focusing any input box in the <webview> should work. Review URL: https://codereview.chromium.org/143943008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246708 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/browser_plugin/browser_plugin_embedder.cc6
-rw-r--r--content/browser/browser_plugin/browser_plugin_embedder.h2
2 files changed, 6 insertions, 2 deletions
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.cc b/content/browser/browser_plugin/browser_plugin_embedder.cc
index 2160f23..e778efb 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.cc
+++ b/content/browser/browser_plugin/browser_plugin_embedder.cc
@@ -173,8 +173,10 @@ void BrowserPluginEmbedder::DragSourceMovedTo(int client_x, int client_y,
}
void BrowserPluginEmbedder::SystemDragEnded() {
- if (guest_started_drag_.get() &&
- (guest_started_drag_.get() != guest_dragging_over_.get()))
+ // When the embedder's drag/drop operation ends, we need to pass the message
+ // to the guest that initiated the drag/drop operation. This will ensure that
+ // the guest's RVH state is reset properly.
+ if (guest_started_drag_.get())
guest_started_drag_->EndSystemDrag();
guest_started_drag_.reset();
guest_dragging_over_.reset();
diff --git a/content/browser/browser_plugin/browser_plugin_embedder.h b/content/browser/browser_plugin/browser_plugin_embedder.h
index a163360..b4bddb8 100644
--- a/content/browser/browser_plugin/browser_plugin_embedder.h
+++ b/content/browser/browser_plugin/browser_plugin_embedder.h
@@ -93,6 +93,8 @@ class CONTENT_EXPORT BrowserPluginEmbedder : public WebContentsObserver {
void StopDrag(BrowserPluginGuest* guest);
+ // Sends EndSystemDrag message to the guest that initiated the last drag/drop
+ // operation, if there's any.
void SystemDragEnded();
private: