Drag and Drop: Don't extract virtual files if url data present
Fix for: Issue 963392: Regression:'Drop and Install' Message is seen when a bookmarked item is dragged in chrome://extension page. On initiating a bookmark drag, the UniformResourceLocatorW clipboard format is added to the data object, as well as a "virtual" .url file using CFSTR_FILEDESCRIPTORW/CFSTR_FILECONTENTS formats, which represents an internet shortcut intended to be dropped on the desktop. Before my introduction of virtual file support: https://chromium.googlesource.com/chromium/src/+/e524176b0fb387f1c3e509364cde09af045b8a91 a Chromium drop target ignored the virtual file content, but now it is recognized on drag enter and drop. The chrome:://extensions page "sees" the presence of file data and assumes the intent is to install an extension and thus displays the Drop to Install feedback--you see the same thing without my fix when dragging an arbitrary file in from the desktop into the extensions page. The least risky fix is to ignore virtual files if there is also url data present. Note you can't just check if the "chromium/x-bookmark-entries" custom format is present, since this bug also repros dragging the favicon or site info icon out of the address bar, and in that scenario "chromium/x-bookmark-entries" is not added. In my experimentation dragging items out of Outlook.exe, no url data is added to the data object, so this fix won't break the primary scenario addressed by my original change. Bug: 963392 Change-Id: I902cecedca49e1fc6f39cbf9a62de8895dfd0d10 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615962 Commit-Queue: Bruce Long <brlong@microsoft.com> Reviewed-by:Darwin Huang <huangdarwin@chromium.org> Reviewed-by:
Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#661006}
Showing
Please register or sign in to comment