Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1731)

Unified Diff: app/gtk_dnd_util.cc

Issue 5307005: GTK: Drags of images should have titles instead of "". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 10 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/gtk_dnd_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(),
« no previous file with comments | « app/gtk_dnd_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698