summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/WebCoreSupport
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2011-05-05 14:36:32 +0100
committerBen Murdoch <benm@google.com>2011-05-10 15:38:30 +0100
commitf05b935882198ccf7d81675736e3aeb089c5113a (patch)
tree4ea0ca838d9ef1b15cf17ddb3928efb427c7e5a1 /WebKit/qt/WebCoreSupport
parent60fbdcc62bced8db2cb1fd233cc4d1e4ea17db1b (diff)
downloadexternal_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.zip
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.gz
external_webkit-f05b935882198ccf7d81675736e3aeb089c5113a.tar.bz2
Merge WebKit at r74534: Initial merge by git.
Change-Id: I6ccd1154fa1b19c2ec2a66878eb675738735f1eb
Diffstat (limited to 'WebKit/qt/WebCoreSupport')
-rw-r--r--WebKit/qt/WebCoreSupport/ChromeClientQt.cpp17
-rw-r--r--WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp88
-rw-r--r--WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h61
-rw-r--r--WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp1
-rw-r--r--WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp16
-rw-r--r--WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h5
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp59
-rw-r--r--WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h7
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.cpp64
-rw-r--r--WebKit/qt/WebCoreSupport/EditorClientQt.h3
-rw-r--r--WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp26
11 files changed, 325 insertions, 22 deletions
diff --git a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
index e72ef3e..a26d6e2 100644
--- a/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "ChromeClientQt.h"
+#include "ApplicationCacheStorage.h"
#include "DatabaseTracker.h"
#include "FileChooser.h"
#include "Frame.h"
@@ -73,6 +74,7 @@
#include <qeventloop.h>
#include <qtextdocument.h>
#include <qtooltip.h>
+#include <wtf/OwnPtr.h>
namespace WebCore {
@@ -452,7 +454,7 @@ IntPoint ChromeClientQt::screenToWindow(const IntPoint& point) const
PlatformPageClient ChromeClientQt::platformPageClient() const
{
- return m_webPage->d->client;
+ return m_webPage->d->client.get();
}
void ChromeClientQt::contentsSizeChanged(Frame* frame, const IntSize& size) const
@@ -518,9 +520,18 @@ void ChromeClientQt::reachedMaxAppCacheSize(int64_t)
notImplemented();
}
-void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin*)
+void ChromeClientQt::reachedApplicationCacheOriginQuota(SecurityOrigin* origin)
{
- notImplemented();
+ int64_t quota;
+ quint64 defaultOriginQuota = WebCore::cacheStorage().defaultOriginQuota();
+
+ QWebSecurityOriginPrivate* priv = new QWebSecurityOriginPrivate(origin);
+ QWebSecurityOrigin* securityOrigin = new QWebSecurityOrigin(priv);
+
+ if (!WebCore::cacheStorage().quotaForOrigin(origin, quota))
+ WebCore::cacheStorage().storeUpdatedQuotaForOrigin(origin, defaultOriginQuota);
+
+ emit m_webPage->applicationCacheQuotaExceeded(securityOrigin, defaultOriginQuota);
}
#endif
diff --git a/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp b/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp
new file mode 100644
index 0000000..81ddaa2
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#include "config.h"
+#include "DeviceOrientationClientMockQt.h"
+
+#include "DeviceOrientation.h"
+#include "DeviceOrientationClientMock.h"
+#include "DeviceOrientationController.h"
+
+namespace WebCore {
+
+bool DeviceOrientationClientMockQt::mockIsActive = false;
+
+DeviceOrientationClientMockQt* DeviceOrientationClientMockQt::client()
+{
+ static DeviceOrientationClientMockQt* client = 0;
+ if (!client)
+ client = new DeviceOrientationClientMockQt;
+
+ return client;
+}
+
+DeviceOrientationClientMockQt::DeviceOrientationClientMockQt()
+ : m_clientMock(new DeviceOrientationClientMock())
+{
+ m_orientation = DeviceOrientation::create();
+}
+
+DeviceOrientationClientMockQt::~DeviceOrientationClientMockQt()
+{
+ delete m_clientMock;
+}
+
+void DeviceOrientationClientMockQt::setController(DeviceOrientationController* controller)
+{
+ m_clientMock->setController(m_controller);
+}
+
+void DeviceOrientationClientMockQt::startUpdating()
+{
+ m_clientMock->startUpdating();
+}
+
+void DeviceOrientationClientMockQt::stopUpdating()
+{
+ m_clientMock->stopUpdating();
+}
+
+DeviceOrientation* DeviceOrientationClientMockQt::lastOrientation() const
+{
+ return m_orientation.get();
+}
+
+void DeviceOrientationClientMockQt::deviceOrientationControllerDestroyed()
+{
+ delete this;
+}
+
+void DeviceOrientationClientMockQt::setOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+ m_orientation = DeviceOrientation::create(canProvideAlpha, alpha,
+ canProvideBeta, beta,
+ canProvideGamma, gamma);
+ m_clientMock->setOrientation(m_orientation);
+
+ emit mockOrientationChanged(m_orientation.get());
+}
+
+} // namespace WebCore
+
+#include "moc_DeviceOrientationClientMockQt.cpp"
diff --git a/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h b/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h
new file mode 100644
index 0000000..cc5913d
--- /dev/null
+++ b/WebKit/qt/WebCoreSupport/DeviceOrientationClientMockQt.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+#ifndef DeviceOrientationClientMockQt_h
+#define DeviceOrientationClientMockQt_h
+
+#include "DeviceOrientationClient.h"
+#include "RefPtr.h"
+
+#include <QObject>
+
+namespace WebCore {
+
+class DeviceOrientation;
+class DeviceOrientationClientMock;
+class DeviceOrientationController;
+
+class DeviceOrientationClientMockQt : public QObject, public DeviceOrientationClient {
+ Q_OBJECT
+public:
+ static DeviceOrientationClientMockQt* client();
+ virtual ~DeviceOrientationClientMockQt();
+
+ virtual void setController(DeviceOrientationController*);
+ virtual void startUpdating();
+ virtual void stopUpdating();
+ virtual DeviceOrientation* lastOrientation() const;
+ virtual void deviceOrientationControllerDestroyed();
+ void setOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+ static bool mockIsActive;
+
+Q_SIGNALS:
+ void mockOrientationChanged(DeviceOrientation*);
+
+private:
+ DeviceOrientationClientMockQt();
+
+ DeviceOrientationClientMock* m_clientMock;
+ DeviceOrientationController* m_controller;
+ RefPtr<DeviceOrientation> m_orientation;
+};
+
+} // namespace WebCore
+
+#endif // DeviceOrientationClientMockQt_h
diff --git a/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp b/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp
index 1d0c6d1..01cbe73 100644
--- a/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DeviceOrientationClientQt.cpp
@@ -20,6 +20,7 @@
#include "config.h"
#include "DeviceOrientationClientQt.h"
+#include "DeviceOrientationClientMockQt.h"
#include "DeviceOrientationController.h"
#include "DeviceOrientationProviderQt.h"
#include "qwebpage.h"
diff --git a/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp b/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
index 051eba0..a31930d 100644
--- a/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.cpp
@@ -20,16 +20,22 @@
#include "config.h"
#include "DeviceOrientationProviderQt.h"
+#include "DeviceOrientationClientMockQt.h"
+
namespace WebCore {
DeviceOrientationProviderQt::DeviceOrientationProviderQt()
{
m_rotation.addFilter(this);
m_orientation = DeviceOrientation::create();
+
+ if (DeviceOrientationClientMockQt::mockIsActive)
+ activeClientMock();
}
DeviceOrientationProviderQt::~DeviceOrientationProviderQt()
{
+ disconnect();
}
void DeviceOrientationProviderQt::start()
@@ -63,6 +69,16 @@ bool DeviceOrientationProviderQt::filter(QRotationReading* reading)
return false;
}
+void DeviceOrientationProviderQt::changeDeviceOrientation(DeviceOrientation* orientation)
+{
+ m_orientation = orientation;
+}
+
+void DeviceOrientationProviderQt::activeClientMock()
+{
+ connect(DeviceOrientationClientMockQt::client(), SIGNAL(mockOrientationChanged(DeviceOrientation*)), SLOT(changeDeviceOrientation(DeviceOrientation*)));
+}
+
}
#include "moc_DeviceOrientationProviderQt.cpp"
diff --git a/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h b/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
index 86c224e..e87937e 100644
--- a/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
+++ b/WebKit/qt/WebCoreSupport/DeviceOrientationProviderQt.h
@@ -48,7 +48,12 @@ public:
Q_SIGNALS:
void deviceOrientationChanged(DeviceOrientation*);
+public Q_SLOTS:
+ void changeDeviceOrientation(DeviceOrientation*);
+
private:
+ void activeClientMock();
+
RefPtr<DeviceOrientation> m_orientation;
QRotationSensor m_rotation;
};
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index a5a7270..754b20a 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -23,11 +23,14 @@
#include "config.h"
#include "DumpRenderTreeSupportQt.h"
+#include "ApplicationCacheStorage.h"
#include "CSSComputedStyleDeclaration.h"
#include "ChromeClientQt.h"
#include "ContextMenu.h"
#include "ContextMenuClientQt.h"
#include "ContextMenuController.h"
+#include "DeviceOrientation.h"
+#include "DeviceOrientationClientMockQt.h"
#include "Editor.h"
#include "EditorClientQt.h"
#include "Element.h"
@@ -437,6 +440,32 @@ bool DumpRenderTreeSupportQt::isCommandEnabled(QWebPage* page, const QString& na
return page->handle()->page->focusController()->focusedOrMainFrame()->editor()->command(name).isEnabled();
}
+bool DumpRenderTreeSupportQt::findString(QWebPage* page, const QString& string, const QStringList& optionArray)
+{
+ // 1. Parse the options from the array
+ WebCore::FindOptions options = 0;
+ const int optionCount = optionArray.size();
+ for (int i = 0; i < optionCount; ++i) {
+ const QString& option = optionArray.at(i);
+ if (option == QLatin1String("CaseInsensitive"))
+ options |= WebCore::CaseInsensitive;
+ else if (option == QLatin1String("AtWordStarts"))
+ options |= WebCore::AtWordStarts;
+ else if (option == QLatin1String("TreatMedialCapitalAsWordStart"))
+ options |= WebCore::TreatMedialCapitalAsWordStart;
+ else if (option == QLatin1String("Backwards"))
+ options |= WebCore::Backwards;
+ else if (option == QLatin1String("WrapAround"))
+ options |= WebCore::WrapAround;
+ else if (option == QLatin1String("StartInSelection"))
+ options |= WebCore::StartInSelection;
+ }
+
+ // 2. find the string
+ WebCore::Frame* frame = page->handle()->page->focusController()->focusedOrMainFrame();
+ return frame && frame->editor()->findString(string, options);
+}
+
QString DumpRenderTreeSupportQt::markerTextForListItem(const QWebElement& listItem)
{
return WebCore::markerTextForListItem(listItem.m_element);
@@ -559,6 +588,14 @@ void DumpRenderTreeSupportQt::setEditingBehavior(QWebPage* page, const QString&
corePage->settings()->setEditingBehaviorType(coreEditingBehavior);
}
+void DumpRenderTreeSupportQt::clearAllApplicationCaches()
+{
+#if ENABLE(OFFLINE_WEB_APPLICATIONS)
+ WebCore::cacheStorage().empty();
+ WebCore::cacheStorage().vacuumDatabaseFile();
+#endif
+}
+
void DumpRenderTreeSupportQt::dumpFrameLoader(bool b)
{
FrameLoaderClientQt::dumpFrameLoaderCallbacks = b;
@@ -658,6 +695,28 @@ QString DumpRenderTreeSupportQt::viewportAsText(QWebPage* page, const QSize& ava
return res;
}
+void DumpRenderTreeSupportQt::activeMockDeviceOrientationClient(bool b)
+{
+#if ENABLE(DEVICE_ORIENTATION)
+ DeviceOrientationClientMockQt::mockIsActive = b;
+#endif
+}
+
+void DumpRenderTreeSupportQt::removeMockDeviceOrientation()
+{
+#if ENABLE(DEVICE_ORIENTATION)
+ DeviceOrientationClientMockQt* client = DeviceOrientationClientMockQt::client();
+ delete client;
+#endif
+}
+
+void DumpRenderTreeSupportQt::setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma)
+{
+#if ENABLE(DEVICE_ORIENTATION)
+ DeviceOrientationClientMockQt::client()->setOrientation(canProvideAlpha, alpha, canProvideBeta, beta, canProvideGamma, gamma);
+#endif
+}
+
void DumpRenderTreeSupportQt::setMockGeolocationPosition(double latitude, double longitude, double accuracy)
{
#if ENABLE(GEOLOCATION)
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 82d9319..e08d962 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -44,6 +44,7 @@ public:
static void executeCoreCommandByName(QWebPage* page, const QString& name, const QString& value);
static bool isCommandEnabled(QWebPage* page, const QString& name);
+ static bool findString(QWebPage* page, const QString& string, const QStringList& optionArray);
static void setSmartInsertDeleteEnabled(QWebPage* page, bool enabled);
static void setSelectTrailingWhitespaceEnabled(QWebPage* page, bool enabled);
static QVariantList selectedRange(QWebPage* page);
@@ -87,10 +88,16 @@ public:
static bool elementDoesAutoCompleteForElementWithId(QWebFrame* frame, const QString& elementId);
static void setEditingBehavior(QWebPage* page, const QString& editingBehavior);
+ static void clearAllApplicationCaches();
+
static void whiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
static void removeWhiteListAccessFromOrigin(const QString& sourceOrigin, const QString& destinationProtocol, const QString& destinationHost, bool allowDestinationSubdomains);
static void resetOriginAccessWhiteLists();
+ static void activeMockDeviceOrientationClient(bool b);
+ static void removeMockDeviceOrientation();
+ static void setMockDeviceOrientation(bool canProvideAlpha, double alpha, bool canProvideBeta, double beta, bool canProvideGamma, double gamma);
+
static void setMockGeolocationPosition(double latitude, double longitude, double accuracy);
static void setMockGeolocationError(int errorCode, const QString& message);
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
index 91a0cc6..3fbc83d 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.cpp
@@ -53,6 +53,7 @@
#include <QUndoStack>
#include <stdio.h>
+#include <wtf/OwnPtr.h>
#define methodDebug() qDebug("EditorClientQt: %s", __FUNCTION__);
@@ -348,7 +349,7 @@ void EditorClientQt::toggleGrammarChecking()
void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
{
Frame* frame = m_page->d->page->focusController()->focusedOrMainFrame();
- if (!frame || !frame->document()->focusedNode())
+ if (!frame)
return;
const PlatformKeyboardEvent* kevent = event->keyEvent();
@@ -373,6 +374,7 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
}
}
}
+
#ifndef QT_NO_SHORTCUT
QWebPage::WebAction action = QWebPagePrivate::editorActionForKeyEvent(kevent->qtEvent());
if (action != QWebPage::NoWebAction && !doSpatialNavigation) {
@@ -465,6 +467,62 @@ void EditorClientQt::handleKeyboardEvent(KeyboardEvent* event)
return;
}
} else {
+ if (m_page->handle()->page->settings()->caretBrowsingEnabled()) {
+ switch (kevent->windowsVirtualKeyCode()) {
+ case VK_LEFT:
+ if (kevent->shiftKey() && kevent->ctrlKey())
+ frame->editor()->command("MoveWordBackwardAndModifySelection").execute();
+ else if (kevent->shiftKey())
+ frame->editor()->command("MoveLeftAndModifySelection").execute();
+ else if (kevent->ctrlKey())
+ frame->editor()->command("MoveWordBackward").execute();
+ else
+ frame->editor()->command("MoveLeft").execute();
+ break;
+ case VK_RIGHT:
+ if (kevent->shiftKey() && kevent->ctrlKey())
+ frame->editor()->command("MoveWordForwardAndModifySelection").execute();
+ else if (kevent->shiftKey())
+ frame->editor()->command("MoveRightAndModifySelection").execute();
+ else if (kevent->ctrlKey())
+ frame->editor()->command("MoveWordForward").execute();
+ else
+ frame->editor()->command("MoveRight").execute();
+ break;
+ case VK_UP:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveUpAndModifySelection").execute();
+ else
+ frame->editor()->command("MoveUp").execute();
+ break;
+ case VK_DOWN:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveDownAndModifySelection").execute();
+ else
+ frame->editor()->command("MoveDown").execute();
+ break;
+ case VK_PRIOR: // PageUp
+ frame->editor()->command("MovePageUp").execute();
+ break;
+ case VK_NEXT: // PageDown
+ frame->editor()->command("MovePageDown").execute();
+ break;
+ case VK_HOME:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveToBeginningOfLineAndModifySelection").execute();
+ else
+ frame->editor()->command("MoveToBeginningOfLine").execute();
+ break;
+ case VK_END:
+ if (kevent->shiftKey())
+ frame->editor()->command("MoveToEndOfLineAndModifySelection").execute();
+ else
+ frame->editor()->command("MoveToEndOfLine").execute();
+ break;
+ default:
+ break;
+ }
+ }
#ifndef QT_NO_SHORTCUT
if (kevent->qtEvent() == QKeySequence::Copy)
m_page->triggerAction(QWebPage::Copy);
@@ -558,7 +616,7 @@ bool EditorClientQt::spellingUIIsShowing()
return false;
}
-void EditorClientQt::getGuessesForWord(const String&, Vector<String>&)
+void EditorClientQt::getGuessesForWord(const String& word, const String& context, Vector<String>& guesses)
{
notImplemented();
}
@@ -574,7 +632,7 @@ void EditorClientQt::willSetInputMethodState()
void EditorClientQt::setInputMethodState(bool active)
{
- QWebPageClient* webPageClient = m_page->d->client;
+ QWebPageClient* webPageClient = m_page->d->client.get();
if (webPageClient) {
Qt::InputMethodHints hints;
diff --git a/WebKit/qt/WebCoreSupport/EditorClientQt.h b/WebKit/qt/WebCoreSupport/EditorClientQt.h
index 7d99d22..1e410e6 100644
--- a/WebKit/qt/WebCoreSupport/EditorClientQt.h
+++ b/WebKit/qt/WebCoreSupport/EditorClientQt.h
@@ -104,9 +104,10 @@ public:
virtual void updateSpellingUIWithMisspelledWord(const String&);
virtual void showSpellingUI(bool show);
virtual bool spellingUIIsShowing();
- virtual void getGuessesForWord(const String&, Vector<String>& guesses);
+ virtual void getGuessesForWord(const String& word, const String& context, Vector<String>& guesses);
virtual void willSetInputMethodState();
virtual void setInputMethodState(bool enabled);
+ virtual void requestCheckingOfString(SpellChecker*, int, const String&) {}
bool isEditing() const;
diff --git a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
index bf6e75a..849958f 100644
--- a/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
@@ -59,6 +59,7 @@
#include "HTMLFormElement.h"
#include "HTMLPlugInElement.h"
#include "HTTPParsers.h"
+#include "QtNAMThreadSafeProxy.h"
#include "NotImplemented.h"
#include "QNetworkReplyHandler.h"
#include "ResourceHandleInternal.h"
@@ -85,6 +86,7 @@
#include <QNetworkReply>
#include <QStringList>
#include "qwebhistory_p.h"
+#include <wtf/OwnPtr.h>
static QMap<unsigned long, QString> dumpAssignedUrls;
@@ -975,13 +977,13 @@ void FrameLoaderClientQt::download(WebCore::ResourceHandle* handle, const WebCor
return;
QNetworkReplyHandler* handler = handle->getInternal()->m_job;
- QNetworkReply* reply = handler->release();
- if (reply) {
+ QtNetworkReplyThreadSafeProxy* replyProxy = handler->release();
+ if (replyProxy) {
QWebPage *page = m_webFrame->page();
if (page->forwardUnsupportedContent())
- emit page->unsupportedContent(reply);
+ emit page->unsupportedContent(replyProxy->reply());
else
- reply->abort();
+ replyProxy->abort();
}
}
@@ -1464,10 +1466,8 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
QString urlStr(url.string());
QUrl qurl = urlStr;
- QObject* object = 0;
-
if (mimeType == "application/x-qt-plugin" || mimeType == "application/x-qt-styled-widget") {
- object = m_webFrame->page()->createPlugin(classid, qurl, params, values);
+ QObject* object = m_webFrame->page()->createPlugin(classid, qurl, params, values);
#ifndef QT_NO_STYLE_STYLESHEET
QWidget* widget = qobject_cast<QWidget*>(object);
if (widget && mimeType == "application/x-qt-styled-widget") {
@@ -1488,7 +1488,6 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
widget->setStyleSheet(styleSheet);
}
#endif // QT_NO_STYLE_STYLESHEET
- }
if (!object) {
QWebPluginFactory* factory = m_webFrame->page()->pluginFactory();
@@ -1497,8 +1496,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
}
if (object) {
- QWidget* widget = qobject_cast<QWidget*>(object);
- if (widget) {
+ if (QWidget* widget = qobject_cast<QWidget*>(object)) {
QWidget* parentWidget = 0;
if (m_webFrame->page()->d->client)
parentWidget = qobject_cast<QWidget*>(m_webFrame->page()->d->client->pluginParent());
@@ -1512,8 +1510,7 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
return w;
}
- QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object);
- if (graphicsWidget) {
+ if (QGraphicsWidget* graphicsWidget = qobject_cast<QGraphicsWidget*>(object)) {
QGraphicsObject* parentWidget = 0;
if (m_webFrame->page()->d->client)
parentWidget = qobject_cast<QGraphicsObject*>(m_webFrame->page()->d->client->pluginParent());
@@ -1528,14 +1525,14 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
// FIXME: make things work for widgetless plugins as well
delete object;
+ }
}
#if ENABLE(NETSCAPE_PLUGIN_API)
else { // NPAPI Plugins
Vector<String> params = paramNames;
Vector<String> values = paramValues;
-#if !OS(SYMBIAN)
if (mimeType == "application/x-shockwave-flash") {
- QWebPageClient* client = m_webFrame->page()->d->client;
+ QWebPageClient* client = m_webFrame->page()->d->client.get();
const bool isQWebView = client && qobject_cast<QWidget*>(client->pluginParent());
#if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO >= 5)
size_t wmodeIndex = params.find("wmode");
@@ -1559,7 +1556,6 @@ PassRefPtr<Widget> FrameLoaderClientQt::createPlugin(const IntSize& pluginSize,
}
#endif
}
-#endif
RefPtr<PluginView> pluginView = PluginView::create(m_frame, pluginSize, element, url,
params, values, mimeType, loadManually);