Changeset 110781 in webkit
- Timestamp:
- Mar 14, 2012 4:29:08 PM (12 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r110780 r110781 1 2012-03-14 Dinu Jacob <dinu.jacob@nokia.com> 2 3 [Qt][WK2] Move code common to both ProxyAuthentication and Authentication context objects into a base class 4 https://bugs.webkit.org/show_bug.cgi?id=80627 5 6 Reviewed by Kenneth Rohde Christiansen. 7 8 No impact to QML API. 9 10 * UIProcess/qt/QtDialogRunner.cpp: 11 (BaseAuthenticationContextObject): 12 (BaseAuthenticationContextObject::BaseAuthenticationContextObject): 13 (HttpAuthenticationDialogContextObject): 14 (HttpAuthenticationDialogContextObject::HttpAuthenticationDialogContextObject): 15 (HttpAuthenticationDialogContextObject::realm): 16 (ProxyAuthenticationDialogContextObject): 17 (ProxyAuthenticationDialogContextObject::ProxyAuthenticationDialogContextObject): 18 (QtDialogRunner::initForAuthentication): 19 1 20 2012-03-14 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp
r108232 r110781 70 70 }; 71 71 72 class AuthenticationDialogContextObject : public QObject {72 class BaseAuthenticationContextObject : public QObject { 73 73 Q_OBJECT 74 74 Q_PROPERTY(QString hostname READ hostname CONSTANT) 75 Q_PROPERTY(QString realm READ realm CONSTANT)76 75 Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT) 77 76 78 77 public: 79 AuthenticationDialogContextObject(const QString& hostname, const QString& realm, const QString& prefilledUsername)78 BaseAuthenticationContextObject(const QString& hostname, const QString& prefilledUsername) 80 79 : QObject() 81 80 , m_hostname(hostname) 82 , m_realm(realm)83 81 , m_prefilledUsername(prefilledUsername) 84 82 { … … 86 84 87 85 QString hostname() const { return m_hostname; } 88 QString realm() const { return m_realm; }89 86 QString prefilledUsername() const { return m_prefilledUsername; } 90 87 … … 99 96 private: 100 97 QString m_hostname; 98 QString m_prefilledUsername; 99 }; 100 101 class HttpAuthenticationDialogContextObject : public BaseAuthenticationContextObject { 102 Q_OBJECT 103 Q_PROPERTY(QString realm READ realm CONSTANT) 104 105 public: 106 HttpAuthenticationDialogContextObject(const QString& hostname, const QString& realm, const QString& prefilledUsername) 107 : BaseAuthenticationContextObject(hostname, prefilledUsername) 108 , m_realm(realm) 109 { 110 } 111 112 QString realm() const { return m_realm; } 113 114 private: 101 115 QString m_realm; 102 QString m_prefilledUsername; 103 }; 104 105 class ProxyAuthenticationDialogContextObject : public QObject { 106 Q_OBJECT 107 Q_PROPERTY(QString hostname READ hostname CONSTANT) 116 }; 117 118 class ProxyAuthenticationDialogContextObject : public BaseAuthenticationContextObject { 119 Q_OBJECT 108 120 Q_PROPERTY(quint16 port READ port CONSTANT) 109 Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT)110 121 111 122 public: 112 123 ProxyAuthenticationDialogContextObject(const QString& hostname, quint16 port, const QString& prefilledUsername) 113 : QObject() 114 , m_hostname(hostname) 124 : BaseAuthenticationContextObject(hostname, prefilledUsername) 115 125 , m_port(port) 116 , m_prefilledUsername(prefilledUsername) 117 { 118 } 119 120 QString hostname() const { return m_hostname; } 126 { 127 } 128 121 129 quint16 port() const { return m_port; } 122 QString prefilledUsername() const { return m_prefilledUsername; } 123 124 public slots: 125 void accept(const QString& username, const QString& password) { emit accepted(username, password); } 126 void reject() { emit rejected(); } 127 128 signals: 129 void accepted(const QString& username, const QString& password); 130 void rejected(); 131 132 private: 133 QString m_hostname; 130 131 private: 134 132 quint16 m_port; 135 QString m_prefilledUsername;136 133 }; 137 134 … … 197 194 bool QtDialogRunner::initForAuthentication(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname, const QString& realm, const QString& prefilledUsername) 198 195 { 199 AuthenticationDialogContextObject* contextObject = newAuthenticationDialogContextObject(hostname, realm, prefilledUsername);196 HttpAuthenticationDialogContextObject* contextObject = new HttpAuthenticationDialogContextObject(hostname, realm, prefilledUsername); 200 197 if (!createDialog(component, dialogParent, contextObject)) 201 198 return false;
Note: See TracChangeset
for help on using the changeset viewer.