Changeset 110781 in webkit


Ignore:
Timestamp:
Mar 14, 2012 4:29:08 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt][WK2] Move code common to both ProxyAuthentication and Authentication context objects into a base class
https://bugs.webkit.org/show_bug.cgi?id=80627

Patch by Dinu Jacob <dinu.jacob@nokia.com> on 2012-03-14
Reviewed by Kenneth Rohde Christiansen.

No impact to QML API.

  • UIProcess/qt/QtDialogRunner.cpp:

(BaseAuthenticationContextObject):
(BaseAuthenticationContextObject::BaseAuthenticationContextObject):
(HttpAuthenticationDialogContextObject):
(HttpAuthenticationDialogContextObject::HttpAuthenticationDialogContextObject):
(HttpAuthenticationDialogContextObject::realm):
(ProxyAuthenticationDialogContextObject):
(ProxyAuthenticationDialogContextObject::ProxyAuthenticationDialogContextObject):
(QtDialogRunner::initForAuthentication):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r110780 r110781  
     12012-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
    1202012-03-14  Anders Carlsson  <andersca@apple.com>
    221
  • trunk/Source/WebKit2/UIProcess/qt/QtDialogRunner.cpp

    r108232 r110781  
    7070};
    7171
    72 class AuthenticationDialogContextObject : public QObject {
     72class BaseAuthenticationContextObject : public QObject {
    7373    Q_OBJECT
    7474    Q_PROPERTY(QString hostname READ hostname CONSTANT)
    75     Q_PROPERTY(QString realm READ realm CONSTANT)
    7675    Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT)
    7776
    7877public:
    79     AuthenticationDialogContextObject(const QString& hostname, const QString& realm, const QString& prefilledUsername)
     78    BaseAuthenticationContextObject(const QString& hostname, const QString& prefilledUsername)
    8079        : QObject()
    8180        , m_hostname(hostname)
    82         , m_realm(realm)
    8381        , m_prefilledUsername(prefilledUsername)
    8482    {
     
    8684
    8785    QString hostname() const { return m_hostname; }
    88     QString realm() const { return m_realm; }
    8986    QString prefilledUsername() const { return m_prefilledUsername; }
    9087
     
    9996private:
    10097    QString m_hostname;
     98    QString m_prefilledUsername;
     99};
     100
     101class HttpAuthenticationDialogContextObject : public BaseAuthenticationContextObject {
     102    Q_OBJECT
     103    Q_PROPERTY(QString realm READ realm CONSTANT)
     104
     105public:
     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
     114private:
    101115    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
     118class ProxyAuthenticationDialogContextObject : public BaseAuthenticationContextObject {
     119    Q_OBJECT
    108120    Q_PROPERTY(quint16 port READ port CONSTANT)
    109     Q_PROPERTY(QString prefilledUsername READ prefilledUsername CONSTANT)
    110121
    111122public:
    112123    ProxyAuthenticationDialogContextObject(const QString& hostname, quint16 port, const QString& prefilledUsername)
    113         : QObject()
    114         , m_hostname(hostname)
     124        : BaseAuthenticationContextObject(hostname, prefilledUsername)
    115125        , m_port(port)
    116         , m_prefilledUsername(prefilledUsername)
    117     {
    118     }
    119 
    120     QString hostname() const { return m_hostname; }
     126    {
     127    }
     128
    121129    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
     131private:
    134132    quint16 m_port;
    135     QString m_prefilledUsername;
    136133};
    137134
     
    197194bool QtDialogRunner::initForAuthentication(QDeclarativeComponent* component, QQuickItem* dialogParent, const QString& hostname, const QString& realm, const QString& prefilledUsername)
    198195{
    199     AuthenticationDialogContextObject* contextObject = new AuthenticationDialogContextObject(hostname, realm, prefilledUsername);
     196    HttpAuthenticationDialogContextObject* contextObject = new HttpAuthenticationDialogContextObject(hostname, realm, prefilledUsername);
    200197    if (!createDialog(component, dialogParent, contextObject))
    201198        return false;
Note: See TracChangeset for help on using the changeset viewer.