From d4e04a67c7f529bc8137c2dc5618e5a8c2123a13 Mon Sep 17 00:00:00 2001 From: "erg@google.com" Date: Tue, 30 Nov 2010 21:33:38 +0000 Subject: 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 --- app/gtk_dnd_util.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/gtk_dnd_util.cc') 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(), -- cgit v1.1