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 /tests/quicktestbrowser/FeaturePermissionBar.qml | |
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 'tests/quicktestbrowser/FeaturePermissionBar.qml')
-rw-r--r-- | tests/quicktestbrowser/FeaturePermissionBar.qml | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/quicktestbrowser/FeaturePermissionBar.qml b/tests/quicktestbrowser/FeaturePermissionBar.qml index 9c0b25966..500d13206 100644 --- a/tests/quicktestbrowser/FeaturePermissionBar.qml +++ b/tests/quicktestbrowser/FeaturePermissionBar.qml @@ -40,10 +40,24 @@ Rectangle { visible: false height: acceptButton.height + 4 - onRequestedFeatureChanged: { - message.text = securityOrigin + " wants to access " + message.textForFeature(requestedFeature); + + function textForFeature(feature) { + switch (feature) { + case WebEngineView.Geolocation: return 'Allow %1 to access your location information?' + case WebEngineView.MediaAudioCapture: return 'Allow %1 to access your microphone?' + case WebEngineView.MediaVideoCapture: return 'Allow %1 to access your webcam?' + case WebEngineView.MediaAudioVideoCapture: return 'Allow %1 to access your microphone and webcam?' + case WebEngineView.DesktopVideoCapture: return 'Allow %1 to capture video of your desktop?' + case WebEngineView.DesktopAudioVideoCapture: return 'Allow %1 to capture audio and video of your desktop?' + case WebEngineView.Notifications: return 'Allow %1 to show notification on your desktop?' + default: break + } + return 'Grant permission for %1 to unknown or unsupported feature [' + feature + ']?' } + onRequestedFeatureChanged: { + message.text = textForFeature(requestedFeature).arg(securityOrigin); + } RowLayout { anchors { @@ -54,17 +68,6 @@ Rectangle { Label { id: message Layout.fillWidth: true - - function textForFeature(feature) { - if (feature === WebEngineView.MediaAudioCapture) - return "your microphone" - if (feature === WebEngineView.MediaVideoCapture) - return "your camera" - if (feature === WebEngineView.MediaAudioVideoCapture) - return "your camera and microphone" - if (feature === WebEngineView.Geolocation) - return "your position" - } } Button { |