diff options
author | Andras Becsi <andras.becsi@theqtcompany.com> | 2014-12-11 19:57:58 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-01-12 16:34:58 +0100 |
commit | e6a74159cebdbfec575f40469c216c90ee8651c1 (patch) | |
tree | 331f7a51b9d0c77568bb2744fbd8155733424374 /src/core/browser_context_adapter.h | |
parent | 4557ccd9785f53abc11460211c84db3e564b364f (diff) |
Add QML download API
This patch exposes downloadStarted and downloadFinished
signals on the WebEngineProfile to notify about downloads.
The WebEngineDownloadItem exposes a subset of Chromium's
content::DownloadItem functionality.
For now we expose minimal requirements to be able to control
downloads in QML but this can be extended in the future.
This patch also adds a DownloadView to quicktestbrowser
to demonstrate the usage of the new API.
[ChangeLog][QtWebEngineQML] Add QtQuick download API
Change-Id: I8d8f0daf02c4e0151000427fc2a4b37d28b9db52
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/browser_context_adapter.h')
-rw-r--r-- | src/core/browser_context_adapter.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index 8f03f2094..1c12c465d 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -43,7 +43,9 @@ #include <QSharedData> #include <QString> +class BrowserContextAdapterClient; class BrowserContextQt; +class DownloadManagerDelegateQt; class WebEngineVisitedLinksManager; class QWEBENGINE_EXPORT BrowserContextAdapter : public QSharedData @@ -57,6 +59,12 @@ public: static BrowserContextAdapter* offTheRecordContext(); WebEngineVisitedLinksManager *visitedLinksManager(); + DownloadManagerDelegateQt *downloadManagerDelegate(); + + BrowserContextAdapterClient* client() { return m_client; } + + void setClient(BrowserContextAdapterClient *adapterClient); + void cancelDownload(quint32 downloadId); BrowserContextQt *browserContext(); @@ -116,12 +124,14 @@ private: bool m_offTheRecord; QScopedPointer<BrowserContextQt> m_browserContext; QScopedPointer<WebEngineVisitedLinksManager> m_visitedLinksManager; + QScopedPointer<DownloadManagerDelegateQt> m_downloadManagerDelegate; QString m_dataPath; QString m_cachePath; QString m_httpUserAgent; HttpCacheType m_httpCacheType; PersistentCookiesPolicy m_persistentCookiesPolicy; VisitedLinksPolicy m_visitedLinksPolicy; + BrowserContextAdapterClient *m_client; int m_httpCacheMaxSize; Q_DISABLE_COPY(BrowserContextAdapter) |