summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 19:45:58 +0000
committerjianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-13 19:45:58 +0000
commitaf530ac147feb1b04446f529daa4cc4448f89b23 (patch)
treeb7fcfa8805447698da3080d21696a4b3174e556e /chrome/browser
parent6d201be0c55eccdc015124e221d2559a6da7fef0 (diff)
downloadchromium_src-af530ac147feb1b04446f529daa4cc4448f89b23.zip
chromium_src-af530ac147feb1b04446f529daa4cc4448f89b23.tar.gz
chromium_src-af530ac147feb1b04446f529daa4cc4448f89b23.tar.bz2
Fix the problem that file URL is not converted to file path in drag-and-drop on Linux.
BUG=none TEST=none Review URL: http://codereview.chromium.org/385100 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/tab_contents/web_drag_dest_gtk.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.cc b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
index b33bbff..279e47d 100644
--- a/chrome/browser/tab_contents/web_drag_dest_gtk.cc
+++ b/chrome/browser/tab_contents/web_drag_dest_gtk.cc
@@ -5,9 +5,11 @@
#include "chrome/browser/tab_contents/web_drag_dest_gtk.h"
#include "app/gtk_dnd_util.h"
+#include "base/file_path.h"
#include "base/string_util.h"
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/common/gtk_util.h"
+#include "net/base/net_util.h"
using WebKit::WebDragOperation;
using WebKit::WebDragOperationCopy;
@@ -120,7 +122,9 @@ void WebDragDestGtk::OnDragDataReceived(
if (uris) {
for (gchar** uri_iter = uris; *uri_iter; uri_iter++) {
// TODO(estade): Can the filenames have a non-UTF8 encoding?
- drop_data_->filenames.push_back(UTF8ToUTF16(*uri_iter));
+ FilePath file_path;
+ if (net::FileURLToFilePath(GURL(*uri_iter), &file_path))
+ drop_data_->filenames.push_back(UTF8ToUTF16(file_path.value()));
}
// Also, write the first URI as the URL.
if (uris[0])