summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-04-27 10:03:12 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-04-27 10:03:43 +0200
commit10e66c6dd0b8a8dd17252d6408c13b689fac6995 (patch)
treefbdddb33a818b5495b24f3949f7406b0b916e78c /src/webengine/api/qquickwebengineview.cpp
parentd0852f90a24673ccc9ef0b93e224ba37b674644d (diff)
parent75412200db05ddc5ee2b9aea367b580d8b0c438e (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: configure.pri src/pdf/api/qpdfpagerenderer.h Change-Id: I7e68277080e29238bbfe8511539ea75b2db89489
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 238ad25b2..afb0fbd25 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -316,16 +316,25 @@ void QQuickWebEngineViewPrivate::selectClientCert(const QSharedPointer<ClientCer
#endif
}
-void QQuickWebEngineViewPrivate::runGeolocationPermissionRequest(const QUrl &url)
+static QQuickWebEngineView::Feature toFeature(QtWebEngineCore::ProfileAdapter::PermissionType type)
{
- Q_Q(QQuickWebEngineView);
- Q_EMIT q->featurePermissionRequested(url, QQuickWebEngineView::Geolocation);
+ switch (type) {
+ case QtWebEngineCore::ProfileAdapter::NotificationPermission:
+ return QQuickWebEngineView::Notifications;
+ case QtWebEngineCore::ProfileAdapter::GeolocationPermission:
+ return QQuickWebEngineView::Geolocation;
+ default:
+ break;
+ }
+ Q_UNREACHABLE();
+ return QQuickWebEngineView::Feature(-1);
}
-void QQuickWebEngineViewPrivate::runUserNotificationPermissionRequest(const QUrl &url)
+
+void QQuickWebEngineViewPrivate::runFeaturePermissionRequest(QtWebEngineCore::ProfileAdapter::PermissionType permission, const QUrl &url)
{
Q_Q(QQuickWebEngineView);
- Q_EMIT q->featurePermissionRequested(url, QQuickWebEngineView::Notifications);
+ Q_EMIT q->featurePermissionRequested(url, toFeature(permission));
}
void QQuickWebEngineViewPrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
@@ -1629,7 +1638,7 @@ void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQu
d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaRequestFlags(WebContentsAdapterClient::MediaAudioCapture | WebContentsAdapterClient::MediaVideoCapture));
break;
case Geolocation:
- d_ptr->adapter->runGeolocationRequestCallback(securityOrigin, granted);
+ d_ptr->adapter->runFeatureRequestCallback(securityOrigin, ProfileAdapter::GeolocationPermission, granted);
break;
case DesktopVideoCapture:
d_ptr->adapter->grantMediaAccessPermission(securityOrigin, WebContentsAdapterClient::MediaDesktopVideoCapture);
@@ -1642,7 +1651,7 @@ void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQu
WebContentsAdapterClient::MediaDesktopVideoCapture));
break;
case Notifications:
- d_ptr->adapter->runUserNotificationRequestCallback(securityOrigin, granted);
+ d_ptr->adapter->runFeatureRequestCallback(securityOrigin, ProfileAdapter::NotificationPermission, granted);
break;
default:
Q_UNREACHABLE();