Index: Source/core/platform/chromium/ClipboardChromium.cpp |
diff --git a/Source/core/platform/chromium/ClipboardChromium.cpp b/Source/core/platform/chromium/ClipboardChromium.cpp |
index 52d546193c2938c231b6aa74a99b3df641ed3394..48b258c7a0d5cf13f523306bdb6713c587a9443b 100644 |
--- a/Source/core/platform/chromium/ClipboardChromium.cpp |
+++ b/Source/core/platform/chromium/ClipboardChromium.cpp |
@@ -64,8 +64,8 @@ public: |
virtual PassRefPtr<DataTransferItem> item(unsigned long index) OVERRIDE; |
virtual void deleteItem(unsigned long index, ExceptionState&) OVERRIDE; |
virtual void clear() OVERRIDE; |
- virtual void add(const String& data, const String& type, ExceptionState&) OVERRIDE; |
- virtual void add(PassRefPtr<File>) OVERRIDE; |
+ virtual PassRefPtr<DataTransferItem> add(const String& data, const String& type, ExceptionState&) OVERRIDE; |
+ virtual PassRefPtr<DataTransferItem> add(PassRefPtr<File>) OVERRIDE; |
private: |
DataTransferItemListPolicyWrapper(PassRefPtr<ClipboardChromium>, PassRefPtr<ChromiumDataObject>); |
@@ -119,18 +119,24 @@ void DataTransferItemListPolicyWrapper::clear() |
m_dataObject->clearAll(); |
} |
-void DataTransferItemListPolicyWrapper::add(const String& data, const String& type, ExceptionState& es) |
+PassRefPtr<DataTransferItem> DataTransferItemListPolicyWrapper::add(const String& data, const String& type, ExceptionState& es) |
{ |
if (!m_clipboard->canWriteData()) |
- return; |
- m_dataObject->add(data, type, es); |
+ return 0; |
+ RefPtr<ChromiumDataObjectItem> item = m_dataObject->add(data, type, es); |
+ if (!item) |
+ return 0; |
+ return DataTransferItemPolicyWrapper::create(m_clipboard, item); |
} |
-void DataTransferItemListPolicyWrapper::add(PassRefPtr<File> file) |
+PassRefPtr<DataTransferItem> DataTransferItemListPolicyWrapper::add(PassRefPtr<File> file) |
{ |
if (!m_clipboard->canWriteData()) |
- return; |
- m_dataObject->add(file, m_clipboard->frame()->document()->scriptExecutionContext()); |
+ return 0; |
+ RefPtr<ChromiumDataObjectItem> item = m_dataObject->add(file, m_clipboard->frame()->document()->scriptExecutionContext()); |
+ if (!item) |
+ return 0; |
+ return DataTransferItemPolicyWrapper::create(m_clipboard, item); |
} |
DataTransferItemListPolicyWrapper::DataTransferItemListPolicyWrapper( |