| Index: ui/base/clipboard/clipboard_win.cc
|
| diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
|
| index e36ea049ec14cff8a85f4cf11584831ecdf4b3c2..ce1bf0f03d990114fc6e964442857cbb9792705b 100644
|
| --- a/ui/base/clipboard/clipboard_win.cc
|
| +++ b/ui/base/clipboard/clipboard_win.cc
|
| @@ -208,7 +208,9 @@ Clipboard::~Clipboard() {
|
| clipboard_owner_ = NULL;
|
| }
|
|
|
| -void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
|
| +void Clipboard::WriteObjectsImpl(Buffer buffer,
|
| + const ObjectMap& objects,
|
| + SourceTag tag) {
|
| DCHECK_EQ(buffer, BUFFER_STANDARD);
|
|
|
| ScopedClipboard clipboard;
|
| @@ -221,6 +223,7 @@ void Clipboard::WriteObjects(Buffer buffer, const ObjectMap& objects) {
|
| iter != objects.end(); ++iter) {
|
| DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
|
| }
|
| + WriteSourceTag(tag);
|
| }
|
|
|
| void Clipboard::WriteText(const char* text_data, size_t text_len) {
|
| @@ -361,6 +364,13 @@ void Clipboard::WriteData(const FormatType& format,
|
| WriteToClipboard(format.ToUINT(), hdata);
|
| }
|
|
|
| +void Clipboard::WriteSourceTag(SourceTag tag) {
|
| + if (tag != SourceTag()) {
|
| + ObjectMapParam binary = SourceTag2Binary(tag);
|
| + WriteData(GetSourceTagFormatType(), &binary[0], binary.size());
|
| + }
|
| +}
|
| +
|
| void Clipboard::WriteToClipboard(unsigned int format, HANDLE handle) {
|
| DCHECK(clipboard_owner_);
|
| if (handle && !::SetClipboardData(format, handle)) {
|
| @@ -656,6 +666,13 @@ void Clipboard::ReadData(const FormatType& format, std::string* result) const {
|
| ::GlobalUnlock(data);
|
| }
|
|
|
| +Clipboard::SourceTag Clipboard::ReadSourceTag(Buffer buffer) const {
|
| + DCHECK_EQ(buffer, BUFFER_STANDARD);
|
| + std::string result;
|
| + ReadData(GetSourceTagFormatType(), &result);
|
| + return Binary2SourceTag(result);
|
| +}
|
| +
|
| // static
|
| void Clipboard::ParseBookmarkClipboardFormat(const string16& bookmark,
|
| string16* title,
|
| @@ -835,6 +852,15 @@ const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() {
|
| }
|
|
|
| // static
|
| +const Clipboard::FormatType& Clipboard::GetSourceTagFormatType() {
|
| + CR_DEFINE_STATIC_LOCAL(
|
| + FormatType,
|
| + type,
|
| + (ClipboardUtil::GetSourceTagFormat()->cfFormat));
|
| + return type;
|
| +}
|
| +
|
| +// static
|
| void Clipboard::FreeData(unsigned int format, HANDLE data) {
|
| if (format == CF_BITMAP)
|
| ::DeleteObject(static_cast<HBITMAP>(data));
|
|
|