diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2019-01-31 13:08:21 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-02-06 15:18:18 +0000 |
commit | f4ca67aa7f70f58d39ef8689ddd5910e215ed6cd (patch) | |
tree | ebb9937672b14c725de14fd7da6e3eeac269e861 /src/core/profile_adapter.h | |
parent | 7aa06a1614b7ca6508d96ee2e8ef0f4c49038a6f (diff) |
Web Notifications API
Implements API for end-user notifications.
Co-authored by Allan Sandfeld Jensen
[ChangeLog][Profile] Support for Web Notifications API
for end-user notifications through QWebEngineNotification
Task-number: QTBUG-50995
Fixes: QTBUG-51191
Change-Id: Icebaaa05275a713e801f1f8ecdaaec725fa264c8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_adapter.h')
-rw-r--r-- | src/core/profile_adapter.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h index 800058bc5..482835010 100644 --- a/src/core/profile_adapter.h +++ b/src/core/profile_adapter.h @@ -69,8 +69,9 @@ QT_FORWARD_DECLARE_CLASS(QObject) namespace QtWebEngineCore { -class ProfileAdapterClient; +class UserNotificationController; class DownloadManagerDelegateQt; +class ProfileAdapterClient; class ProfileQt; class UserResourceControllerHost; class VisitedLinksManagerQt; @@ -153,8 +154,7 @@ public: enum PermissionType { UnsupportedPermission = 0, GeolocationPermission = 1, -// Reserved: -// NotificationPermission = 2, + NotificationPermission = 2, AudioCapturePermission = 3, VideoCapturePermission = 4, ClipboardRead = 5, @@ -200,6 +200,11 @@ public: void removePageRequestInterceptor(); bool hasPageRequestInterceptor() const { return m_pageRequestInterceptors > 0; } + QHash<QByteArray, QWeakPointer<UserNotificationController>> &ephemeralNotifications() + { return m_ephemeralNotifications; } + QHash<QByteArray, QSharedPointer<UserNotificationController>> &persistentNotifications() + { return m_persistentNotifications; } + private: void updateCustomUrlSchemeHandlers(); void resetVisitedLinksManager(); @@ -224,6 +229,9 @@ private: PersistentCookiesPolicy m_persistentCookiesPolicy; VisitedLinksPolicy m_visitedLinksPolicy; QHash<QByteArray, QPointer<QWebEngineUrlSchemeHandler>> m_customUrlSchemeHandlers; + QHash<QByteArray, QWeakPointer<UserNotificationController>> m_ephemeralNotifications; + QHash<QByteArray, QSharedPointer<UserNotificationController>> m_persistentNotifications; + QList<ProfileAdapterClient*> m_clients; int m_httpCacheMaxSize; int m_pageRequestInterceptors; |