summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineprofile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile.cpp')
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 8a6c20f67..cf9dae90a 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -46,6 +46,7 @@
#include "qquickwebenginesettings_p.h"
#include "qquickwebengineview_p_p.h"
#include "qwebenginecookiestore.h"
+#include "qwebenginenotification.h"
#include <QQmlEngine>
@@ -150,6 +151,13 @@ ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineC
The \a download argument holds the state of the finished download instance.
*/
+/*!
+ \fn QQuickWebEngineProfile::userNotification(QWebEngineNotification *notification)
+
+ This signal is emitted whenever there is a newly created user notification.
+ The \a notification argument holds the notification instance to query data and interact with.
+*/
+
QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(ProfileAdapter *profileAdapter)
: m_settings(new QQuickWebEngineSettings())
, m_profileAdapter(profileAdapter)
@@ -285,6 +293,14 @@ void QQuickWebEngineProfilePrivate::useForGlobalCertificateVerificationChanged()
Q_EMIT q->useForGlobalCertificateVerificationChanged();
}
+void QQuickWebEngineProfilePrivate::showNotification(QSharedPointer<QtWebEngineCore::UserNotificationController> &controller)
+{
+ Q_Q(QQuickWebEngineProfile);
+ auto notification = new QWebEngineNotification(controller);
+ QQmlEngine::setObjectOwnership(notification, QQmlEngine::JavaScriptOwnership);
+ Q_EMIT q->userNotification(notification);
+}
+
void QQuickWebEngineProfilePrivate::userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script)
{
Q_ASSERT(p && p->data);
@@ -365,6 +381,13 @@ void QQuickWebEngineProfilePrivate::userScripts_clear(QQmlListProperty<QQuickWeb
*/
/*!
+ \qmlsignal WebEngineProfile::userNotification(WebEngineNotification notification)
+
+ This signal is emitted whenever there is a newly created user notification.
+ The \a notification argument holds the notification instance to query data and interact with.
+*/
+
+/*!
Constructs a new profile with the parent \a parent.
*/
QQuickWebEngineProfile::QQuickWebEngineProfile(QObject *parent)