Commit e69de2a5 authored by dcheng@chromium.org's avatar dcheng@chromium.org

Remove superfluous call to SetURL in DragDownloadItem.

The download item code tried to be helpful and make sure Blink could
navigate to download items dropped in a web contents by setting a file
URL in the drop data. Unfortunately, this doesn't work because
RenderViewHostImpl::DragTargetDragEnter filters out file URLs and
rewrites it to about:blank, and Blink happily navigates there instead of
the file.

As it turns out, this is unnecessary because Blink already converts the
filename to a URL when it attempts to turn drops into navigations so we
get this behavior for free by omitting the call to SetURL.

It also confuses some Linux file managers, causing them to link to the
file instead of making a copy when the item is dragged from the download
bar.

BUG=356794
TEST=drag download bar items to the desktop (should copy) and to another
     Chrome window (should navigate)

R=thakis@chromium.org

Review URL: https://codereview.chromium.org/217243003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260334 0039d316-1c4b-4281-b951-d872f2087c98
parent e81f5f9d
......@@ -60,10 +60,6 @@ void DragDownloadItem(const content::DownloadItem* download,
ui::FileInfo(full_path, download->GetFileNameToReportUser()));
data.SetFilenames(file_infos);
// Add URL so that we can load supported files when dragged to WebContents.
data.SetURL(net::FilePathToFileURL(full_path),
download->GetFileNameToReportUser().LossyDisplayName());
#if !defined(TOOLKIT_GTK)
#if defined(USE_AURA)
aura::Window* root_window = view->GetRootWindow();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment