Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2344)

Unified Diff: chrome/browser/gtk/tab_contents_drag_source.cc

Issue 548067: Allow link drags from the star, bookmarks bar, and bookmark bar menus (Closed)
Patch Set: Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/gtk/bookmark_utils_gtk.cc ('k') | chrome/browser/gtk/toolbar_star_toggle_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tab_contents_drag_source.cc
diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc
index b9883cc662348d02e4e6726453b493095ccf3e92..39f7bdab217ca51b8055998099c7eededbf82f33 100644
--- a/chrome/browser/gtk/tab_contents_drag_source.cc
+++ b/chrome/browser/gtk/tab_contents_drag_source.cc
@@ -127,7 +127,7 @@ void TabContentsDragSource::DidProcessEvent(GdkEvent* event) {
void TabContentsDragSource::OnDragDataGet(
GdkDragContext* context, GtkSelectionData* selection_data,
guint target_type, guint time) {
- const int bits_per_byte = 8;
+ const int kBitsPerByte = 8;
switch (target_type) {
case GtkDndUtil::TEXT_PLAIN: {
@@ -144,35 +144,24 @@ void TabContentsDragSource::OnDragDataGet(
gtk_selection_data_set(selection_data,
GtkDndUtil::GetAtomForTarget(
GtkDndUtil::TEXT_HTML),
- bits_per_byte,
+ kBitsPerByte,
reinterpret_cast<const guchar*>(utf8_text.c_str()),
utf8_text.length());
break;
}
case GtkDndUtil::TEXT_URI_LIST:
- case GtkDndUtil::CHROME_NAMED_URL: {
+ case GtkDndUtil::CHROME_NAMED_URL:
+ case GtkDndUtil::NETSCAPE_URL: {
GtkDndUtil::WriteURLWithName(selection_data, drop_data_->url,
drop_data_->url_title, target_type);
break;
}
- case GtkDndUtil::NETSCAPE_URL: {
- // _NETSCAPE_URL format is URL + \n + title.
- std::string utf8_text = drop_data_->url.spec() + "\n" + UTF16ToUTF8(
- drop_data_->url_title);
- gtk_selection_data_set(selection_data,
- selection_data->target,
- bits_per_byte,
- reinterpret_cast<const guchar*>(utf8_text.c_str()),
- utf8_text.length());
- break;
- }
-
case GtkDndUtil::CHROME_WEBDROP_FILE_CONTENTS: {
gtk_selection_data_set(
selection_data,
- drag_file_mime_type_, bits_per_byte,
+ drag_file_mime_type_, kBitsPerByte,
reinterpret_cast<const guchar*>(drop_data_->file_contents.data()),
drop_data_->file_contents.length());
break;
« no previous file with comments | « chrome/browser/gtk/bookmark_utils_gtk.cc ('k') | chrome/browser/gtk/toolbar_star_toggle_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698