summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tab_contents_drag_source.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 18:56:35 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-01 18:56:35 +0000
commit84c88aa65b45234668caa6b4a7205e534a7b8973 (patch)
tree23d54dea38749e169a832a29a52845faf4ecfadc /chrome/browser/gtk/tab_contents_drag_source.cc
parent0f215e0c0e92474342c3003414d1e0f7ee5e8eba (diff)
downloadchromium_src-84c88aa65b45234668caa6b4a7205e534a7b8973.zip
chromium_src-84c88aa65b45234668caa6b4a7205e534a7b8973.tar.gz
chromium_src-84c88aa65b45234668caa6b4a7205e534a7b8973.tar.bz2
GTK: Make the toolbar star button a drag source.
Also refactor URI list/named url packing code. BUG=19008 Review URL: http://codereview.chromium.org/175036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tab_contents_drag_source.cc')
-rw-r--r--chrome/browser/gtk/tab_contents_drag_source.cc21
1 files changed, 3 insertions, 18 deletions
diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc
index b27ef57..780c6ca 100644
--- a/chrome/browser/gtk/tab_contents_drag_source.cc
+++ b/chrome/browser/gtk/tab_contents_drag_source.cc
@@ -129,15 +129,6 @@ void TabContentsDragSource::OnDragDataGet(
break;
}
- case GtkDndUtil::TEXT_URI_LIST: {
- gchar* uri_array[2];
- uri_array[0] = strdup(drop_data_->url.spec().c_str());
- uri_array[1] = NULL;
- gtk_selection_data_set_uris(selection_data, uri_array);
- free(uri_array[0]);
- break;
- }
-
case GtkDndUtil::TEXT_HTML: {
// TODO(estade): change relative links to be absolute using
// |html_base_url|.
@@ -151,16 +142,10 @@ void TabContentsDragSource::OnDragDataGet(
break;
}
+ case GtkDndUtil::TEXT_URI_LIST:
case GtkDndUtil::CHROME_NAMED_URL: {
- Pickle pickle;
- pickle.WriteString(UTF16ToUTF8(drop_data_->url_title));
- pickle.WriteString(drop_data_->url.spec());
- gtk_selection_data_set(
- selection_data,
- GtkDndUtil::GetAtomForTarget(GtkDndUtil::CHROME_NAMED_URL),
- bits_per_byte,
- reinterpret_cast<const guchar*>(pickle.data()),
- pickle.size());
+ GtkDndUtil::WriteURLWithName(selection_data, drop_data_->url,
+ drop_data_->url_title, target_type);
break;
}