| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/base/clipboard/clipboard.h" | 5 #include "ui/base/clipboard/clipboard.h" |
| 6 | 6 |
| 7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
| 8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const { | 247 void Clipboard::ReadText(Clipboard::Buffer buffer, string16* result) const { |
| 248 DCHECK_EQ(buffer, BUFFER_STANDARD); | 248 DCHECK_EQ(buffer, BUFFER_STANDARD); |
| 249 std::string utf8; | 249 std::string utf8; |
| 250 ReadAsciiText(buffer, &utf8); | 250 ReadAsciiText(buffer, &utf8); |
| 251 *result = UTF8ToUTF16(utf8); | 251 *result = UTF8ToUTF16(utf8); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void Clipboard::ReadAsciiText(Clipboard::Buffer buffer, | 254 void Clipboard::ReadAsciiText(Clipboard::Buffer buffer, |
| 255 std::string* result) const { | 255 std::string* result) const { |
| 256 DCHECK_EQ(buffer, BUFFER_STANDARD); | 256 DCHECK_EQ(buffer, BUFFER_STANDARD); |
| 257 ReportAction(buffer, READ_TEXT); |
| 257 *result = g_map.Get().Get(kPlainTextFormat); | 258 *result = g_map.Get().Get(kPlainTextFormat); |
| 258 } | 259 } |
| 259 | 260 |
| 260 // Note: |src_url| isn't really used. It is only implemented in Windows | 261 // Note: |src_url| isn't really used. It is only implemented in Windows |
| 261 void Clipboard::ReadHTML(Clipboard::Buffer buffer, | 262 void Clipboard::ReadHTML(Clipboard::Buffer buffer, |
| 262 string16* markup, | 263 string16* markup, |
| 263 std::string* src_url, | 264 std::string* src_url, |
| 264 uint32* fragment_start, | 265 uint32* fragment_start, |
| 265 uint32* fragment_end) const { | 266 uint32* fragment_end) const { |
| 266 DCHECK_EQ(buffer, BUFFER_STANDARD); | 267 DCHECK_EQ(buffer, BUFFER_STANDARD); |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 } | 429 } |
| 429 | 430 |
| 430 void Clipboard::WriteSourceTag(SourceTag tag) { | 431 void Clipboard::WriteSourceTag(SourceTag tag) { |
| 431 if (tag != SourceTag()) { | 432 if (tag != SourceTag()) { |
| 432 ObjectMapParam binary = SourceTag2Binary(tag); | 433 ObjectMapParam binary = SourceTag2Binary(tag); |
| 433 WriteData(GetSourceTagFormatType(), &binary[0], binary.size()); | 434 WriteData(GetSourceTagFormatType(), &binary[0], binary.size()); |
| 434 } | 435 } |
| 435 } | 436 } |
| 436 | 437 |
| 437 } // namespace ui | 438 } // namespace ui |
| OLD | NEW |