summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/qt
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-15 12:23:52 +0000
committerSteve Block <steveblock@google.com>2010-02-16 11:48:32 +0000
commit8a0914b749bbe7da7768e07a7db5c6d4bb09472b (patch)
tree73f9065f370435d6fde32ae129d458a8c77c8dff /WebCore/platform/qt
parentbf14be70295513b8076f3fa47a268a7e42b2c478 (diff)
downloadexternal_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.zip
external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.gz
external_webkit-8a0914b749bbe7da7768e07a7db5c6d4bb09472b.tar.bz2
Merge webkit.org at r54731 : Initial merge by git
Change-Id: Ia79977b6cf3b0b00c06ef39419989b28e57e4f4a
Diffstat (limited to 'WebCore/platform/qt')
-rw-r--r--WebCore/platform/qt/ClipboardQt.cpp13
-rw-r--r--WebCore/platform/qt/ClipboardQt.h1
-rw-r--r--WebCore/platform/qt/CookieJarQt.cpp20
3 files changed, 34 insertions, 0 deletions
diff --git a/WebCore/platform/qt/ClipboardQt.cpp b/WebCore/platform/qt/ClipboardQt.cpp
index f9940a6..c23e42e 100644
--- a/WebCore/platform/qt/ClipboardQt.cpp
+++ b/WebCore/platform/qt/ClipboardQt.cpp
@@ -290,6 +290,19 @@ void ClipboardQt::writeRange(Range* range, Frame* frame)
#endif
}
+void ClipboardQt::writePlainText(const String& str)
+{
+ if (!m_writableData)
+ m_writableData = new QMimeData;
+ QString text = str;
+ text.replace(QChar(0xa0), QLatin1Char(' '));
+ m_writableData->setText(text);
+#ifndef QT_NO_CLIPBOARD
+ if (!isForDragging())
+ QApplication::clipboard()->setMimeData(m_writableData);
+#endif
+}
+
bool ClipboardQt::hasData()
{
const QMimeData *data = m_readableData ? m_readableData : m_writableData;
diff --git a/WebCore/platform/qt/ClipboardQt.h b/WebCore/platform/qt/ClipboardQt.h
index 9a918ed..9b54d5f 100644
--- a/WebCore/platform/qt/ClipboardQt.h
+++ b/WebCore/platform/qt/ClipboardQt.h
@@ -66,6 +66,7 @@ namespace WebCore {
virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
virtual void writeURL(const KURL&, const String&, Frame*);
virtual void writeRange(Range*, Frame*);
+ virtual void writePlainText(const String&);
virtual bool hasData();
diff --git a/WebCore/platform/qt/CookieJarQt.cpp b/WebCore/platform/qt/CookieJarQt.cpp
index b621e7e..01d1756 100644
--- a/WebCore/platform/qt/CookieJarQt.cpp
+++ b/WebCore/platform/qt/CookieJarQt.cpp
@@ -103,6 +103,26 @@ String cookies(const Document* document, const KURL& url)
return resultCookies.join(QLatin1String("; "));
}
+String cookieRequestHeaderFieldValue(const Document* document, const KURL &url)
+{
+ QUrl u(url);
+ QNetworkCookieJar* jar = cookieJar(document);
+ if (!jar)
+ return String();
+
+ QList<QNetworkCookie> cookies = jar->cookiesForUrl(u);
+ if (cookies.isEmpty())
+ return String();
+
+ QStringList resultCookies;
+ foreach (QNetworkCookie networkCookie, cookies) {
+ resultCookies.append(QString::fromAscii(
+ networkCookie.toRawForm(QNetworkCookie::NameAndValueOnly).constData()));
+ }
+
+ return resultCookies.join(QLatin1String("; "));
+}
+
bool cookiesEnabled(const Document* document)
{
QNetworkCookieJar* jar = cookieJar(document);