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

Unified Diff: ui/base/clipboard/clipboard_aurax11.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.h ('k') | ui/base/clipboard/clipboard_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/clipboard/clipboard_aurax11.cc
diff --git a/ui/base/clipboard/clipboard_aurax11.cc b/ui/base/clipboard/clipboard_aurax11.cc
index b8f66702387c509ba7872fd95c5aef4464db64c7..6d273fad3209f652d3fe9fee37d4bfe125603380 100644
--- a/ui/base/clipboard/clipboard_aurax11.cc
+++ b/ui/base/clipboard/clipboard_aurax11.cc
@@ -894,8 +894,17 @@ void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
iter != objects.end(); ++iter) {
DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
}
-
aurax11_details_->TakeOwnershipOfSelection(buffer);
+
+ if (buffer == BUFFER_STANDARD) {
+ ObjectMap::const_iterator text_iter = objects.find(CBF_TEXT);
+ if (text_iter != objects.end()) {
+ aurax11_details_->CreateNewClipboardData();
+ const ObjectMapParam& char_vector = text_iter->second[0];
+ WriteText(&char_vector.front(), char_vector.size());
+ aurax11_details_->TakeOwnershipOfSelection(BUFFER_SELECTION);
+ }
+ }
}
bool Clipboard::IsFormatAvailable(const FormatType& format,
@@ -1047,17 +1056,6 @@ void Clipboard::ReadData(const FormatType& format, std::string* result) const {
data->AssignTo(result);
}
-// 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());
-
- aurax11_details_->CreateNewClipboardData();
- WriteText(utf8_text.c_str(), utf8_text.size());
- aurax11_details_->TakeOwnershipOfSelection(BUFFER_SELECTION);
-}
-
uint64 Clipboard::GetSequenceNumber(Buffer buffer) {
DCHECK(CalledOnValidThread());
if (buffer == BUFFER_STANDARD)
« no previous file with comments | « ui/base/clipboard/clipboard.h ('k') | ui/base/clipboard/clipboard_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698