summaryrefslogtreecommitdiffstats
path: root/examples/webenginewidgets/demobrowser/browserapplication.h
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2015-08-18 16:15:25 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2015-09-08 09:15:26 +0000
commit95d5240475c2c88908a1df23453efa05ed64dd34 (patch)
tree1f6d2d33cdae00fd35779ad888d76bc47af8b11e /examples/webenginewidgets/demobrowser/browserapplication.h
parentb715310a4fdc2a5e215c99bae042cd820e9a1e27 (diff)
Fix favicon load after authentication in browser example
In the widget browser example QNetworkAccessManager downloads the favicon for a webpage. In case of HTTP or proxy authentication the credentials may not be cached when QNetworkAccessManager tries to load the favicon. Therefore, store last credentials and provide it to QNetworkAccessManager when it emits authenticationRequired signal. Change-Id: I2d057bfa7291a13cec30db9debaf30382415122b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'examples/webenginewidgets/demobrowser/browserapplication.h')
-rw-r--r--examples/webenginewidgets/demobrowser/browserapplication.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/webenginewidgets/demobrowser/browserapplication.h b/examples/webenginewidgets/demobrowser/browserapplication.h
index dd3045bc9..75ae57c64 100644
--- a/examples/webenginewidgets/demobrowser/browserapplication.h
+++ b/examples/webenginewidgets/demobrowser/browserapplication.h
@@ -49,9 +49,13 @@
#include <QtGui/QIcon>
+#include <QtNetwork/QAuthenticator>
+
QT_BEGIN_NAMESPACE
class QLocalServer;
class QNetworkAccessManager;
+class QNetworkProxy;
+class QNetworkReply;
class QWebEngineProfile;
QT_END_NAMESPACE
@@ -80,6 +84,14 @@ public:
bool canRestoreSession() const;
bool privateBrowsing() const { return m_privateBrowsing; }
+ void setLastAuthenticator(QAuthenticator *);
+ void setLastProxyAuthenticator(QAuthenticator *);
+
+ // TODO: Remove these functions (QTBUG-47967)
+ static QByteArray authenticationKey(const QUrl &, const QString &);
+ static QByteArray proxyAuthenticationKey(const QNetworkProxy &, const QString &);
+ static QByteArray proxyAuthenticationKey(const QString &, const QString &, const QString &);
+
static HistoryManager *historyManager();
static CookieJar *cookieJar();
static DownloadManager *downloadManager();
@@ -96,6 +108,8 @@ public slots:
void lastWindowClosed();
void quitBrowser();
void setPrivateBrowsing(bool);
+ void authenticationRequired(QNetworkReply *, QAuthenticator *);
+ void proxyAuthenticationRequired(const QNetworkProxy &, QAuthenticator *);
signals:
void privateBrowsingChanged(bool);
@@ -120,6 +134,9 @@ private:
QWebEngineProfile *m_privateProfile;
bool m_privateBrowsing;
mutable QIcon m_defaultIcon;
+
+ QAuthenticator m_lastAuthenticator;
+ QAuthenticator m_lastProxyAuthenticator;
};
#endif // BROWSERAPPLICATION_H