diff options
Diffstat (limited to 'WebCore/platform/chromium/WritableDataObject.cpp')
-rw-r--r-- | WebCore/platform/chromium/WritableDataObject.cpp | 82 |
1 files changed, 12 insertions, 70 deletions
diff --git a/WebCore/platform/chromium/WritableDataObject.cpp b/WebCore/platform/chromium/WritableDataObject.cpp index 6e7c283..7cbf42c 100644 --- a/WebCore/platform/chromium/WritableDataObject.cpp +++ b/WebCore/platform/chromium/WritableDataObject.cpp @@ -36,22 +36,22 @@ namespace WebCore { -PassRefPtr<WritableDataObject> WritableDataObject::create(bool isForDragging) +PassRefPtr<WritableDataObject> WritableDataObject::create(Clipboard::ClipboardType clipboardType) { - return adoptRef(new WritableDataObject(isForDragging)); + return adoptRef(new WritableDataObject(clipboardType)); } -WritableDataObject::WritableDataObject(bool isForDragging) - : m_isForDragging(isForDragging) +WritableDataObject::WritableDataObject(Clipboard::ClipboardType clipboardType) + : m_clipboardType(clipboardType) { } void WritableDataObject::clearData(const String& type) { m_dataMap.remove(type); - if (type == textUriListType) + if (type == mimeTypeTextURIList) m_urlTitle = ""; - else if (type == textHtmlType) + else if (type == mimeTypeTextHTML) m_htmlBaseURL = KURL(); } @@ -76,77 +76,19 @@ void WritableDataObject::clearAll() bool WritableDataObject::setData(const String& type, const String& data) { - if (!m_isForDragging) { + if (m_clipboardType == Clipboard::CopyAndPaste) { + // FIXME: This is currently unimplemented on the Chromium-side. This is + // "okay" for now since the original implementation didn't support it + // anyway. Going forward, this is something we'll need to fix though. ChromiumBridge::clipboardWriteData(type, data, ""); return true; } m_dataMap.set(type, data); - if (type == textUriListType) + if (type == mimeTypeTextURIList) m_urlTitle = ""; - else if (type == textHtmlType) + else if (type == mimeTypeTextHTML) m_htmlBaseURL = KURL(); return true; } -void WritableDataObject::setURL(const String& url, const String& title) -{ - setData(textUriListType, url); - m_urlTitle = title; -} - -void WritableDataObject::setHTML(const String& html, const KURL& baseURL) -{ - setData(textHtmlType, html); - m_htmlBaseURL = baseURL; -} - -// Accessors used when transferring drag data from the renderer to the -// browser. -HashMap<String, String> WritableDataObject::dataMap() const -{ - return m_dataMap; -} - -String WritableDataObject::urlTitle() const -{ - return m_urlTitle; -} - -KURL WritableDataObject::htmlBaseURL() const -{ - return m_htmlBaseURL; -} - -// Used for transferring file data from the renderer to the browser. -String WritableDataObject::fileExtension() const -{ - return m_fileExtension; -} - -String WritableDataObject::fileContentFilename() const -{ - return m_fileContentFilename; -} - -PassRefPtr<SharedBuffer> WritableDataObject::fileContent() const -{ - return m_fileContent; -} - -void WritableDataObject::setFileExtension(const String& fileExtension) -{ - m_fileExtension = fileExtension; -} - -void WritableDataObject::setFileContentFilename(const String& fileContentFilename) -{ - m_fileContentFilename = fileContentFilename; -} - -void WritableDataObject::setFileContent(PassRefPtr<SharedBuffer> fileContent) -{ - m_fileContent = fileContent; -} - - } // namespace WebCore |