| Index: webkit/glue/chromium_bridge_impl.cc
|
| ===================================================================
|
| --- webkit/glue/chromium_bridge_impl.cc (revision 10343)
|
| +++ webkit/glue/chromium_bridge_impl.cc (working copy)
|
| @@ -6,7 +6,6 @@
|
| #include "ChromiumBridge.h"
|
|
|
| #include "BitmapImage.h"
|
| -#include "ClipboardUtilitiesChromium.h"
|
| #include "Cursor.h"
|
| #include "Frame.h"
|
| #include "FrameView.h"
|
| @@ -27,7 +26,6 @@
|
| #include <wtf/CurrentTime.h>
|
|
|
| #undef LOG
|
| -#include "base/clipboard.h"
|
| #include "base/file_util.h"
|
| #include "base/message_loop.h"
|
| #include "base/stats_counters.h"
|
| @@ -45,7 +43,6 @@
|
| #include "webkit/glue/chrome_client_impl.h"
|
| #include "webkit/glue/glue_util.h"
|
| #include "webkit/glue/plugins/plugin_instance.h"
|
| -#include "webkit/glue/scoped_clipboard_writer_glue.h"
|
| #include "webkit/glue/webcursor.h"
|
| #include "webkit/glue/webkit_glue.h"
|
| #include "webkit/glue/webplugin_impl.h"
|
| @@ -93,122 +90,10 @@
|
| return static_cast<ChromeClientImpl*>(page->chrome()->client());
|
| }
|
|
|
| -std::wstring UrlToImageMarkup(const WebCore::KURL& url,
|
| - const WebCore::String& alt_str) {
|
| - std::wstring markup(L"<img src=\"");
|
| - markup.append(webkit_glue::StringToStdWString(url.string()));
|
| - markup.append(L"\"");
|
| - if (!alt_str.isEmpty()) {
|
| - markup.append(L" alt=\"");
|
| - std::wstring alt_stdstr = webkit_glue::StringToStdWString(alt_str);
|
| - ReplaceSubstringsAfterOffset(&alt_stdstr, 0, L"\"", L""");
|
| - markup.append(alt_stdstr);
|
| - markup.append(L"\"");
|
| - }
|
| - markup.append(L"/>");
|
| - return markup;
|
| -}
|
| -
|
| } // namespace
|
|
|
| namespace WebCore {
|
|
|
| -bool ChromiumBridge::clipboardIsFormatAvailable(
|
| - PasteboardPrivate::ClipboardFormat format) {
|
| - switch (format) {
|
| - case PasteboardPrivate::HTMLFormat:
|
| - return webkit_glue::ClipboardIsFormatAvailable(
|
| - ::Clipboard::GetHtmlFormatType());
|
| -
|
| - case PasteboardPrivate::WebSmartPasteFormat:
|
| - return webkit_glue::ClipboardIsFormatAvailable(
|
| - ::Clipboard::GetWebKitSmartPasteFormatType());
|
| -
|
| - case PasteboardPrivate::BookmarkFormat:
|
| -#if defined(OS_WIN) || defined(OS_MACOSX)
|
| - return webkit_glue::ClipboardIsFormatAvailable(
|
| - ::Clipboard::GetUrlWFormatType());
|
| -#endif
|
| -
|
| - default:
|
| - NOTREACHED();
|
| - return false;
|
| - }
|
| -}
|
| -
|
| -String ChromiumBridge::clipboardReadPlainText() {
|
| - if (webkit_glue::ClipboardIsFormatAvailable(
|
| - ::Clipboard::GetPlainTextWFormatType())) {
|
| - std::wstring text;
|
| - webkit_glue::ClipboardReadText(&text);
|
| - if (!text.empty())
|
| - return webkit_glue::StdWStringToString(text);
|
| - }
|
| -
|
| - if (webkit_glue::ClipboardIsFormatAvailable(
|
| - ::Clipboard::GetPlainTextFormatType())) {
|
| - std::string text;
|
| - webkit_glue::ClipboardReadAsciiText(&text);
|
| - if (!text.empty())
|
| - return webkit_glue::StdStringToString(text);
|
| - }
|
| -
|
| - return String();
|
| -}
|
| -
|
| -void ChromiumBridge::clipboardReadHTML(String* html, KURL* url) {
|
| - std::wstring html_stdstr;
|
| - GURL gurl;
|
| - webkit_glue::ClipboardReadHTML(&html_stdstr, &gurl);
|
| - *html = webkit_glue::StdWStringToString(html_stdstr);
|
| - *url = webkit_glue::GURLToKURL(gurl);
|
| -}
|
| -
|
| -void ChromiumBridge::clipboardWriteSelection(const String& html,
|
| - const KURL& url,
|
| - const String& plain_text,
|
| - bool can_smart_copy_or_delete) {
|
| - ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
|
| - scw.WriteHTML(webkit_glue::StringToStdWString(html),
|
| -#if USE(GOOGLEURL)
|
| - webkit_glue::CStringToStdString(url.utf8String()));
|
| -#else
|
| - webkit_glue::StringToStdString(url.string()));
|
| -#endif
|
| - scw.WriteText(webkit_glue::StringToStdWString(plain_text));
|
| -
|
| - if (can_smart_copy_or_delete)
|
| - scw.WriteWebSmartPaste();
|
| -}
|
| -
|
| -void ChromiumBridge::clipboardWriteURL(const KURL& url, const String& title) {
|
| - ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
|
| -
|
| - GURL gurl = webkit_glue::KURLToGURL(url);
|
| - scw.WriteBookmark(webkit_glue::StringToStdWString(title), gurl.spec());
|
| -
|
| - std::wstring link(webkit_glue::StringToStdWString(urlToMarkup(url, title)));
|
| - scw.WriteHTML(link, "");
|
| -
|
| - scw.WriteText(ASCIIToWide(gurl.spec()));
|
| -}
|
| -
|
| -void ChromiumBridge::clipboardWriteImage(const NativeImageSkia* bitmap,
|
| - const KURL& url, const String& title) {
|
| - ScopedClipboardWriterGlue scw(webkit_glue::ClipboardGetClipboard());
|
| -
|
| -#if defined(OS_WIN)
|
| - if (bitmap)
|
| - scw.WriteBitmap(*bitmap);
|
| -#endif
|
| - if (!url.isEmpty()) {
|
| - GURL gurl = webkit_glue::KURLToGURL(url);
|
| - scw.WriteBookmark(webkit_glue::StringToStdWString(title), gurl.spec());
|
| - scw.WriteHTML(UrlToImageMarkup(url, title), "");
|
| - scw.WriteText(ASCIIToWide(gurl.spec()));
|
| - }
|
| -}
|
| -
|
| // Cookies --------------------------------------------------------------------
|
|
|
| void ChromiumBridge::setCookies(
|
|
|