Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: webkit/glue/webclipboard_impl.cc

Issue 8591034: Implement WebClipboard::writeDataObject. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webclipboard_impl.cc
diff --git a/webkit/glue/webclipboard_impl.cc b/webkit/glue/webclipboard_impl.cc
index 0cbecaf08c57a1b1b028d289bf148a6a6fcffe2c..80b2ae90220613ffb9896a39cdac272b380260fd 100644
--- a/webkit/glue/webclipboard_impl.cc
+++ b/webkit/glue/webclipboard_impl.cc
@@ -11,6 +11,7 @@
#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/WebDragData.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"
@@ -26,6 +27,7 @@
using WebKit::WebClipboard;
using WebKit::WebData;
+using WebKit::WebDragData;
using WebKit::WebImage;
using WebKit::WebString;
using WebKit::WebURL;
@@ -220,6 +222,17 @@ void WebClipboardImpl::writeImage(
}
}
+void WebClipboardImpl::writeDataObject(const WebDragData& data) {
+ // TODO(dcheng): This actually results in a double clear of the clipboard.
+ // Once in WebKit, and once here when the clipboard writer goes out of scope.
+ // The same is true of the other WebClipboard::write* methods.
+ ScopedClipboardWriterGlue scw(ClipboardGetClipboard());
+
+ // TODO(dcheng): Properly support text/uri-list here.
+ scw.WriteText(data.plainText());
+ scw.WriteHTML(data.htmlText(), "");
+}
+
bool WebClipboardImpl::ConvertBufferType(Buffer buffer,
ui::Clipboard::Buffer* result) {
switch (buffer) {
« no previous file with comments | « webkit/glue/webclipboard_impl.h ('k') | webkit/tools/test_shell/mock_webclipboard_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698