DescriptionFixed drag and drop into and out of Browser Plugin.
Only works when the --enable-browser-plugin-compositing flag is used, which causes web_contents_view_guest to be used.
How the flow works:
When a drag event is initiated on the web page, the BrowserPluginGuest receives an DragHostMsg_StartDragging IPC, and keeps track of that fact that it has initiated a drag event, but doesn't handle the IPC.
The IPC is then passed down the chain (not sure by who) and eventually calls WebContentsViewGuest::StartDragging.
WebContentsViewGuest::StartDragging calls the platform dependent WebContentsView of the embedder and starts the OS drag event.
Now, we get updates on the drag event from 2 places, BrowserPlugin::handleDragStatusUpdate, and RenderViewImpl::OnDragTargetDragOver of the embedder process.
BrowserPlugin::handleDragStatusUpdate goes through the guest to call RenderViewHostImpl::DragTargetDragOver on the guest process (but only when the mouse is hovering over the guest)
RenderViewImpl::OnDragTargetDragOver also calls RenderViewHostImpl::DragTargetDragOver but on the embedder process, and it always calls the function, whether or not the mouse is over the guest. For that reason, we keep track of if the mouse if over the guest, and use the embedder to capture and ignore the DragTargetDragOver message on the embedder process when the mouse is over the guest (or we get a flickering mouse).
Now, when the mouse is released, the native drag_host calls RenderViewImpl::OnDragSourceSystemDragEnded, which in turn calls webview()->dragSourceSystemDragEnded(); on the embedder process. However, the guest process webview() is not informed that the drag has ended, so it still blocks user input. So we send a new IPC, DragHostMsg_DragStopped to the embedder to let it inform the guest, who in turn informs the guest webview, that the drag has ended.
BUG=161112
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=198119
Patch Set 1 #Patch Set 2 : Re-disabled when command line flag not present. #
Total comments: 6
Patch Set 3 : addressed comments #
Total comments: 3
Patch Set 4 : Moved state to embedder. #
Total comments: 6
Patch Set 5 : Addressed comments #
Total comments: 2
Patch Set 6 : Switched flags #Patch Set 7 : Lots of fixes + tests #Patch Set 8 : not finished, just sharing #Patch Set 9 : Test works on linux! #Patch Set 10 : sync + possible fixes for windows #Patch Set 11 : possible windows drag drop fix #Patch Set 12 : disable on non-linux platforms #Patch Set 13 : Fix run loop issues #Patch Set 14 : Fix flakes and compile error. #Patch Set 15 : Drag and drop enabled for linux only #
Total comments: 28
Patch Set 16 : Addressed Comments #
Total comments: 13
Patch Set 17 : Addressed comments #
Total comments: 5
Patch Set 18 : Addressed Comments #Patch Set 19 : Enabled for mac #
Total comments: 2
Patch Set 20 : Fix stale comment #Patch Set 21 : Fix compile error #Patch Set 22 : slow down tests #Patch Set 23 : fix failing chromeOS tests #Patch Set 24 : More fixes #Patch Set 25 : revert changes that break windows tests #Patch Set 26 : Merged with TOT #Patch Set 27 : Merged with ToT #Patch Set 28 : Fixed following NULL pointer #Patch Set 29 : Fixed following NULL Pointer + spacing #Patch Set 30 : Merge with ToT #Patch Set 31 : Splitting up patch #Messages
Total messages: 56 (0 generated)
|