Index: content/renderer/webclipboard_impl.cc |
diff --git a/content/renderer/webclipboard_impl.cc b/content/renderer/webclipboard_impl.cc |
index 4f6e54fc06d68426c5f4c63ca9e00d6d03636501..2408eda86dcee3b5a4d2e0501d2922355bd9e667 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_format.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(CLIPBOARD_FORMAT_PLAINTEXT, |
clipboard_type); |
+ case FormatHTML: |
+ return client_->IsFormatAvailable(CLIPBOARD_FORMAT_HTML, clipboard_type); |
case FormatSmartPaste: |
- return client_->IsFormatAvailable( |
- ui::Clipboard::GetWebKitSmartPasteFormatType(), clipboard_type); |
+ return client_->IsFormatAvailable(CLIPBOARD_FORMAT_SMART_PASTE, |
+ clipboard_type); |
case FormatBookmark: |
-#if defined(OS_WIN) || defined(OS_MACOSX) |
- return client_->IsFormatAvailable(ui::Clipboard::GetUrlWFormatType(), |
+ return client_->IsFormatAvailable(CLIPBOARD_FORMAT_BOOKMARK, |
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, |