Commit 7dfac699 authored by hausmann's avatar hausmann
Browse files

Use QWebNetworkRequest for QWebPage::navigationRequested.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@23494 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent d2860e09
......@@ -129,11 +129,23 @@ QWebNetworkRequest &QWebNetworkRequest::operator=(const QWebNetworkRequest &othe
return *this;
}
/*!
\internal
*/
QWebNetworkRequest::QWebNetworkRequest(QWebNetworkRequestPrivate *priv)
: d(new QWebNetworkRequestPrivate(*priv))
{
}
/*!
\internal
*/
QWebNetworkRequest::QWebNetworkRequest(const WebCore::ResourceRequest &request)
: d(new QWebNetworkRequestPrivate)
{
d->init(request);
}
QWebNetworkRequest::~QWebNetworkRequest()
{
delete d;
......
......@@ -35,6 +35,8 @@ class QWebObjectPluginConnector;
namespace WebCore {
class WebCoreHttp;
class ResourceRequest;
class FrameLoaderClientQt;
}
struct QWebNetworkRequestPrivate;
......@@ -49,6 +51,7 @@ public:
QWebNetworkRequest();
QWebNetworkRequest(const QWebNetworkRequest &other);
QWebNetworkRequest &operator=(const QWebNetworkRequest &other);
~QWebNetworkRequest();
......@@ -63,8 +66,11 @@ public:
private:
explicit QWebNetworkRequest(QWebNetworkRequestPrivate *priv);
QWebNetworkRequestPrivate *d;
explicit QWebNetworkRequest(const WebCore::ResourceRequest &request);
friend class QWebNetworkJob;
friend class WebCore::FrameLoaderClientQt;
QWebNetworkRequestPrivate *d;
};
class QWEBKIT_EXPORT QWebNetworkJob
......
......@@ -76,12 +76,12 @@ QWebPagePrivate::~QWebPagePrivate()
delete page;
}
QWebPage::NavigationRequestResponse QWebPagePrivate::navigationRequested(QWebFrame *frame, const QUrl &url, const QHttpRequestHeader &request, const QByteArray &postData)
QWebPage::NavigationRequestResponse QWebPagePrivate::navigationRequested(QWebFrame *frame, const QWebNetworkRequest &request)
{
if (insideOpenCall
&& frame == mainFrame)
return QWebPage::AcceptNavigationRequest;
return q->navigationRequested(frame, url, request, postData);
return q->navigationRequested(frame, request);
}
void QWebPagePrivate::createMainFrame()
......@@ -221,12 +221,9 @@ QWebPage *QWebPage::createWindow()
return 0;
}
QWebPage::NavigationRequestResponse QWebPage::navigationRequested(QWebFrame *frame, const QUrl &url, const QHttpRequestHeader &request, const QByteArray &postData)
QWebPage::NavigationRequestResponse QWebPage::navigationRequested(QWebFrame *frame, const QWebNetworkRequest &request)
{
Q_UNUSED(frame)
Q_UNUSED(url)
Q_UNUSED(request)
Q_UNUSED(postData)
return AcceptNavigationRequest;
}
......
......@@ -33,6 +33,7 @@ class QWebFrame;
class QUndoStack;
class QUrl;
class QHttpRequestHeader;
class QWebNetworkRequest;
class QWebPagePrivate;
class QWebFrameData;
......@@ -142,7 +143,7 @@ protected:
virtual QWebFrame *createFrame(QWebFrame *parentFrame, QWebFrameData *frameData);
virtual QWebPage *createWindow();
virtual NavigationRequestResponse navigationRequested(QWebFrame *frame, const QUrl &url, const QHttpRequestHeader &request, const QByteArray &postData);
virtual NavigationRequestResponse navigationRequested(QWebFrame *frame, const QWebNetworkRequest &request);
private:
friend class QWebFrame;
......
......@@ -61,7 +61,7 @@ public:
bool modified;
bool insideOpenCall;
QWebPage::NavigationRequestResponse navigationRequested(QWebFrame *frame, const QUrl &url, const QHttpRequestHeader &request, const QByteArray &postData);
QWebPage::NavigationRequestResponse navigationRequested(QWebFrame *frame, const QWebNetworkRequest &request);
};
#endif
2007-06-13 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
Use QWebNetworkRequest for QWebPage::navigationRequested.
* Api/qwebnetworkinterface.cpp:
* Api/qwebnetworkinterface.h:
* Api/qwebpage.cpp:
(QWebPagePrivate::navigationRequested):
(QWebPage::navigationRequested):
* Api/qwebpage.h:
* Api/qwebpage_p.h:
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
2007-06-13 Simon Hausmann <hausmann@kde.org>
Reviewed by Lars.
......
......@@ -811,11 +811,10 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
Q_ASSERT(!m_policyFunction);
m_policyFunction = function;
if (m_webFrame) {
QWebNetworkRequestPrivate r;
r.init(request);
QWebNetworkRequest r(request);
QWebPage *page = m_webFrame->page();
if (page->d->navigationRequested(m_webFrame, r.url, r.httpHeader, r.postData) == QWebPage::IgnoreNavigationRequest) {
if (page->d->navigationRequested(m_webFrame, r) == QWebPage::IgnoreNavigationRequest) {
slotCallPolicyFunction(PolicyIgnore);
return;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment