summaryrefslogtreecommitdiffstats
path: root/app/gtk_dnd_util.cc
diff options
context:
space:
mode:
authorerg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 21:33:38 +0000
committererg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 21:33:38 +0000
commitd4e04a67c7f529bc8137c2dc5618e5a8c2123a13 (patch)
tree25b207dee402bd17b762d89b9099ea4e8f42c5e5 /app/gtk_dnd_util.cc
parent4ebfd7e84148921f4975a3e19965297b18fc11a2 (diff)
downloadchromium_src-d4e04a67c7f529bc8137c2dc5618e5a8c2123a13.zip
chromium_src-d4e04a67c7f529bc8137c2dc5618e5a8c2123a13.tar.gz
chromium_src-d4e04a67c7f529bc8137c2dc5618e5a8c2123a13.tar.bz2
GTK: Drags of images should have titles instead of "".
BUG=32132 TEST=Drag an image from the content area to the bookmark bar. It should have a title. Review URL: http://codereview.chromium.org/5307005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67761 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app/gtk_dnd_util.cc')
-rw-r--r--app/gtk_dnd_util.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc
index 8b5f01a..92797a6 100644
--- a/app/gtk_dnd_util.cc
+++ b/app/gtk_dnd_util.cc
@@ -146,8 +146,14 @@ void SetDestTargetList(GtkWidget* dest, const int* target_codes) {
void WriteURLWithName(GtkSelectionData* selection_data,
const GURL& url,
- const string16& title,
+ string16 title,
int type) {
+ if (title.empty()) {
+ // We prefer to not have empty titles. Set it to the filename extracted
+ // from the URL.
+ title = UTF8ToUTF16(url.ExtractFileName());
+ }
+
switch (type) {
case TEXT_PLAIN: {
gtk_selection_data_set_text(selection_data, url.spec().c_str(),