diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-04 15:13:31 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2016-04-05 11:41:08 +0000 |
commit | 3e9a6407bbbc5f83eb8bd56c5c1d899dba9bc56f (patch) | |
tree | b525366744fc29fd0f5ed0e28681e430866b6e52 /src/core/web_contents_delegate_qt.cpp | |
parent | 9da7a0649cfa65c784e86cf3496b188c9d8d15c4 (diff) |
Implement CheckMediaAccessPermission
Fixes access of label of MediaStream tracks
Also fixes the logged error:
WebContentsDelegate::CheckMediaAccessPermission: Not supported.
Change-Id: I3fee9ccd9e8b2e5cbd6b707336cc61425a44ba31
Task-number: QTBUG-52216
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index e3903c902..bf12537d1 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -438,4 +438,18 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr m_viewClient->windowCloseRejected(); } +bool WebContentsDelegateQt::CheckMediaAccessPermission(content::WebContents *web_contents, const GURL& security_origin, content::MediaStreamType type) +{ + switch (type) { + case content::MEDIA_DEVICE_AUDIO_CAPTURE: + return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::AudioCapturePermission); + case content::MEDIA_DEVICE_VIDEO_CAPTURE: + return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::VideoCapturePermission); + default: + LOG(INFO) << "WebContentsDelegateQt::CheckMediaAccessPermission: " + << "Unsupported media stream type checked" << type; + return false; + } +} + } // namespace QtWebEngineCore |