diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 22:02:35 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-16 22:02:35 +0000 |
commit | 96014816e11833ec2d8551dabb5ff1d2bf57f710 (patch) | |
tree | 483ad43e479226ab8a9de7c1c34d1632a625bec0 /chrome/browser | |
parent | a2044c5224c183c13c66205e958c1ef56a45beba (diff) | |
download | chromium_src-96014816e11833ec2d8551dabb5ff1d2bf57f710.zip chromium_src-96014816e11833ec2d8551dabb5ff1d2bf57f710.tar.gz chromium_src-96014816e11833ec2d8551dabb5ff1d2bf57f710.tar.bz2 |
Add a couple more drop targets to the render view.
BUG=35063
TEST=see bug
Review URL: http://codereview.chromium.org/1030001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/tab_contents/web_drag_dest_gtk.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/web_drag_dest_gtk.cc b/chrome/browser/tab_contents/web_drag_dest_gtk.cc index 1515341..2bb5fa3 100644 --- a/chrome/browser/tab_contents/web_drag_dest_gtk.cc +++ b/chrome/browser/tab_contents/web_drag_dest_gtk.cc @@ -75,6 +75,8 @@ gboolean WebDragDestGtk::OnDragMotion(GtkWidget* sender, gtk_dnd_util::TEXT_PLAIN, gtk_dnd_util::TEXT_URI_LIST, gtk_dnd_util::TEXT_HTML, + gtk_dnd_util::NETSCAPE_URL, + gtk_dnd_util::CHROME_NAMED_URL, // TODO(estade): support image drags? }; @@ -144,6 +146,20 @@ void WebDragDestGtk::OnDragDataReceived( UTF8ToUTF16(std::string(reinterpret_cast<char*>(data->data), data->length)); // We leave the base URL empty. + } else if (data->target == + gtk_dnd_util::GetAtomForTarget(gtk_dnd_util::NETSCAPE_URL)) { + std::string netscape_url(reinterpret_cast<char*>(data->data), + data->length); + size_t split = netscape_url.find_first_of('\n'); + if (split != std::string::npos) { + drop_data_->url_title = UTF8ToUTF16(netscape_url.substr(0, split)); + if (split < netscape_url.size() - 1) + drop_data_->url = GURL(netscape_url.substr(split + 1)); + } + } else if (data->target == + gtk_dnd_util::GetAtomForTarget(gtk_dnd_util::CHROME_NAMED_URL)) { + gtk_dnd_util::ExtractNamedURL(data, + &drop_data_->url, &drop_data_->url_title); } } |