Index: chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc |
=================================================================== |
--- chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc (revision 105460) |
+++ chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.cc (working copy) |
@@ -33,6 +33,7 @@ |
#include "third_party/undoview/undo_view.h" |
#include "ui/base/animation/multi_animation.h" |
#include "ui/base/dragdrop/drag_drop_types.h" |
+#include "ui/base/dragdrop/gtk_dnd_util.h" |
#include "ui/base/gtk/gtk_hig_constants.h" |
#include "ui/base/l10n/l10n_util.h" |
#include "ui/base/resource/resource_bundle.h" |
@@ -244,6 +245,8 @@ |
tag_table_ = gtk_text_tag_table_new(); |
text_buffer_ = gtk_text_buffer_new(tag_table_); |
g_object_set_data(G_OBJECT(text_buffer_), kOmniboxViewGtkKey, this); |
+ GtkTargetList* targets = gtk_text_buffer_get_copy_target_list(text_buffer_); |
+ gtk_target_list_add_uri_targets(targets, ui::TEXT_URI_LIST); |
Evan Stade
2011/10/17 21:55:59
this isn't right, if I select just a small part of
SanjoyPal
2011/10/18 08:15:30
Yes, then it will be treated as TEXT_PLAIN.
"Basi
Evan Stade
2011/10/18 16:27:31
we don't display the scheme in the http:// case. H
|
// We need to run this two handlers before undo manager's handlers, so that |
// text iterators modified by these handlers can be passed down to undo |
@@ -1610,7 +1613,13 @@ |
switch (target_type) { |
case GTK_TEXT_BUFFER_TARGET_INFO_TEXT: { |
gtk_selection_data_set_text(selection_data, dragged_text_.c_str(), -1); |
+ break; |
} |
+ case ui::TEXT_URI_LIST: { |
+ ui::WriteURLWithName(selection_data, GURL(dragged_text_), |
+ UTF8ToUTF16(dragged_text_), target_type); |
Evan Stade
2011/10/17 21:55:59
the name should be the tab title
SanjoyPal
2011/10/18 08:15:30
The title is not being used in TEXT_URI_LIST case
Evan Stade
2011/10/18 16:27:31
well, don't use TEXT_URI_LIST then
|
+ break; |
+ } |
} |
} |