| 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 <list> | 7 #include <list> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 536 |
| 537 AuraClipboard* clipboard = GetClipboard(); | 537 AuraClipboard* clipboard = GetClipboard(); |
| 538 if (clipboard->IsFormatAvailable(CUSTOM) && clipboard->GetData()) { | 538 if (clipboard->IsFormatAvailable(CUSTOM) && clipboard->GetData()) { |
| 539 ui::ReadCustomDataTypes(clipboard->GetData()->custom_data_data().c_str(), | 539 ui::ReadCustomDataTypes(clipboard->GetData()->custom_data_data().c_str(), |
| 540 clipboard->GetData()->custom_data_data().size(), types); | 540 clipboard->GetData()->custom_data_data().size(), types); |
| 541 } | 541 } |
| 542 } | 542 } |
| 543 | 543 |
| 544 void Clipboard::ReadText(Buffer buffer, string16* result) const { | 544 void Clipboard::ReadText(Buffer buffer, string16* result) const { |
| 545 DCHECK(CalledOnValidThread()); | 545 DCHECK(CalledOnValidThread()); |
| 546 ReportAction(buffer, READ_TEXT); |
| 546 GetClipboard()->ReadText(result); | 547 GetClipboard()->ReadText(result); |
| 547 } | 548 } |
| 548 | 549 |
| 549 void Clipboard::ReadAsciiText(Buffer buffer, std::string* result) const { | 550 void Clipboard::ReadAsciiText(Buffer buffer, std::string* result) const { |
| 550 DCHECK(CalledOnValidThread()); | 551 DCHECK(CalledOnValidThread()); |
| 552 ReportAction(buffer, READ_ASCII_TEXT); |
| 551 GetClipboard()->ReadAsciiText(result); | 553 GetClipboard()->ReadAsciiText(result); |
| 552 } | 554 } |
| 553 | 555 |
| 554 void Clipboard::ReadHTML(Buffer buffer, | 556 void Clipboard::ReadHTML(Buffer buffer, |
| 555 string16* markup, | 557 string16* markup, |
| 556 std::string* src_url, | 558 std::string* src_url, |
| 557 uint32* fragment_start, | 559 uint32* fragment_start, |
| 558 uint32* fragment_end) const { | 560 uint32* fragment_end) const { |
| 559 DCHECK(CalledOnValidThread()); | 561 DCHECK(CalledOnValidThread()); |
| 560 GetClipboard()->ReadHTML(markup, src_url, fragment_start, fragment_end); | 562 GetClipboard()->ReadHTML(markup, src_url, fragment_start, fragment_end); |
| 561 } | 563 } |
| 562 | 564 |
| 563 void Clipboard::ReadRTF(Buffer buffer, std::string* result) const { | 565 void Clipboard::ReadRTF(Buffer buffer, std::string* result) const { |
| 564 DCHECK(CalledOnValidThread()); | 566 DCHECK(CalledOnValidThread()); |
| 567 ReportAction(buffer, READ_RTF); |
| 565 GetClipboard()->ReadRTF(result); | 568 GetClipboard()->ReadRTF(result); |
| 566 } | 569 } |
| 567 | 570 |
| 568 SkBitmap Clipboard::ReadImage(Buffer buffer) const { | 571 SkBitmap Clipboard::ReadImage(Buffer buffer) const { |
| 569 DCHECK(CalledOnValidThread()); | 572 DCHECK(CalledOnValidThread()); |
| 570 return GetClipboard()->ReadImage(); | 573 return GetClipboard()->ReadImage(); |
| 571 } | 574 } |
| 572 | 575 |
| 573 void Clipboard::ReadCustomData(Buffer buffer, | 576 void Clipboard::ReadCustomData(Buffer buffer, |
| 574 const string16& type, | 577 const string16& type, |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 return type; | 711 return type; |
| 709 } | 712 } |
| 710 | 713 |
| 711 // static | 714 // static |
| 712 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { | 715 const Clipboard::FormatType& Clipboard::GetPepperCustomDataFormatType() { |
| 713 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); | 716 CR_DEFINE_STATIC_LOCAL(FormatType, type, (kMimeTypePepperCustomData)); |
| 714 return type; | 717 return type; |
| 715 } | 718 } |
| 716 | 719 |
| 717 } // namespace ui | 720 } // namespace ui |
| OLD | NEW |