summaryrefslogtreecommitdiffstats
path: root/app/gtk_dnd_util.cc
diff options
context:
space:
mode:
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(),