Chromium Code Reviews| Index: Source/core/events/ClipboardEvent.cpp |
| diff --git a/Source/core/events/ClipboardEvent.cpp b/Source/core/events/ClipboardEvent.cpp |
| index 22992c3ec0003cbf721a7f75cc516b4f503e4714..f857fc566babeeea7c030a0131b8cbd0c4bc8cfa 100644 |
| --- a/Source/core/events/ClipboardEvent.cpp |
| +++ b/Source/core/events/ClipboardEvent.cpp |
| @@ -22,6 +22,7 @@ |
| #include "config.h" |
| #include "core/events/ClipboardEvent.h" |
| +#include "core/clipboard/DataObject.h" |
| namespace blink { |
| @@ -34,6 +35,19 @@ ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bo |
| { |
| } |
| +ClipboardEvent::ClipboardEvent(const AtomicString& type, const ClipboardEventInit& initializer) |
| + : Event(type, initializer) |
| +{ |
| + DataTransferAccessPolicy policy = DataTransferNumb; |
| + |
| + if (type == EventTypeNames::copy || type == EventTypeNames::cut || type == EventTypeNames::paste) |
| + policy = DataTransferWritable; |
| + |
| + m_clipboardData = DataTransfer::create(DataTransfer::CopyAndPaste, policy, DataObject::create()); |
| + if (initializer.hasDataType()) |
|
philipj_slow
2015/06/26 22:37:44
The hasDataType() isn't needed because this member
|
| + m_clipboardData->setData(initializer.dataType(), initializer.data()); |
| +} |
| + |
| ClipboardEvent::~ClipboardEvent() |
| { |
| } |