diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-24 16:36:50 +0100 |
commit | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (patch) | |
tree | b34b0daceb7c8e7fdde4b4ec43650ab7caadb0a9 /Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp | |
parent | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (diff) | |
download | qtwebkit-ad0d549d4cc13433f77c1ac8f0ab379c83d93f28.tar.gz |
Imported WebKit commit bb52bf3c0119e8a128cd93afe5572413a8617de9 (http://svn.webkit.org/repository/webkit/trunk@108790)
Diffstat (limited to 'Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp index f7e2b8514..16c642934 100644 --- a/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp +++ b/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp @@ -102,6 +102,39 @@ private: QString m_prefilledUsername; }; +class ProxyAuthenticationDialogContextObject : public QObject { + Q_OBJECT + Q_PROPERTY(QString hostname READ hostname CONSTANT) + Q_PROPERTY(quint16 port READ port CONSTANT) + Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT) + +public: + ProxyAuthenticationDialogContextObject(const QString& hostname, quint16 port, const QString& prefilledUsername) + : QObject() + , m_hostname(hostname) + , m_port(port) + , m_prefilledUsername(prefilledUsername) + { + } + + QString hostname() const { return m_hostname; } + quint16 port() const { return m_port; } + QString prefilledUsername() const { return m_prefilledUsername; } + +public slots: + void accept(const QString& username, const QString& password) { emit accepted(username, password); } + void reject() { emit rejected(); } + +signals: + void accepted(const QString& username, const QString& password); + void rejected(); + +private: + QString m_hostname; + quint16 m_port; + QString m_prefilledUsername; +}; + class CertificateVerificationDialogContextObject : public QObject { Q_OBJECT Q_PROPERTY(QString hostname READ hostname CONSTANT) @@ -174,6 +207,19 @@ bool QtDialogRunner::initForAuthentication(QDeclarativeComponent* component, QQu return true; } +bool QtDialogRunner::initForProxyAuthentication(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname, uint16_t port, const QString& prefilledUsername) +{ + ProxyAuthenticationDialogContextObject* contextObject = new ProxyAuthenticationDialogContextObject(hostname, port, prefilledUsername); + if (!createDialog(component, dialogParent, contextObject)) + return false; + + connect(contextObject, SIGNAL(accepted(QString, QString)), SLOT(onAuthenticationAccepted(QString, QString))); + connect(contextObject, SIGNAL(accepted(QString, QString)), SLOT(quit())); + connect(contextObject, SIGNAL(rejected()), SLOT(quit())); + + return true; +} + bool QtDialogRunner::initForCertificateVerification(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname) { CertificateVerificationDialogContextObject* contextObject = new CertificateVerificationDialogContextObject(hostname); |