diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-22 10:55:57 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-01-25 15:41:53 +0100 |
commit | cde72003881c6b5680ac8ac0fe6d6971bb43e0d5 (patch) | |
tree | fcb50002765c1cb179dd6f62054380c3fed85e80 /src/core/media_capture_devices_dispatcher.cpp | |
parent | 3fb215dab139fd7b61473ce3fe1058b87a6b4fe3 (diff) | |
parent | 75d061bbc68875c08b3dc243e464e32a80da71df (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Including update to 87-based
Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
Diffstat (limited to 'src/core/media_capture_devices_dispatcher.cpp')
-rw-r--r-- | src/core/media_capture_devices_dispatcher.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index 9600f220e..cf31b9b59 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -59,9 +59,9 @@ #include "content/public/browser/notification_source.h" #include "content/public/browser/notification_types.h" #include "content/public/browser/render_process_host.h" -#include "content/public/common/origin_util.h" #include "media/audio/audio_device_description.h" #include "media/audio/audio_manager_base.h" +#include "third_party/blink/public/common/loader/network_utils.h" #include "ui/base/l10n/l10n_util.h" #if QT_CONFIG(webengine_webrtc) @@ -381,7 +381,7 @@ void MediaCaptureDevicesDispatcher::Observe(int type, const content::Notificatio } } -void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapterClient *adapterClient, content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback) +void MediaCaptureDevicesDispatcher::processMediaAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback) { DCHECK_CURRENTLY_ON(BrowserThread::UI); @@ -391,10 +391,13 @@ void MediaCaptureDevicesDispatcher::processMediaAccessRequest(WebContentsAdapter return; } + WebContentsDelegateQt *delegate = static_cast<WebContentsDelegateQt *>(webContents->GetDelegate()); + WebContentsAdapterClient *adapterClient = delegate->adapterClient(); + if (flags.testFlag(WebContentsAdapterClient::MediaDesktopVideoCapture)) { const bool screenCaptureEnabled = adapterClient->webEngineSettings()->testAttribute( QWebEngineSettings::ScreenCaptureEnabled); - const bool originIsSecure = content::IsOriginSecure(request.security_origin); + const bool originIsSecure = blink::network_utils::IsOriginSecure(request.security_origin); if (!screenCaptureEnabled || !originIsSecure) { std::move(callback).Run(blink::MediaStreamDevices(), MediaStreamRequestResult::INVALID_STATE, std::unique_ptr<content::MediaStreamUI>()); return; |