mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add support for muting audio in the browser (issue #1806)
This commit is contained in:
committed by
Marshall Greenblatt
parent
8d1453fd24
commit
ba8b4e8b9d
@ -2204,6 +2204,27 @@ void CefBrowserHostImpl::DragSourceEndedAt(
|
||||
platform_delegate_->DragSourceEndedAt(x, y, op);
|
||||
}
|
||||
|
||||
void CefBrowserHostImpl::SetAudioMuted(bool mute) {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
CEF_POST_TASK(CEF_UIT,
|
||||
base::Bind(&CefBrowserHostImpl::SetAudioMuted, this, mute));
|
||||
return;
|
||||
}
|
||||
if (!web_contents())
|
||||
return;
|
||||
web_contents()->SetAudioMuted(mute);
|
||||
}
|
||||
|
||||
bool CefBrowserHostImpl::IsAudioMuted() {
|
||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||
NOTREACHED() << "called on invalid thread";
|
||||
return false;
|
||||
}
|
||||
if (!web_contents())
|
||||
return false;
|
||||
return web_contents()->IsAudioMuted();
|
||||
}
|
||||
|
||||
// content::WebContentsDelegate methods.
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
Reference in New Issue
Block a user