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

Unified Diff: ui/base/clipboard/clipboard_gtk.cc

Issue 11792002: Whenever we set plain text on the standard clipboard, also set (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 12 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 | « ui/base/clipboard/clipboard_aurax11.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « ui/base/clipboard/clipboard_aurax11.cc ('k') | ui/base/clipboard/scoped_clipboard_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698