diff options
author | Michael Bruning <michael.bruning@theqtcompany.com> | 2015-11-05 18:33:59 +0100 |
---|---|---|
committer | Michael BrĂ¼ning <michael.bruning@theqtcompany.com> | 2015-11-16 13:37:55 +0000 |
commit | 2abe1f1b5a317339105a37d6f0ff8450b945d338 (patch) | |
tree | d349646be29d5dcf9f9ee2c131a10cd0ca4a1e42 /src/core/media_capture_devices_dispatcher.cpp | |
parent | ba22dbc0446d688a17f920fa4cfd6a3cefb29bdd (diff) |
Add MediaCaptureEnabled setting to the web engine settings.
Defaults to off.
Change-Id: I416116ce07c8b7f5b24ad6e329390358406eadca
Task-number: QTBUG-48801
Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu>
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/media_capture_devices_dispatcher.cpp')
-rw-r--r-- | src/core/media_capture_devices_dispatcher.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index e18f92b37..f347e17c0 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -44,6 +44,7 @@ #include "javascript_dialog_manager_qt.h" #include "type_conversion.h" #include "web_contents_view_qt.h" +#include "web_engine_settings.h" #include "base/strings/utf_string_conversions.h" #include "chrome/browser/media/desktop_streams_registry.h" @@ -293,8 +294,8 @@ void MediaCaptureDevicesDispatcher::processScreenCaptureAccessRequest(content::W { DCHECK_EQ(request.video_type, content::MEDIA_DESKTOP_VIDEO_CAPTURE); - // FIXME: expose through the settings once we have them - const bool screenCaptureEnabled = !qgetenv("QT_WEBENGINE_USE_EXPERIMENTAL_SCREEN_CAPTURE").isNull(); + WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client(); + const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute(WebEngineSettings::ScreenCaptureEnabled); const bool originIsSecure = content::IsOriginSecure(request.security_origin); |