Diff
Modified: trunk/Source/WebKit2/ChangeLog (92372 => 92373)
--- trunk/Source/WebKit2/ChangeLog 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-04 14:57:04 UTC (rev 92373)
@@ -1,3 +1,59 @@
+2011-08-04 Alexis Menard <[email protected]>
+
+ [Qt] Make navigation actions properly usable in QML.
+ https://bugs.webkit.org/show_bug.cgi?id=65624
+
+ Add a new class that is exposed in QML to control the navigation
+ like reload/stop/back/forward. Enums are not very QML friendly,
+ it not possible to use enums that are not declared in the same class
+ than the object exposed in QML, therefore it makes hard the sharing
+ between the desktop and the touch views. In addition namespaced enums are
+ even harder to support in QML. QWebNavigationController is
+ not really meant to be used in C++ but it is exported for convenience
+ reason (tests and MiniBrowser) so its API is not meant to be public but
+ exposed in QML through properties and convenience slots. The QML code to use
+ the navigation action in QML will look like "desktopView.navigation.reload();"
+ or "if (desktopView.navigation.reloadAction.enabled) ...".
+
+ Reviewed by Benjamin Poulain.
+
+ * UIProcess/API/qt/WKView.h: To get the forward header generated
+ * UIProcess/API/qt/qdesktopwebview.cpp:
+ (QDesktopWebViewPrivate::QDesktopWebViewPrivate):
+ (QDesktopWebView::navigationController):
+ * UIProcess/API/qt/qdesktopwebview.h:
+ * UIProcess/API/qt/qdesktopwebview_p.h:
+ * UIProcess/API/qt/qmlplugin/plugin.cpp:
+ (WebKit2QmlPlugin::registerTypes):
+ * UIProcess/API/qt/qtouchwebpage.cpp:
+ (QTouchWebPage::navigationController):
+ (QTouchWebPagePrivate::QTouchWebPagePrivate):
+ * UIProcess/API/qt/qtouchwebpage.h:
+ * UIProcess/API/qt/qtouchwebpage_p.h:
+ * UIProcess/API/qt/qwebnavigationcontroller.cpp: Added.
+ (QWebNavigationControllerPrivate::QWebNavigationControllerPrivate):
+ (QWebNavigationController::QWebNavigationController):
+ (QWebNavigationController::~QWebNavigationController):
+ (QWebNavigationController::backAction):
+ (QWebNavigationController::forwardAction):
+ (QWebNavigationController::stopAction):
+ (QWebNavigationController::reloadAction):
+ (QWebNavigationController::navigationAction):
+ (QWebNavigationController::back):
+ (QWebNavigationController::forward):
+ (QWebNavigationController::stop):
+ (QWebNavigationController::reload):
+ * UIProcess/API/qt/qwebnavigationcontroller.h: Added.
+ * UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp:
+ (WebViewAbstraction::triggerNavigationAction):
+ * UIProcess/API/qt/tests/qdesktopwebview/tst_qdesktopwebview.cpp:
+ (tst_QDesktopWebView::navigationActionsStatusAtStartup):
+ (LoadStartedCatcher::onLoadStarted):
+ (tst_QDesktopWebView::stopActionEnabledAfterLoadStarted):
+ * UIProcess/API/qt/tests/qtouchwebview/tst_qtouchwebview.cpp:
+ (tst_QTouchWebView::navigationActionsStatusAtStartup):
+ * WebKit2API.pri:
+
2011-08-03 Jeff Miller <[email protected]>
Use of AVFoundation should default to off on Windows
Modified: trunk/Source/WebKit2/UIProcess/API/qt/WKView.h (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/WKView.h 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/WKView.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -24,5 +24,6 @@
#include <WebKit2/qdesktopwebview.h>
#include <WebKit2/qtouchwebview.h>
#include <WebKit2/qtouchwebpage.h>
+#include <WebKit2/qwebnavigationcontroller.h>
#endif /* WKView_h */
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -41,6 +41,7 @@
: q(q)
, page(this, contextRef ? new QWKContext(contextRef) : defaultWKContext(), pageGroupRef)
, isCrashed(false)
+ , navigationController(0)
{
}
@@ -209,9 +210,11 @@
return d->page.title();
}
-QAction* QDesktopWebView::navigationAction(QtWebKit::NavigationAction which) const
+QWebNavigationController* QDesktopWebView::navigationController() const
{
- return d->page.navigationAction(which);
+ if (!d->navigationController)
+ d->navigationController = new QWebNavigationController(&d->page);
+ return d->navigationController;
}
static void paintCrashedPage(QPainter* painter, const QRectF& rect)
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -29,6 +29,7 @@
class QDesktopWebViewPrivate;
class QWebError;
+class QWebNavigationController;
QT_BEGIN_NAMESPACE
class QFocusEvent;
@@ -52,11 +53,9 @@
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged)
+ Q_PROPERTY(QWebNavigationController* navigation READ navigationController CONSTANT)
- Q_ENUMS(NavigationAction)
-
public:
-
QDesktopWebView(QSGItem* parent = 0);
virtual ~QDesktopWebView();
@@ -64,7 +63,7 @@
QString title() const;
int loadProgress() const;
- Q_INVOKABLE QAction* navigationAction(QtWebKit::NavigationAction which) const;
+ QWebNavigationController* navigationController() const;
public Q_SLOTS:
void load(const QUrl&);
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -22,6 +22,7 @@
#define qdesktopwebview_p_h
#include "qdesktopwebpageproxy.h"
+#include "qwebnavigationcontroller.h"
#include "ViewInterface.h"
class QDesktopWebView;
@@ -37,6 +38,7 @@
QDesktopWebPageProxy page;
bool isCrashed;
+ QWebNavigationController* navigationController;
private:
/* Implementation of ViewInterface */
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qmlplugin/plugin.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qmlplugin/plugin.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qmlplugin/plugin.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -20,6 +20,7 @@
#include "qdesktopwebview.h"
#include "qtouchwebpage.h"
#include "qtouchwebview.h"
+#include "qwebnavigationcontroller.h"
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qdeclarativeextensionplugin.h>
@@ -34,6 +35,7 @@
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebKit.experimental"));
qmlRegisterType<QDesktopWebView>(uri, 5, 0, "DesktopWebView");
qmlRegisterType<QTouchWebView>(uri, 5, 0, "TouchWebView");
+ qmlRegisterUncreatableType<QWebNavigationController>(uri, 5, 0, "NavigationController", QObject::tr("Cannot create separate instance of NavigationController"));
qmlRegisterUncreatableType<QTouchWebPage>(uri, 5, 0, "TouchWebPage", QObject::tr("Cannot create separate instance of TouchWebPage, use TouchWebView"));
}
};
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -122,14 +122,17 @@
d->page->setDrawingAreaSize(newGeometry.size().toSize());
}
-QAction* QTouchWebPage::navigationAction(QtWebKit::NavigationAction which)
+QWebNavigationController* QTouchWebPage::navigationController() const
{
- return d->page->navigationAction(which);
+ if (!d->navigationController)
+ d->navigationController = new QWebNavigationController(d->page);
+ return d->navigationController;
}
QTouchWebPagePrivate::QTouchWebPagePrivate(QTouchWebPage* view)
: q(view)
, page(0)
+ , navigationController(0)
{
}
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -30,6 +30,7 @@
class QTouchWebPagePrivate;
class QTouchWebPageProxy;
class QWebError;
+class QWebNavigationController;
namespace WebKit {
class TouchViewInterface;
@@ -40,6 +41,7 @@
Q_PROPERTY(QString title READ title NOTIFY titleChanged)
Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged)
+ Q_PROPERTY(QWebNavigationController* navigation READ navigationController CONSTANT)
public:
QTouchWebPage(QSGItem* parent = 0);
@@ -52,7 +54,7 @@
Q_INVOKABLE QString title() const;
int loadProgress() const;
- QAction* navigationAction(QtWebKit::NavigationAction which);
+ QWebNavigationController* navigationController() const;
virtual void paint(QPainter*);
virtual bool event(QEvent*);
Modified: trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage_p.h (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage_p.h 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qtouchwebpage_p.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -23,6 +23,7 @@
#include <QMenu>
#include "qtouchwebpage.h"
+#include "qwebnavigationcontroller.h"
class QRectF;
class QString;
@@ -42,6 +43,7 @@
QTouchWebPage* const q;
QTouchWebPageProxy* page;
+ QWebNavigationController* navigationController;
};
#endif /* qtouchwebpage_p_h */
Added: trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.cpp (0 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 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 "qwebnavigationcontroller.h"
+
+#include "QtWebPageProxy.h"
+#include "qwebkittypes.h"
+
+class QWebNavigationControllerPrivate {
+public:
+ QWebNavigationControllerPrivate(QtWebPageProxy* pageProxy)
+ : pageProxy(pageProxy)
+ {
+ ASSERT(pageProxy);
+ }
+
+ QtWebPageProxy* pageProxy;
+};
+
+QWebNavigationController::QWebNavigationController(QtWebPageProxy* pageProxy)
+ : QObject(pageProxy)
+ , d(new QWebNavigationControllerPrivate(pageProxy))
+{
+}
+
+QWebNavigationController::~QWebNavigationController()
+{
+ delete d;
+}
+
+QAction* QWebNavigationController::backAction() const
+{
+ return d->pageProxy->navigationAction(QtWebKit::Back);
+}
+
+QAction* QWebNavigationController::forwardAction() const
+{
+ return d->pageProxy->navigationAction(QtWebKit::Forward);
+}
+
+QAction* QWebNavigationController::stopAction() const
+{
+ return d->pageProxy->navigationAction(QtWebKit::Stop);
+}
+
+QAction* QWebNavigationController::reloadAction() const
+{
+ return d->pageProxy->navigationAction(QtWebKit::Reload);
+}
+
+QAction* QWebNavigationController::navigationAction(QtWebKit::NavigationAction which) const
+{
+ return d->pageProxy->navigationAction(which);
+}
+
+void QWebNavigationController::back()
+{
+ d->pageProxy->navigationAction(QtWebKit::Back)->trigger();
+}
+
+void QWebNavigationController::forward()
+{
+ d->pageProxy->navigationAction(QtWebKit::Forward)->trigger();
+}
+
+void QWebNavigationController::stop()
+{
+ d->pageProxy->navigationAction(QtWebKit::Stop)->trigger();
+}
+
+void QWebNavigationController::reload()
+{
+ d->pageProxy->navigationAction(QtWebKit::Reload)->trigger();
+}
Added: trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.h (0 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.h 2011-08-04 14:57:04 UTC (rev 92373)
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 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 qwebnavigationcontroller_h
+#define qwebnavigationcontroller_h
+
+
+#include "qwebkitglobal.h"
+#include "qwebkittypes.h"
+#include <QtCore/QObject>
+
+QT_BEGIN_NAMESPACE
+class QAction;
+QT_END_NAMESPACE
+
+class QtWebPageProxy;
+class QWebNavigationControllerPrivate;
+
+class QWEBKIT_EXPORT QWebNavigationController : public QObject {
+ Q_OBJECT
+ Q_PROPERTY(QAction* backAction READ backAction CONSTANT)
+ Q_PROPERTY(QAction* forwardAction READ forwardAction CONSTANT)
+ Q_PROPERTY(QAction* stopAction READ stopAction CONSTANT)
+ Q_PROPERTY(QAction* reloadAction READ reloadAction CONSTANT)
+public:
+ QWebNavigationController(QtWebPageProxy*);
+ ~QWebNavigationController();
+
+ QAction* backAction() const;
+ QAction* forwardAction() const;
+ QAction* stopAction() const;
+ QAction* reloadAction() const;
+
+ QAction* navigationAction(QtWebKit::NavigationAction which) const;
+
+public slots:
+ void back();
+ void forward();
+ void stop();
+ void reload();
+
+private:
+ QWebNavigationControllerPrivate* d;
+};
+
+#endif // qwebnavigationcontroller_h
Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/commonviewtests/webviewabstraction.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -20,6 +20,7 @@
#include <QAction>
#include <QApplication>
#include <QDesktopWidget>
+#include <qwebnavigationcontroller.h>
#include "webviewabstraction.h"
WebViewAbstraction::WebViewAbstraction()
@@ -98,9 +99,9 @@
void WebViewAbstraction::triggerNavigationAction(QtWebKit::NavigationAction which)
{
- QAction* touchAction = touchWebView()->page()->navigationAction(which);
+ QAction* touchAction = touchWebView()->page()->navigationController()->navigationAction(which);
touchAction->trigger();
- QAction* desktopAction = desktopWebView()->navigationAction(which);
+ QAction* desktopAction = desktopWebView()->navigationController()->navigationAction(which);
desktopAction->trigger();
}
Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qdesktopwebview/tst_qdesktopwebview.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qdesktopwebview/tst_qdesktopwebview.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qdesktopwebview/tst_qdesktopwebview.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -21,6 +21,7 @@
#include <QScopedPointer>
#include <QtTest/QtTest>
#include <qdesktopwebview.h>
+#include <qwebnavigationcontroller.h>
#include "../testwindow.h"
#include "../util.h"
@@ -63,19 +64,19 @@
void tst_QDesktopWebView::navigationActionsStatusAtStartup()
{
- QAction* backAction = webView()->navigationAction(QtWebKit::Back);
+ QAction* backAction = webView()->navigationController()->backAction();
QVERIFY(backAction);
QCOMPARE(backAction->isEnabled(), false);
- QAction* forwardAction = webView()->navigationAction(QtWebKit::Forward);
+ QAction* forwardAction = webView()->navigationController()->forwardAction();
QVERIFY(forwardAction);
QCOMPARE(forwardAction->isEnabled(), false);
- QAction* stopAction = webView()->navigationAction(QtWebKit::Stop);
+ QAction* stopAction = webView()->navigationController()->stopAction();
QVERIFY(stopAction);
QCOMPARE(stopAction->isEnabled(), false);
- QAction* reloadAction = webView()->navigationAction(QtWebKit::Reload);
+ QAction* reloadAction = webView()->navigationController()->reloadAction();
QVERIFY(reloadAction);
QCOMPARE(reloadAction->isEnabled(), false);
}
@@ -94,7 +95,7 @@
{
QMetaObject::invokeMethod(this, "finished", Qt::QueuedConnection);
- QAction* stopAction = m_webView->navigationAction(QtWebKit::Stop);
+ QAction* stopAction = m_webView->navigationController()->stopAction();
QVERIFY(stopAction);
QCOMPARE(stopAction->isEnabled(), true);
}
@@ -108,7 +109,7 @@
void tst_QDesktopWebView::stopActionEnabledAfterLoadStarted()
{
- QAction* stopAction = webView()->navigationAction(QtWebKit::Stop);
+ QAction* stopAction = webView()->navigationController()->stopAction();
QVERIFY(stopAction);
QCOMPARE(stopAction->isEnabled(), false);
Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qtouchwebview/tst_qtouchwebview.cpp (92372 => 92373)
--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qtouchwebview/tst_qtouchwebview.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qtouchwebview/tst_qtouchwebview.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -21,6 +21,7 @@
#include <QtTest/QtTest>
#include <qtouchwebpage.h>
#include <qtouchwebview.h>
+#include <qwebnavigationcontroller.h>
#include "../testwindow.h"
#include "../util.h"
@@ -74,19 +75,19 @@
void tst_QTouchWebView::navigationActionsStatusAtStartup()
{
- QAction* backAction = webView()->page()->navigationAction(QtWebKit::Back);
+ QAction* backAction = webView()->page()->navigationController()->backAction();
QVERIFY(backAction);
QCOMPARE(backAction->isEnabled(), false);
- QAction* forwardAction = webView()->page()->navigationAction(QtWebKit::Forward);
+ QAction* forwardAction = webView()->page()->navigationController()->forwardAction();
QVERIFY(forwardAction);
QCOMPARE(forwardAction->isEnabled(), false);
- QAction* stopAction = webView()->page()->navigationAction(QtWebKit::Stop);
+ QAction* stopAction = webView()->page()->navigationController()->stopAction();
QVERIFY(stopAction);
QCOMPARE(stopAction->isEnabled(), false);
- QAction* reloadAction = webView()->page()->navigationAction(QtWebKit::Reload);
+ QAction* reloadAction = webView()->page()->navigationController()->reloadAction();
QVERIFY(reloadAction);
QCOMPARE(reloadAction->isEnabled(), false);
}
Modified: trunk/Source/WebKit2/WebKit2API.pri (92372 => 92373)
--- trunk/Source/WebKit2/WebKit2API.pri 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Source/WebKit2/WebKit2API.pri 2011-08-04 14:57:04 UTC (rev 92373)
@@ -49,6 +49,7 @@
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebpage.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qtouchwebview.cpp \
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror.cpp \
+ $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.cpp \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.cpp \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.cpp \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp \
@@ -131,6 +132,7 @@
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qweberror_p.h \
$$SOURCE_DIR/WebKit2/UIProcess/API/qt/qwebkittypes.h \
+ $$SOURCE_DIR/WebKit2/UIProcess/API/qt/qwebnavigationcontroller.h \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardList.h \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.h \
$$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h \
Modified: trunk/Tools/ChangeLog (92372 => 92373)
--- trunk/Tools/ChangeLog 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Tools/ChangeLog 2011-08-04 14:57:04 UTC (rev 92373)
@@ -1,3 +1,15 @@
+2011-08-04 Alexis Menard <[email protected]>
+
+ [Qt] Make navigation actions properly usable in QML.
+ https://bugs.webkit.org/show_bug.cgi?id=65624
+
+ Fix compilation after the introduction of QWebNavigationController.
+
+ Reviewed by Benjamin Poulain.
+
+ * MiniBrowser/qt/BrowserView.cpp:
+ (BrowserView::navigationAction):
+
2011-08-04 Adam Barth <[email protected]>
Another subtle bug due to lack of testing in main.js. :(
Modified: trunk/Tools/MiniBrowser/qt/BrowserView.cpp (92372 => 92373)
--- trunk/Tools/MiniBrowser/qt/BrowserView.cpp 2011-08-04 14:39:16 UTC (rev 92372)
+++ trunk/Tools/MiniBrowser/qt/BrowserView.cpp 2011-08-04 14:57:04 UTC (rev 92373)
@@ -34,6 +34,7 @@
#include <qdesktopwebview.h>
#include <qtouchwebview.h>
#include <qtouchwebpage.h>
+#include <qwebnavigationcontroller.h>
BrowserView::BrowserView(bool useTouchWebView, QWidget* parent)
: QSGCanvas(parent)
@@ -88,9 +89,9 @@
QAction* BrowserView::navigationAction(QtWebKit::NavigationAction which) const
{
if (desktopWebView())
- return desktopWebView()->navigationAction(which);
+ return desktopWebView()->navigationController()->navigationAction(which);
if (touchWebView())
- return touchWebView()->page()->navigationAction(which);
+ return touchWebView()->page()->navigationController()->navigationAction(which);
Q_ASSERT(false);
return 0;
}