summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 18:56:54 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-08 18:56:54 +0000
commit60faa5b7ea9112715aaa6e3db1c4b1afa36ac956 (patch)
tree681574e76fe571ea75cac6cdb56395356740d845 /chrome/browser
parent202bd1883fac347987a65fe6cb52ab908fea347e (diff)
downloadchromium_src-60faa5b7ea9112715aaa6e3db1c4b1afa36ac956.zip
chromium_src-60faa5b7ea9112715aaa6e3db1c4b1afa36ac956.tar.gz
chromium_src-60faa5b7ea9112715aaa6e3db1c4b1afa36ac956.tar.bz2
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
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/tabs/tab_strip_gtk.cc10
1 files changed, 7 insertions, 3 deletions
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<GdkDragAction>(
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<char*>(data));
+ std::string url_string(reinterpret_cast<char*>(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);
}