diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 22:55:09 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-18 22:55:09 +0000 |
commit | cc099a3a5e644bfff00db13b9a97b43267118080 (patch) | |
tree | a0acac0bff6b206bab061fd6480cf9b11ebca4df /chrome/browser/ui/gtk/tab_contents_drag_source.cc | |
parent | 58753dcfeb72a64d32443217e6afc7fa73d2e34b (diff) | |
download | chromium_src-cc099a3a5e644bfff00db13b9a97b43267118080.zip chromium_src-cc099a3a5e644bfff00db13b9a97b43267118080.tar.gz chromium_src-cc099a3a5e644bfff00db13b9a97b43267118080.tar.bz2 |
Fix bug 79905: Drag and drop of "DownloadURL" type ignores specified filename for data URLs.
BUG=79905
TEST=Manual test and unittest added for net::GetSuggestedFilename
Review URL: http://codereview.chromium.org/7005011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/gtk/tab_contents_drag_source.cc')
-rw-r--r-- | chrome/browser/ui/gtk/tab_contents_drag_source.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chrome/browser/ui/gtk/tab_contents_drag_source.cc b/chrome/browser/ui/gtk/tab_contents_drag_source.cc index 4ae83bb..1da585e 100644 --- a/chrome/browser/ui/gtk/tab_contents_drag_source.cc +++ b/chrome/browser/ui/gtk/tab_contents_drag_source.cc @@ -291,15 +291,12 @@ void TabContentsDragSource::OnDragBegin(GtkWidget* sender, GdkDragContext* drag_context) { if (!download_url_.is_empty()) { // Generate the file name based on both mime type and proposed file name. - std::string download_mime_type = UTF16ToUTF8(wide_download_mime_type_); - std::string content_disposition("attachment; filename="); - content_disposition += download_file_name_.value(); FilePath generated_download_file_name; - download_util::GenerateFileName(download_url_, - content_disposition, - std::string(), - download_mime_type, - &generated_download_file_name); + download_util::GenerateFileNameFromSuggestedName( + download_url_, + download_file_name_.value(), + UTF16ToUTF8(wide_download_mime_type_), + &generated_download_file_name); // Pass the file name to the drop target by setting the source window's // XdndDirectSave0 property. |