diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-03-03 17:28:52 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2016-03-31 07:40:15 +0000 |
commit | 0a4b9df53f0ede439435b0408558e1038c619a67 (patch) | |
tree | 0c285ad9a68f90257d013e2df7996ac45b1b4bae /examples/webenginewidgets/demobrowser/browserapplication.cpp | |
parent | 76c61aa1400ef2def204c3732e30e08e40631e8d (diff) | |
download | qtwebengine-0a4b9df53f0ede439435b0408558e1038c619a67.tar.gz |
Add icon property and iconChanged signal to QWebEnginePage
The new API makes possible to access downloaded icons via
QWebEnginePage. Thus the QNAM usage for downloading favicons and the
corresponding workaround due to authentication are removed from the
demobrowser.
Change-Id: I9fdcc7ee7673f7caa239d932f20a51c74b24763f
Task-number: QTBUG-51179
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'examples/webenginewidgets/demobrowser/browserapplication.cpp')
-rw-r--r-- | examples/webenginewidgets/demobrowser/browserapplication.cpp | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/examples/webenginewidgets/demobrowser/browserapplication.cpp b/examples/webenginewidgets/demobrowser/browserapplication.cpp index 027a7d148..0d5c54199 100644 --- a/examples/webenginewidgets/demobrowser/browserapplication.cpp +++ b/examples/webenginewidgets/demobrowser/browserapplication.cpp @@ -72,7 +72,6 @@ #include <QtNetwork/QLocalServer> #include <QtNetwork/QLocalSocket> #include <QtNetwork/QNetworkProxy> -#include <QtNetwork/QNetworkReply> #include <QtNetwork/QSslSocket> #include <QWebEngineProfile> @@ -515,10 +514,6 @@ QNetworkAccessManager *BrowserApplication::networkAccessManager() { if (!s_networkAccessManager) { s_networkAccessManager = new QNetworkAccessManager(); - connect(s_networkAccessManager, &QNetworkAccessManager::authenticationRequired, - BrowserApplication::instance(), &BrowserApplication::authenticationRequired); - connect(s_networkAccessManager, &QNetworkAccessManager::proxyAuthenticationRequired, - BrowserApplication::instance(), &BrowserApplication::proxyAuthenticationRequired); } return s_networkAccessManager; } @@ -577,68 +572,3 @@ void BrowserApplication::setPrivateBrowsing(bool privateBrowsing) } emit privateBrowsingChanged(privateBrowsing); } - -void BrowserApplication::setLastAuthenticator(QAuthenticator *authenticator) -{ - m_lastAuthenticator = QAuthenticator(*authenticator); -} - -void BrowserApplication::setLastProxyAuthenticator(QAuthenticator *authenticator) -{ - m_lastProxyAuthenticator = QAuthenticator(*authenticator); -} - -void BrowserApplication::authenticationRequired(QNetworkReply *reply, QAuthenticator *authenticator) -{ - if (m_lastAuthenticator.isNull()) - return; - - - Q_ASSERT(m_lastAuthenticator.option("key").isValid()); - QByteArray lastKey = m_lastAuthenticator.option("key").toByteArray(); - QByteArray key = BrowserApplication::authenticationKey(reply->url(), authenticator->realm()); - - if (lastKey == key) - *authenticator = m_lastAuthenticator; -} - -void BrowserApplication::proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *authenticator) -{ - if (m_lastProxyAuthenticator.isNull()) - return; - - QNetworkProxy::ProxyType proxyType = proxy.type(); - if (proxyType != QNetworkProxy::HttpProxy || proxyType != QNetworkProxy::HttpCachingProxy) - return; - - Q_ASSERT(m_lastProxyAuthenticator.option("host").isValid()); - QByteArray lastKey = m_lastProxyAuthenticator.option("key").toByteArray(); - QByteArray key = BrowserApplication::proxyAuthenticationKey(proxy, authenticator->realm()); - - if (lastKey == key) - *authenticator = m_lastAuthenticator; -} - -// TODO: Remove these functions (QTBUG-47967) -QByteArray BrowserApplication::authenticationKey(const QUrl &url, const QString &realm) -{ - QUrl copy = url; - copy.setFragment(realm); - return "auth:" + copy.toEncoded(QUrl::RemovePassword | QUrl::RemovePath | QUrl::RemoveQuery); -} - -QByteArray BrowserApplication::proxyAuthenticationKey(const QNetworkProxy &proxy, const QString &realm) -{ - QString host = QString("%1:%2").arg(proxy.hostName()).arg(proxy.port()); - return BrowserApplication::proxyAuthenticationKey(proxy.user(), host, realm); -} - -QByteArray BrowserApplication::proxyAuthenticationKey(const QString &user, const QString &host, const QString &realm) -{ - QUrl key; - key.setScheme(QLatin1String("proxy-http")); - key.setUserName(user); - key.setHost(host); - key.setFragment(realm); - return "auth:" + key.toEncoded(); -} |