Chromium Code Reviews| Index: app/gtk_dnd_util.cc |
| diff --git a/app/gtk_dnd_util.cc b/app/gtk_dnd_util.cc |
| index 8b5f01ac84643de0157bb6fc064142750b5e1a0a..b7e0b2781df1447642b5c00deac6b49b863cb880 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()) { |
| + // Can't have an empty title. Set it to the filename extracted from the |
|
Evan Stade
2010/11/30 21:28:21
nit: "Can't"? Isn't it more like "Prefer to avoid"
|
| + // URL. |
| + title = UTF8ToUTF16(url.ExtractFileName()); |
|
sky
2010/11/30 22:14:08
Might the filename be empty too?
Elliot Glaysher
2010/11/30 22:18:20
I'm not really concerned about that. In that case,
|
| + } |
| + |
| switch (type) { |
| case TEXT_PLAIN: { |
| gtk_selection_data_set_text(selection_data, url.spec().c_str(), |