From 60faa5b7ea9112715aaa6e3db1c4b1afa36ac956 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Mon, 8 Feb 2010 18:56:54 +0000 Subject: accept NETSCAPE_URL drags in gtk tabstrip BUG=34141 TEST=see bug Review URL: http://codereview.chromium.org/570044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38372 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/tabs/tab_strip_gtk.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'chrome/browser') diff --git a/chrome/browser/gtk/tabs/tab_strip_gtk.cc b/chrome/browser/gtk/tabs/tab_strip_gtk.cc index 1ac295ce..8302119 100644 --- a/chrome/browser/gtk/tabs/tab_strip_gtk.cc +++ b/chrome/browser/gtk/tabs/tab_strip_gtk.cc @@ -557,7 +557,9 @@ void TabStripGtk::Init() { NULL, 0, static_cast( GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_LINK)); - static const int targets[] = { GtkDndUtil::TEXT_URI_LIST, -1 }; + static const int targets[] = { GtkDndUtil::TEXT_URI_LIST, + GtkDndUtil::NETSCAPE_URL, + -1 }; GtkDndUtil::SetDestTargetList(tabstrip_.get(), targets); g_signal_connect(G_OBJECT(tabstrip_.get()), "expose-event", @@ -1400,7 +1402,8 @@ bool TabStripGtk::CompleteDrop(guchar* data) { // Destroy the drop indicator. drop_info_.reset(); - GURL url(reinterpret_cast(data)); + std::string url_string(reinterpret_cast(data)); + GURL url(url_string.substr(0, url_string.find_first_of('\n'))); if (!url.is_valid()) return false; @@ -1742,7 +1745,8 @@ gboolean TabStripGtk::OnDragDataReceived(GtkWidget* widget, TabStripGtk* tabstrip) { bool success = false; - if (info == GtkDndUtil::TEXT_URI_LIST) { + if (info == GtkDndUtil::TEXT_URI_LIST || + info == GtkDndUtil::NETSCAPE_URL) { success = tabstrip->CompleteDrop(data->data); } -- cgit v1.1