summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview_p.h
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2016-10-17 07:00:26 -0700
committerSzabolcs David <davidsz@inf.u-szeged.hu>2017-09-13 13:34:31 +0000
commit7b365eb352780dc0d939e918b0aa58d0458fd9da (patch)
tree6453e84f62bcbe92f9149a486fc83dbdf09cdb4c /src/webengine/api/qquickwebengineview_p.h
parent98bdf56f7428094c2d197fff72422d301470fbcb (diff)
Support Quota Management API
Expose navigator.webkitPersistentStorage.requestQuota() calls to the API layer as a permission API. It allows the users to accept these requests and specify a quota for persistent storage. https://developer.chrome.com/apps/offline_storage#managing_quota [ChangeLog] navigator.webkitPersistentStorage.requestQuota() calls were rejected by default and now they will emit signal quotaPermissionRequested in both WebEngineView and QWebEnginePage. Task-number: QTBUG-56354 Change-Id: Id192577ffb403694d3051414744ded89bbfd2aa8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebengineview_p.h')
-rw-r--r--src/webengine/api/qquickwebengineview_p.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index ae0523460..57f74ad01 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -56,6 +56,12 @@
#include <QQuickItem>
#include <QtGui/qcolor.h>
+
+namespace QtWebEngineCore {
+ class QuotaPermissionController;
+}
+
+
QT_BEGIN_NAMESPACE
class QQmlWebChannel;
@@ -98,6 +104,26 @@ private:
const bool m_toggleOn;
};
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineQuotaPermissionRequest {
+ Q_GADGET
+ Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
+ Q_PROPERTY(qint64 requestedSize READ requestedSize CONSTANT FINAL)
+public:
+ QQuickWebEngineQuotaPermissionRequest() {}
+ QQuickWebEngineQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller);
+ ~QQuickWebEngineQuotaPermissionRequest();
+
+ Q_INVOKABLE void accept();
+ Q_INVOKABLE void reject();
+ QUrl origin() const;
+ qint64 requestedSize() const;
+
+private:
+ QSharedPointer<QtWebEngineCore::QuotaPermissionController> d_ptr;
+};
+
+#define LATEST_WEBENGINEVIEW_REVISION 7
+
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged FINAL)
@@ -529,6 +555,7 @@ Q_SIGNALS:
Q_REVISION(4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
Q_REVISION(4) void formValidationMessageRequested(QQuickWebEngineFormValidationMessageRequest *request);
Q_REVISION(5) void pdfPrintingFinished(const QString &filePath, bool success);
+ Q_REVISION(7) void quotaPermissionRequested(const QQuickWebEngineQuotaPermissionRequest &request);
#ifdef ENABLE_QML_TESTSUPPORT_API
void testSupportChanged();
@@ -557,5 +584,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickWebEngineView)
Q_DECLARE_METATYPE(QQuickWebEngineFullScreenRequest)
+Q_DECLARE_METATYPE(QQuickWebEngineQuotaPermissionRequest)
#endif // QQUICKWEBENGINEVIEW_P_H