| Index: content/renderer/webclipboard_impl.cc
|
| diff --git a/content/renderer/webclipboard_impl.cc b/content/renderer/webclipboard_impl.cc
|
| index 4f6e54fc06d68426c5f4c63ca9e00d6d03636501..5ea174900926eab24e4196e9156953e230908605 100644
|
| --- a/content/renderer/webclipboard_impl.cc
|
| +++ b/content/renderer/webclipboard_impl.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/pickle.h"
|
| #include "base/strings/string_util.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| +#include "content/common/clipboard_message_enums.h"
|
| #include "content/public/common/drop_data.h"
|
| #include "content/renderer/clipboard_utils.h"
|
| #include "content/renderer/drop_data_builder.h"
|
| @@ -57,21 +58,16 @@ bool WebClipboardImpl::isFormatAvailable(Format format, Buffer buffer) {
|
|
|
| switch (format) {
|
| case FormatPlainText:
|
| - return client_->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
|
| - clipboard_type) ||
|
| - client_->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
|
| - clipboard_type);
|
| - case FormatHTML:
|
| - return client_->IsFormatAvailable(ui::Clipboard::GetHtmlFormatType(),
|
| + return client_->IsFormatAvailable(kClipboardFormatPlaintext,
|
| clipboard_type);
|
| + case FormatHTML:
|
| + return client_->IsFormatAvailable(kClipboardFormatHTML, clipboard_type);
|
| case FormatSmartPaste:
|
| - return client_->IsFormatAvailable(
|
| - ui::Clipboard::GetWebKitSmartPasteFormatType(), clipboard_type);
|
| + return client_->IsFormatAvailable(kClipboardFormatSmartPaste,
|
| + clipboard_type);
|
| case FormatBookmark:
|
| -#if defined(OS_WIN) || defined(OS_MACOSX)
|
| - return client_->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(),
|
| + return client_->IsFormatAvailable(kClipboardFormatBookmark,
|
| clipboard_type);
|
| -#endif
|
| default:
|
| NOTREACHED();
|
| }
|
| @@ -94,23 +90,9 @@ WebString WebClipboardImpl::readPlainText(Buffer buffer) {
|
| if (!ConvertBufferType(buffer, &clipboard_type))
|
| return WebString();
|
|
|
| - if (client_->IsFormatAvailable(ui::Clipboard::GetPlainTextWFormatType(),
|
| - clipboard_type)) {
|
| - base::string16 text;
|
| - client_->ReadText(clipboard_type, &text);
|
| - if (!text.empty())
|
| - return text;
|
| - }
|
| -
|
| - if (client_->IsFormatAvailable(ui::Clipboard::GetPlainTextFormatType(),
|
| - clipboard_type)) {
|
| - std::string text;
|
| - client_->ReadAsciiText(clipboard_type, &text);
|
| - if (!text.empty())
|
| - return base::ASCIIToUTF16(text);
|
| - }
|
| -
|
| - return WebString();
|
| + base::string16 text;
|
| + client_->ReadText(clipboard_type, &text);
|
| + return text;
|
| }
|
|
|
| WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url,
|
|
|