summaryrefslogtreecommitdiffstats
path: root/src/core/browser_context_adapter_client.h
diff options
context:
space:
mode:
authorAndras Becsi <andras.becsi@theqtcompany.com>2015-01-19 13:27:41 +0100
committerAndras Becsi <andras.becsi@theqtcompany.com>2015-01-20 11:31:02 +0100
commit38f58ee4693272ca8e206dac8b484d012b683ebf (patch)
tree929694adb94c960cf64a0fca18934aa17629c3cf /src/core/browser_context_adapter_client.h
parent43905f3a41d2ce419fe6c1558fda6e90011802b6 (diff)
Add DownloadItemInfo to BrowserContextAdapterClient
This extends the carried information from Chromium's content::DownloadItem with url, totalBytes and receivedBytes in preparation of adding a Widget API for downloads. DownloadItemInfo struct is now constructed to carry information about individual downloads from the content layer to the Qt API layer. Change-Id: I3ee7aea02b74994e612e1b3709195776d5e7570b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Diffstat (limited to 'src/core/browser_context_adapter_client.h')
-rw-r--r--src/core/browser_context_adapter_client.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/browser_context_adapter_client.h b/src/core/browser_context_adapter_client.h
index 2b6b4f434..1d84ffb45 100644
--- a/src/core/browser_context_adapter_client.h
+++ b/src/core/browser_context_adapter_client.h
@@ -39,6 +39,7 @@
#include "qtwebenginecoreglobal.h"
#include <QString>
+#include <QUrl>
class QWEBENGINE_EXPORT BrowserContextAdapterClient
{
@@ -54,10 +55,23 @@ public:
// This state indicates that the download has been interrupted.
DownloadInterrupted
};
+
+ struct DownloadItemInfo {
+ const quint32 id;
+ const QUrl url;
+ const int state;
+ const int percentComplete;
+ const qint64 totalBytes;
+ const qint64 receivedBytes;
+
+ QString path;
+ bool cancelled;
+ };
+
virtual ~BrowserContextAdapterClient() { }
- virtual void downloadRequested(quint32 downloadId, QString &downloadPath, bool &cancelled) = 0;
- virtual void downloadUpdated(quint32 downloadId, int downloadState, int percentComplete) = 0;
+ virtual void downloadRequested(DownloadItemInfo &info) = 0;
+ virtual void downloadUpdated(const DownloadItemInfo &info) = 0;
};
#endif // BROWSER_CONTEXT_ADAPTER_CLIENT_H