~ubuntu-branches/ubuntu/raring/signon-ui/raring

« back to all changes in this revision

Viewing changes to src/browser-request.cpp

* New snapshot rev 47
* common-project-config.pri 
  - fixed FTBFS by including X11 in pkgconfg

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#include "i18n.h"
28
28
 
29
29
#include <QDBusArgument>
 
30
#include <QDesktopServices>
30
31
#include <QLabel>
31
32
#include <QProgressBar>
32
33
#include <QPushButton>
73
74
            QWebPage::userAgentForUrl(url) : m_userAgent;
74
75
    }
75
76
 
 
77
    bool acceptNavigationRequest(QWebFrame *frame,
 
78
                                 const QNetworkRequest &request,
 
79
                                 NavigationType type)
 
80
    {
 
81
        /* open all new window requests (identified by "frame == 0") in the
 
82
         * external browser; handle all other requests internally. */
 
83
        return (frame == 0) ?
 
84
            QWebPage::acceptNavigationRequest(frame, request, type) : true;
 
85
    }
 
86
 
76
87
private:
77
88
    QString m_userAgent;
78
89
};
137
148
    void startProgress();
138
149
    void stopProgress();
139
150
    void onContentsChanged();
 
151
    void onLinkClicked(const QUrl &url);
140
152
 
141
153
private:
142
154
    void showDialog();
302
314
    WebPage *page = new WebPage(this);
303
315
    QObject::connect(page, SIGNAL(contentsChanged()),
304
316
                     this, SLOT(onContentsChanged()));
 
317
    QObject::connect(page, SIGNAL(linkClicked(const QUrl&)),
 
318
                     this, SLOT(onLinkClicked(const QUrl&)));
 
319
    page->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);
305
320
    m_webView->setPage(page);
306
321
 
307
322
    /* set a per-identity cookie jar on the page */
453
468
    }
454
469
}
455
470
 
 
471
void BrowserRequestPrivate::onLinkClicked(const QUrl &url)
 
472
{
 
473
    QDesktopServices::openUrl(url);
 
474
}
 
475
 
456
476
void BrowserRequestPrivate::showDialog()
457
477
{
458
478
    Q_Q(BrowserRequest);