Index: ui/base/clipboard/clipboard_gtk.cc |
diff --git a/ui/base/clipboard/clipboard_gtk.cc b/ui/base/clipboard/clipboard_gtk.cc |
index 40c58ca47321c38969e648a44a30a864fbb84066..022fca49a10caaca7279292d6ce8dd63e26adf7c 100644 |
--- a/ui/base/clipboard/clipboard_gtk.cc |
+++ b/ui/base/clipboard/clipboard_gtk.cc |
@@ -229,15 +229,6 @@ void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) { |
SetGtkClipboard(buffer); |
} |
-// When a URL is copied from a render view context menu (via "copy link |
-// location", for example), we additionally stick it in the X clipboard. This |
-// matches other linux browsers. |
-void Clipboard::DidWriteURL(const std::string& utf8_text) { |
- DCHECK(CalledOnValidThread()); |
- gtk_clipboard_set_text(primary_selection_, utf8_text.c_str(), |
- utf8_text.length()); |
-} |
- |
// Take ownership of the GTK clipboard and inform it of the targets we support. |
void Clipboard::SetGtkClipboard(Buffer buffer) { |
scoped_array<GtkTargetEntry> targets( |
@@ -262,6 +253,14 @@ void Clipboard::SetGtkClipboard(Buffer buffer) { |
clipboard_data_->size()); |
} |
+ if (buffer == BUFFER_STANDARD) { |
+ Clipboard::TargetMap::iterator text_iter = clipboard_data_->find("TEXT"); |
+ if (text_iter != clipboard_data_->end()) { |
+ gtk_clipboard_set_text(primary_selection_, text_iter->second.first, |
+ text_iter->second.second); |
+ } |
+ } |
+ |
// clipboard_data_ now owned by the GtkClipboard. |
clipboard_data_ = NULL; |
} |