Chromium Code Reviews| Index: third_party/WebKit/Source/core/clipboard/DataObject.cpp |
| diff --git a/third_party/WebKit/Source/core/clipboard/DataObject.cpp b/third_party/WebKit/Source/core/clipboard/DataObject.cpp |
| index 023c4a163beb0ea6c3ed72f51cd8986d3d3693af..3fd9de842e4f1ffed0d8a9f694dd33a9079ab377 100644 |
| --- a/third_party/WebKit/Source/core/clipboard/DataObject.cpp |
| +++ b/third_party/WebKit/Source/core/clipboard/DataObject.cpp |
| @@ -62,6 +62,12 @@ DataObject* DataObject::createFromPasteboard(PasteMode pasteMode) { |
| return dataObject; |
| } |
| +DataObject* DataObject::createFromString(const String& data) { |
| + DataObject* dataObject = create(); |
| + dataObject->add(data, "text/plain"); |
|
chongz
2016/10/27 16:41:24
Can we import |mimeTypeTextPlain| from "ClipboardM
chaopeng
2016/10/28 00:33:08
Do we have any better head file? Cause this is not
chongz
2016/10/28 02:12:16
Will see if yosin@ has some suggestions.
|
| + return dataObject; |
| +} |
| + |
| DataObject* DataObject::create() { |
| return new DataObject; |
| } |