From 3d4a691b9495479f49eaac0b2ff9411e34208b3a Mon Sep 17 00:00:00 2001 From: "dcheng@chromium.org" Date: Tue, 15 Mar 2011 20:56:19 +0000 Subject: Add stubs and glue for routing a request for an image from the clipboard. BUG=75237 TEST=none Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=78134 Review URL: http://codereview.chromium.org/6625075 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78283 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/glue/webclipboard_impl.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'webkit/glue/webclipboard_impl.cc') diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc index b917677..9eddb68 100644 --- a/webkit/glue/webclipboard_impl.cc +++ b/webkit/glue/webclipboard_impl.cc @@ -10,6 +10,7 @@ #include "googleurl/src/gurl.h" #include "net/base/escape.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebData.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebImage.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" @@ -24,6 +25,7 @@ #endif using WebKit::WebClipboard; +using WebKit::WebData; using WebKit::WebImage; using WebKit::WebString; using WebKit::WebURL; @@ -124,6 +126,16 @@ WebString WebClipboardImpl::readHTML(Buffer buffer, WebURL* source_url) { return html_stdstr; } +WebData WebClipboardImpl::readImage(Buffer buffer) { + ui::Clipboard::Buffer buffer_type; + if (!ConvertBufferType(buffer, &buffer_type)) + return WebData(); + + std::string png_data; + ClipboardReadImage(buffer_type, &png_data); + return WebData(png_data); +} + void WebClipboardImpl::writeHTML( const WebString& html_text, const WebURL& source_url, const WebString& plain_text, bool write_smart_paste) { -- cgit v1.1