Diff
Modified: trunk/Source/WebKit2/ChangeLog (102931 => 102932)
--- trunk/Source/WebKit2/ChangeLog 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/ChangeLog 2011-12-15 14:09:48 UTC (rev 102932)
@@ -1,3 +1,71 @@
+2011-12-15 Caio Marcelo de Oliveira Filho <[email protected]>
+
+ [Qt] [WK2] Remove QtWebPageProxy
+ https://bugs.webkit.org/show_bug.cgi?id=74540
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Move WebPageProxy* to QQuickWebViewPrivate. The remaining functions in
+ QtWebPageProxy were simple wrappers to WebKit functionality (text zoom, page zoom
+ and user agent setting). Since those wrappers are unused, they were removed. The
+ signal in the class was also unused.
+
+ This patch also remove the code from WebContextMenuProxyQt, it was remains of a
+ previous QMenu-based implementation. We want to rewrite this code for QML anyway,
+ so I reverted to an empty state.
+
+ Farewell, QtWebPageProxy!
+
+ * Target.pri:
+ * UIProcess/API/qt/qquickwebpage.cpp:
+ * UIProcess/API/qt/qquickwebpage_p.h:
+ * UIProcess/API/qt/qquickwebview.cpp:
+ (QQuickWebViewPrivate::~QQuickWebViewPrivate):
+ (QQuickWebViewPrivate::initialize):
+ (QQuickWebViewPrivate::processDidCrash):
+ (QQuickWebViewPrivate::createDrawingAreaProxy):
+ (QQuickWebViewPrivate::updateVisibleContentRectAndScale):
+ (QQuickWebViewPrivate::_q_viewportTrajectoryVectorChanged):
+ (QQuickWebViewPrivate::_q_onVisibleChanged):
+ (QQuickWebViewPrivate::updateViewportSize):
+ (QQuickWebViewPrivate::computeViewportConstraints):
+ (QQuickWebViewPrivate::setUseTraditionalDesktopBehaviour):
+ (QQuickWebViewPrivate::setNavigatorQtObjectEnabled):
+ (QQuickWebViewExperimental::postMessage):
+ (QQuickWebView::load):
+ (QQuickWebView::goBack):
+ (QQuickWebView::goForward):
+ (QQuickWebView::stop):
+ (QQuickWebView::reload):
+ (QQuickWebView::url):
+ (QQuickWebView::canGoBack):
+ (QQuickWebView::canGoForward):
+ (QQuickWebView::loading):
+ (QQuickWebView::canReload):
+ (QQuickWebView::title):
+ (QQuickWebView::pageRef):
+ (QQuickWebView::loadHtml):
+ * UIProcess/API/qt/qquickwebview_p.h:
+ * UIProcess/API/qt/qquickwebview_p_p.h:
+ * UIProcess/API/qt/qwebnavigationhistory_p_p.h:
+ * UIProcess/API/qt/qwebpreferences.cpp:
+ (QWebPreferencesPrivate::preferencesRef):
+ * UIProcess/PageClient.h:
+ * UIProcess/qt/QtPageClient.cpp:
+ (QtPageClient::QtPageClient):
+ (QtPageClient::initialize):
+ (QtPageClient::createPopupMenuProxy):
+ (QtPageClient::createContextMenuProxy):
+ * UIProcess/qt/QtPageClient.h:
+ * UIProcess/qt/QtWebPageProxy.cpp: Removed.
+ * UIProcess/qt/QtWebPageProxy.h: Removed.
+ * UIProcess/qt/WebContextMenuProxyQt.cpp:
+ (WebKit::WebContextMenuProxyQt::WebContextMenuProxyQt):
+ (WebKit::WebContextMenuProxyQt::create):
+ (WebKit::WebContextMenuProxyQt::showContextMenu):
+ (WebKit::WebContextMenuProxyQt::hideContextMenu):
+ * UIProcess/qt/WebContextMenuProxyQt.h:
+
2011-12-15 Simon Hausmann <[email protected]>
[WK2] Eliminate unnecessary GTK/QT ifdefs for shared memory implementation
Modified: trunk/Source/WebKit2/Target.pri (102931 => 102932)
--- trunk/Source/WebKit2/Target.pri 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/Target.pri 2011-12-15 14:09:48 UTC (rev 102932)
@@ -267,7 +267,6 @@
UIProcess/qt/QtPageClient.h \
UIProcess/qt/QtWebPageLoadClient.h \
UIProcess/qt/QtWebPagePolicyClient.h \
- UIProcess/qt/QtWebPageProxy.h \
UIProcess/qt/QtWebPageUIClient.h \
UIProcess/qt/QtSGUpdateQueue.h \
UIProcess/qt/QtSGTileNode.h \
@@ -590,7 +589,6 @@
UIProcess/qt/QtPageClient.cpp \
UIProcess/qt/QtWebPageLoadClient.cpp \
UIProcess/qt/QtWebPagePolicyClient.cpp \
- UIProcess/qt/QtWebPageProxy.cpp \
UIProcess/qt/QtWebPageUIClient.cpp \
UIProcess/qt/QtSGUpdateQueue.cpp \
UIProcess/qt/QtSGTileNode.cpp \
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -23,7 +23,6 @@
#include "LayerTreeHostProxy.h"
#include "QtWebPageEventHandler.h"
-#include "QtWebPageProxy.h"
#include "TransformationMatrix.h"
#include "qquickwebpage_p_p.h"
#include <QtQuick/QQuickCanvas>
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -32,7 +32,6 @@
namespace WebKit {
class QtSGUpdateQueue;
}
-class QtWebPageProxy;
class QWEBKIT_EXPORT QQuickWebPage : public QQuickItem {
Q_OBJECT
@@ -70,7 +69,6 @@
QQuickWebPagePrivate* d;
friend class QQuickWebView;
friend class QQuickWebViewPrivate;
- friend class QtWebPageProxy;
};
QML_DECLARE_TYPE(QQuickWebPage)
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -27,7 +27,6 @@
#include "QtDownloadManager.h"
#include "QtWebContext.h"
#include "QtWebPageEventHandler.h"
-#include "QtWebPageProxy.h"
#include "UtilsQt.h"
#include "WebBackForwardList.h"
#include "WebPageGroup.h"
@@ -68,30 +67,30 @@
{
if (interactionEngine)
interactionEngine->disconnect();
+ webPageProxy->close();
}
// Note: we delay this initialization to make sure that QQuickWebView has its d-ptr in-place.
void QQuickWebViewPrivate::initialize(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
{
context = contextRef ? QtWebContext::create(toImpl(contextRef)) : QtWebContext::defaultContext();
+ webPageProxy = context->createWebPage(&pageClient, toImpl(pageGroupRef));
+
QQuickWebPagePrivate* const pageViewPrivate = pageView.data()->d;
- setPageProxy(new QtWebPageProxy(q_ptr, &pageClient, context, pageGroupRef));
- pageViewPrivate->initialize(webPageProxy());
+ pageViewPrivate->initialize(webPageProxy.get());
- pageLoadClient.reset(new QtWebPageLoadClient(pageProxy->pageRef(), q_ptr));
- pagePolicyClient.reset(new QtWebPagePolicyClient(pageProxy->pageRef(), q_ptr));
- pageUIClient.reset(new QtWebPageUIClient(pageProxy->pageRef(), q_ptr));
- navigationHistory = adoptPtr(QWebNavigationHistoryPrivate::createHistory(pageProxy->pageRef()));
+ pageLoadClient.reset(new QtWebPageLoadClient(toAPI(webPageProxy.get()), q_ptr));
+ pagePolicyClient.reset(new QtWebPagePolicyClient(toAPI(webPageProxy.get()), q_ptr));
+ pageUIClient.reset(new QtWebPageUIClient(toAPI(webPageProxy.get()), q_ptr));
+ navigationHistory = adoptPtr(QWebNavigationHistoryPrivate::createHistory(toAPI(webPageProxy.get())));
- // Any page setting should preferrable be set before creating the page, so set them here:
+ // Any page setting should preferrable be set before creating the page.
setUseTraditionalDesktopBehaviour(false);
- webPageProxy()->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
+ webPageProxy->pageGroup()->preferences()->setAcceleratedCompositingEnabled(true);
- pageClient.initialize(q_ptr, pageProxy.data(), pageViewPrivate->eventHandler.data(), &undoController);
+ pageClient.initialize(q_ptr, pageViewPrivate->eventHandler.data(), &undoController);
+ webPageProxy->initializeWebPage();
- // Creates a page with the page creation parameters.
- pageProxy->init();
-
// Trigger setting of correct visibility flags after everything was allocated and initialized.
_q_onVisibleChanged();
}
@@ -229,7 +228,7 @@
{
emit q_ptr->navigationStateChanged();
pageView->d->eventHandler->resetGestureRecognizers();
- WebCore::KURL url(WebCore::ParsedURLString, webPageProxy()->urlAtProcessExit());
+ WebCore::KURL url(WebCore::ParsedURLString, webPageProxy->urlAtProcessExit());
qWarning("WARNING: The web process experienced a crash on '%s'.", qPrintable(QUrl(url).toString(QUrl::RemoveUserInfo)));
}
@@ -242,7 +241,7 @@
PassOwnPtr<DrawingAreaProxy> QQuickWebViewPrivate::createDrawingAreaProxy()
{
- return DrawingAreaProxyImpl::create(webPageProxy());
+ return DrawingAreaProxyImpl::create(webPageProxy.get());
}
void QQuickWebViewPrivate::handleDownloadRequest(DownloadProxy* download)
@@ -261,7 +260,7 @@
void QQuickWebViewPrivate::updateVisibleContentRectAndScale()
{
- DrawingAreaProxy* drawingArea = webPageProxy()->drawingArea();
+ DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
if (!drawingArea)
return;
@@ -273,13 +272,13 @@
drawingArea->setVisibleContentsRectAndScale(alignedVisibleContentRect, scale);
// FIXME: Once we support suspend and resume, this should be delayed until the page is active if the page is suspended.
- webPageProxy()->setFixedVisibleContentRect(alignedVisibleContentRect);
+ webPageProxy->setFixedVisibleContentRect(alignedVisibleContentRect);
q->m_experimental->viewportInfo()->didUpdateCurrentScale();
}
void QQuickWebViewPrivate::_q_viewportTrajectoryVectorChanged(const QPointF& trajectoryVector)
{
- DrawingAreaProxy* drawingArea = webPageProxy()->drawingArea();
+ DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
if (!drawingArea)
return;
drawingArea->setVisibleContentRectTrajectoryVector(trajectoryVector);
@@ -287,7 +286,7 @@
void QQuickWebViewPrivate::_q_onVisibleChanged()
{
- webPageProxy()->viewStateDidChange(WebPageProxy::ViewIsVisible);
+ webPageProxy->viewStateDidChange(WebPageProxy::ViewIsVisible);
}
void QQuickWebViewPrivate::_q_onReceivedResponseFromDownload(QWebDownloadItem* downloadItem)
@@ -311,7 +310,7 @@
// Let the WebProcess know about the new viewport size, so that
// it can resize the content accordingly.
- webPageProxy()->setViewportSize(viewportSize);
+ webPageProxy->setViewportSize(viewportSize);
interactionEngine->applyConstraints(computeViewportConstraints());
updateVisibleContentRectAndScale();
@@ -344,7 +343,7 @@
if (availableSize.isEmpty())
return newConstraints;
- WebPreferences* wkPrefs = webPageProxy()->pageGroup()->preferences();
+ WebPreferences* wkPrefs = webPageProxy->pageGroup()->preferences();
// FIXME: Remove later; Hardcode some values for now to make sure the DPI adjustment is being tested.
wkPrefs->setDeviceDPI(240);
@@ -480,7 +479,7 @@
// Do not guard, testing for the same value, as we call this from the constructor.
- webPageProxy()->setUseFixedLayout(!enable);
+ webPageProxy->setUseFixedLayout(!enable);
useTraditionalDesktopBehaviour = enable;
if (useTraditionalDesktopBehaviour)
@@ -506,15 +505,9 @@
ASSERT(enabled != m_navigatorQtObjectEnabled);
// FIXME: Currently we have to keep this information in both processes and the setting is asynchronous.
m_navigatorQtObjectEnabled = enabled;
- context->setNavigatorQtObjectEnabled(webPageProxy(), enabled);
+ context->setNavigatorQtObjectEnabled(webPageProxy.get(), enabled);
}
-// FIXME: Remove this once QtWebPageProxy is removed.
-WebKit::WebPageProxy* QQuickWebViewPrivate::webPageProxy() const
-{
- return toImpl(pageProxy->pageRef());
-}
-
WebCore::IntSize QQuickWebViewPrivate::viewSize() const
{
return WebCore::IntSize(pageView->width(), pageView->height());
@@ -540,11 +533,6 @@
The request object cannot be used after the signal handler function ends.
*/
-void QQuickWebViewPrivate::setPageProxy(QtWebPageProxy* pageProxy)
-{
- this->pageProxy.reset(pageProxy);
-}
-
QQuickWebViewAttached::QQuickWebViewAttached(QObject* object)
: QObject(object)
, m_view(0)
@@ -585,7 +573,7 @@
void QQuickWebViewExperimental::postMessage(const QString& message)
{
Q_D(QQuickWebView);
- d->context->postMessageToNavigatorQtObject(d->webPageProxy(), message);
+ d->context->postMessageToNavigatorQtObject(d->webPageProxy.get(), message);
}
QDeclarativeComponent* QQuickWebViewExperimental::alertDialog() const
@@ -706,38 +694,38 @@
void QQuickWebView::load(const QUrl& url)
{
Q_D(QQuickWebView);
- d->webPageProxy()->loadURL(url.toString());
+ d->webPageProxy->loadURL(url.toString());
}
void QQuickWebView::goBack()
{
Q_D(QQuickWebView);
- d->webPageProxy()->goBack();
+ d->webPageProxy->goBack();
}
void QQuickWebView::goForward()
{
Q_D(QQuickWebView);
- d->webPageProxy()->goForward();
+ d->webPageProxy->goForward();
}
void QQuickWebView::stop()
{
Q_D(QQuickWebView);
- d->webPageProxy()->stopLoading();
+ d->webPageProxy->stopLoading();
}
void QQuickWebView::reload()
{
Q_D(QQuickWebView);
const bool reloadFromOrigin = true;
- d->webPageProxy()->reload(reloadFromOrigin);
+ d->webPageProxy->reload(reloadFromOrigin);
}
QUrl QQuickWebView::url() const
{
Q_D(const QQuickWebView);
- RefPtr<WebFrameProxy> mainFrame = d->webPageProxy()->mainFrame();
+ RefPtr<WebFrameProxy> mainFrame = d->webPageProxy->mainFrame();
if (!mainFrame)
return QUrl();
return QUrl(QString(mainFrame->url()));
@@ -752,35 +740,35 @@
bool QQuickWebView::canGoBack() const
{
Q_D(const QQuickWebView);
- return d->webPageProxy()->canGoBack();
+ return d->webPageProxy->canGoBack();
}
bool QQuickWebView::canGoForward() const
{
Q_D(const QQuickWebView);
- return d->webPageProxy()->canGoForward();
+ return d->webPageProxy->canGoForward();
}
bool QQuickWebView::loading() const
{
Q_D(const QQuickWebView);
- RefPtr<WebKit::WebFrameProxy> mainFrame = d->webPageProxy()->mainFrame();
+ RefPtr<WebKit::WebFrameProxy> mainFrame = d->webPageProxy->mainFrame();
return mainFrame && !(WebFrameProxy::LoadStateFinished == mainFrame->loadState());
}
bool QQuickWebView::canReload() const
{
Q_D(const QQuickWebView);
- RefPtr<WebKit::WebFrameProxy> mainFrame = d->webPageProxy()->mainFrame();
+ RefPtr<WebKit::WebFrameProxy> mainFrame = d->webPageProxy->mainFrame();
if (mainFrame)
return (WebFrameProxy::LoadStateFinished == mainFrame->loadState());
- return d->webPageProxy()->backForwardList()->currentItem();
+ return d->webPageProxy->backForwardList()->currentItem();
}
QString QQuickWebView::title() const
{
Q_D(const QQuickWebView);
- return d->webPageProxy()->pageTitle();
+ return d->webPageProxy->pageTitle();
}
QWebPreferences* QQuickWebView::preferences() const
@@ -835,7 +823,7 @@
WKPageRef QQuickWebView::pageRef() const
{
Q_D(const QQuickWebView);
- return d->pageProxy->pageRef();
+ return toAPI(d->webPageProxy.get());
}
/*!
@@ -849,7 +837,7 @@
void QQuickWebView::loadHtml(const QString& html, const QUrl& baseUrl)
{
Q_D(QQuickWebView);
- d->webPageProxy()->loadHTMLString(html, baseUrl.toString());
+ d->webPageProxy->loadHTMLString(html, baseUrl.toString());
}
#include "moc_qquickwebview_p.cpp"
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -141,7 +141,6 @@
friend class QtWebPageLoadClient;
friend class QtWebPagePolicyClient;
- friend class QtWebPageProxy;
friend class QtWebPageUIClient;
friend class WTR::PlatformWebView;
friend class QQuickWebViewExperimental;
@@ -215,7 +214,6 @@
QQuickWebViewPrivate* d_ptr;
QWebViewportInfo* m_viewportInfo;
- friend class QtWebPageProxy;
friend class QtWebPageUIClient;
Q_DECLARE_PRIVATE(QQuickWebView)
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebview_p_p.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -26,9 +26,9 @@
#include "QtViewportInteractionEngine.h"
#include "QtWebPageLoadClient.h"
#include "QtWebPagePolicyClient.h"
-#include "QtWebPageProxy.h"
#include "QtWebPageUIClient.h"
#include "QtWebUndoController.h"
+#include "WebPageProxy.h"
#include "qquickwebview_p.h"
#include "qquickwebpage_p.h"
@@ -43,7 +43,6 @@
class QtWebContext;
class WebPageProxy;
}
-class QtWebPageProxy;
class QWebNavigationHistory;
class QWebViewportInfo;
@@ -56,6 +55,7 @@
Q_DECLARE_PUBLIC(QQuickWebView)
friend class QQuickWebViewExperimental;
friend class QQuickWebPage;
+ friend class QWebPreferencesPrivate;
friend class QWebViewportInfo;
public:
@@ -65,7 +65,6 @@
virtual ~QQuickWebViewPrivate();
void initialize(WKContextRef contextRef = 0, WKPageGroupRef pageGroupRef = 0);
- void setPageProxy(QtWebPageProxy*);
void initializeTouch(QQuickWebView* viewport);
void initializeDesktop(QQuickWebView* viewport);
@@ -102,8 +101,6 @@
bool navigatorQtObjectEnabled() const;
void setNavigatorQtObjectEnabled(bool);
- WebKit::WebPageProxy* webPageProxy() const;
-
// PageClient.
WebCore::IntSize viewSize() const;
void didReceiveMessageFromNavigatorQtObject(const String& message);
@@ -132,6 +129,7 @@
};
RefPtr<QtWebContext> context;
+ RefPtr<WebKit::WebPageProxy> webPageProxy;
QtPageClient pageClient;
QtWebUndoController undoController;
@@ -146,7 +144,6 @@
QScopedPointer<QtViewportInteractionEngine> interactionEngine;
QQuickWebView* q_ptr;
- QScopedPointer<QtWebPageProxy> pageProxy;
QDeclarativeComponent* alertDialog;
QDeclarativeComponent* confirmDialog;
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p_p.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p_p.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationhistory_p_p.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -40,7 +40,6 @@
class QWebNavigationHistory;
class QWebNavigationListModel;
-class QtWebPageProxy;
class QWebNavigationListModelPrivate {
public:
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebpreferences.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -394,7 +394,7 @@
WKPreferencesRef QWebPreferencesPrivate::preferencesRef() const
{
- WKPageGroupRef pageGroupRef = toAPI(webViewPrivate->webPageProxy()->pageGroup());
+ WKPageGroupRef pageGroupRef = toAPI(webViewPrivate->webPageProxy->pageGroup());
return WKPageGroupGetPreferences(pageGroupRef);
}
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -44,10 +44,6 @@
struct ViewportArguments;
}
-#if PLATFORM(QT)
-class QtWebPageProxy;
-#endif
-
namespace WebKit {
class DrawingAreaProxy;
Modified: trunk/Source/WebKit2/UIProcess/qt/QtPageClient.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/QtPageClient.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/QtPageClient.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -22,7 +22,6 @@
#include "QtPageClient.h"
#include "QtWebPageEventHandler.h"
-#include "QtWebPageProxy.h"
#include "QtWebUndoController.h"
#include "WebContextMenuProxyQt.h"
#include "WebEditCommandProxy.h"
@@ -40,7 +39,6 @@
QtPageClient::QtPageClient()
: m_webView(0)
- , m_qtWebPageProxy(0)
, m_eventHandler(0)
, m_undoController(0)
{
@@ -50,6 +48,13 @@
{
}
+void QtPageClient::initialize(QQuickWebView* webView, QtWebPageEventHandler* eventHandler, QtWebUndoController* undoController)
+{
+ m_webView = webView;
+ m_eventHandler = eventHandler;
+ m_undoController = undoController;
+}
+
PassOwnPtr<DrawingAreaProxy> QtPageClient::createDrawingAreaProxy()
{
return QQuickWebViewPrivate::get(m_webView)->createDrawingAreaProxy();
@@ -153,12 +158,12 @@
PassRefPtr<WebPopupMenuProxy> QtPageClient::createPopupMenuProxy(WebPageProxy* webPageProxy)
{
- return WebPopupMenuProxyQt::create(toImpl(m_qtWebPageProxy->pageRef()), m_webView);
+ return WebPopupMenuProxyQt::create(webPageProxy, m_webView);
}
-PassRefPtr<WebContextMenuProxy> QtPageClient::createContextMenuProxy(WebPageProxy*)
+PassRefPtr<WebContextMenuProxy> QtPageClient::createContextMenuProxy(WebPageProxy* webPageProxy)
{
- return WebContextMenuProxyQt::create(m_qtWebPageProxy);
+ return WebContextMenuProxyQt::create(webPageProxy);
}
void QtPageClient::flashBackingStoreUpdates(const Vector<IntRect>&)
Modified: trunk/Source/WebKit2/UIProcess/qt/QtPageClient.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/QtPageClient.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/QtPageClient.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -38,6 +38,8 @@
QtPageClient();
~QtPageClient();
+ void initialize(QQuickWebView*, QtWebPageEventHandler*, QtWebUndoController*);
+
// QQuickWebView.
virtual void setViewNeedsDisplay(const WebCore::IntRect&);
virtual WebCore::IntSize viewSize();
@@ -95,17 +97,8 @@
virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
#endif
- void initialize(QQuickWebView* webView, QtWebPageProxy* pageProxy, QtWebPageEventHandler* eventHandler, QtWebUndoController* undoController)
- {
- m_webView = webView;
- m_eventHandler = eventHandler;
- m_qtWebPageProxy = pageProxy;
- m_undoController = undoController;
- }
-
private:
QQuickWebView* m_webView;
- QtWebPageProxy* m_qtWebPageProxy;
QtWebPageEventHandler* m_eventHandler;
QtWebUndoController* m_undoController;
};
Deleted: trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 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 program 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 program; 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 "QtWebPageProxy.h"
-
-#include <QtQuick/qquickcanvas.h>
-#include "qquickwebview_p.h"
-#include "qquickwebview_p_p.h"
-
-#include "QtPageClient.h"
-#include "QtWebContext.h"
-#include "WebBackForwardList.h"
-#include "WKStringQt.h"
-#include <WebKit2/WKFrame.h>
-#include <WebKit2/WKPageGroup.h>
-#include <WebKit2/WKRetainPtr.h>
-
-using namespace WebKit;
-using namespace WebCore;
-
-QtWebPageProxy::QtWebPageProxy(QQuickWebView* qmlWebView, QtPageClient *pageClient, PassRefPtr<QtWebContext> context, WKPageGroupRef pageGroupRef)
- : m_qmlWebView(qmlWebView)
- , m_context(context)
-{
- m_webPageProxy = m_context->createWebPage(pageClient, toImpl(pageGroupRef));
-}
-
-void QtWebPageProxy::init()
-{
- m_webPageProxy->initializeWebPage();
-}
-
-QtWebPageProxy::~QtWebPageProxy()
-{
- m_webPageProxy->close();
-}
-
-void QtWebPageProxy::showContextMenu(QSharedPointer<QMenu> menu)
-{
- // Remove the active menu in case this function is called twice.
- if (activeMenu)
- activeMenu->hide();
-
- if (menu->isEmpty())
- return;
-
- QWindow* window = m_qmlWebView->canvas();
- if (!window)
- return;
-
- activeMenu = menu;
-
- activeMenu->window()->winId(); // Ensure that the menu has a window
- Q_ASSERT(activeMenu->window()->windowHandle());
- activeMenu->window()->windowHandle()->setTransientParent(window);
-
- QPoint menuPositionInScene = m_qmlWebView->mapToScene(menu->pos()).toPoint();
- menu->exec(window->mapToGlobal(menuPositionInScene));
- // The last function to get out of exec() clear the local copy.
- if (activeMenu == menu)
- activeMenu.clear();
-}
-
-void QtWebPageProxy::hideContextMenu()
-{
- if (activeMenu)
- activeMenu->hide();
-}
-
-WKPageRef QtWebPageProxy::pageRef() const
-{
- return toAPI(m_webPageProxy.get());;
-}
-
-void QtWebPageProxy::setCustomUserAgent(const QString& userAgent)
-{
- WKRetainPtr<WKStringRef> wkUserAgent(WKStringCreateWithQString(userAgent));
- WKPageSetCustomUserAgent(pageRef(), wkUserAgent.get());
-}
-
-QString QtWebPageProxy::customUserAgent() const
-{
- return WKStringCopyQString(WKPageCopyCustomUserAgent(pageRef()));
-}
-
-qreal QtWebPageProxy::textZoomFactor() const
-{
- return WKPageGetTextZoomFactor(pageRef());
-}
-
-void QtWebPageProxy::setTextZoomFactor(qreal zoomFactor)
-{
- WKPageSetTextZoomFactor(pageRef(), zoomFactor);
-}
-
-qreal QtWebPageProxy::pageZoomFactor() const
-{
- return WKPageGetPageZoomFactor(pageRef());
-}
-
-void QtWebPageProxy::setPageZoomFactor(qreal zoomFactor)
-{
- WKPageSetPageZoomFactor(pageRef(), zoomFactor);
-}
-
-void QtWebPageProxy::setPageAndTextZoomFactors(qreal pageZoomFactor, qreal textZoomFactor)
-{
- WKPageSetPageAndTextZoomFactors(pageRef(), pageZoomFactor, textZoomFactor);
-}
-
-#include "moc_QtWebPageProxy.cpp"
Deleted: trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/QtWebPageProxy.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2010, 2011 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 program 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 program; 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 QtWebPageProxy_h
-#define QtWebPageProxy_h
-
-#include "WebPageProxy.h"
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
-#include <QMenu>
-#include <QSharedPointer>
-
-class QtPageClient;
-class QQuickWebView;
-
-namespace WebKit {
-class QtWebContext;
-}
-
-using namespace WebKit;
-
-// FIXME: needs focus in/out, window activation, support through viewStateDidChange().
-class QtWebPageProxy : public QObject {
- Q_OBJECT
-
-public:
- QtWebPageProxy(QQuickWebView*, QtPageClient*, PassRefPtr<QtWebContext>, WKPageGroupRef = 0);
- ~QtWebPageProxy();
-
- WKPageRef pageRef() const;
-
- void setCustomUserAgent(const QString&);
- QString customUserAgent() const;
-
- qreal textZoomFactor() const;
- qreal pageZoomFactor() const;
- void setTextZoomFactor(qreal zoomFactor);
- void setPageZoomFactor(qreal zoomFactor);
- void setPageAndTextZoomFactors(qreal pageZoomFactor, qreal textZoomFactor);
-
- void contextMenuItemSelected(const WebContextMenuItemData& data)
- {
- m_webPageProxy->contextMenuItemSelected(data);
- }
-
- void init();
-
- void showContextMenu(QSharedPointer<QMenu>);
- void hideContextMenu();
-
-public:
- Q_SIGNAL void zoomableAreaFound(const QRect&);
-
-protected:
- QQuickWebView* m_qmlWebView;
- RefPtr<WebKit::WebPageProxy> m_webPageProxy;
-
-private:
- RefPtr<QtWebContext> m_context;
-
- QSharedPointer<QMenu> activeMenu;
-};
-
-#endif /* QtWebPageProxy_h */
Modified: trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.cpp 2011-12-15 14:09:48 UTC (rev 102932)
@@ -27,61 +27,27 @@
#include "config.h"
#include "WebContextMenuProxyQt.h"
-#include <IntPoint.h>
-#include <OwnPtr.h>
-#include <WebContextMenuItemData.h>
-#include <qmenu.h>
-#include <QtWebPageProxy.h>
-
using namespace WebCore;
-Q_DECLARE_METATYPE(WebKit::WebContextMenuItemData);
-
namespace WebKit {
-WebContextMenuProxyQt::WebContextMenuProxyQt(QtWebPageProxy* pageProxy)
- : m_webPageProxy(pageProxy)
+WebContextMenuProxyQt::WebContextMenuProxyQt(WebPageProxy*)
{
}
-PassRefPtr<WebContextMenuProxyQt> WebContextMenuProxyQt::create(QtWebPageProxy *pageProxy)
+PassRefPtr<WebContextMenuProxyQt> WebContextMenuProxyQt::create(WebPageProxy* webPageProxy)
{
- return adoptRef(new WebContextMenuProxyQt(pageProxy));
+ return adoptRef(new WebContextMenuProxyQt(webPageProxy));
}
-void WebContextMenuProxyQt::actionTriggered(bool)
-{
- QAction* qtAction = qobject_cast<QAction*>(sender());
- if (!qtAction) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- QVariant data = ""
- if (!data.canConvert<WebContextMenuItemData>()) {
- ASSERT_NOT_REACHED();
- return;
- }
-
- m_webPageProxy->contextMenuItemSelected(qtAction->data().value<WebContextMenuItemData>());
-}
-
void WebContextMenuProxyQt::showContextMenu(const IntPoint& position, const Vector<WebContextMenuItemData>& items)
{
- // FIXME: Make this a QML compatible context menu.
}
void WebContextMenuProxyQt::hideContextMenu()
{
- m_webPageProxy->hideContextMenu();
}
-PassOwnPtr<QMenu> WebContextMenuProxyQt::createContextMenu(const Vector<WebContextMenuItemData>& items) const
-{
- // FIXME: Make this a QML compatible context menu.
- return nullptr;
-}
-
#include "moc_WebContextMenuProxyQt.cpp"
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h (102931 => 102932)
--- trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h 2011-12-15 13:45:56 UTC (rev 102931)
+++ trunk/Source/WebKit2/UIProcess/qt/WebContextMenuProxyQt.h 2011-12-15 14:09:48 UTC (rev 102932)
@@ -28,36 +28,22 @@
#define WebContextMenuProxyQt_h
#include "WebContextMenuProxy.h"
-#include <PassOwnPtr.h>
#include <QtCore/QObject>
-class QMenu;
-class QtWebPageProxy;
-
namespace WebKit {
-class WebContextMenuItemData;
-}
-class QtWebPageProxy;
-namespace WebKit {
+class WebPageProxy;
class WebContextMenuProxyQt : public QObject, public WebContextMenuProxy {
Q_OBJECT
public:
- static PassRefPtr<WebContextMenuProxyQt> create(QtWebPageProxy*);
+ static PassRefPtr<WebContextMenuProxyQt> create(WebPageProxy*);
-private Q_SLOTS:
- void actionTriggered(bool);
-
private:
- WebContextMenuProxyQt(QtWebPageProxy*);
+ WebContextMenuProxyQt(WebPageProxy*);
virtual void showContextMenu(const WebCore::IntPoint&, const Vector<WebContextMenuItemData>&);
virtual void hideContextMenu();
-
- PassOwnPtr<QMenu> createContextMenu(const Vector<WebContextMenuItemData>& items) const;
-
- QtWebPageProxy* const m_webPageProxy;
};
} // namespace WebKit