Add support for muting audio in the browser (issue #1806)

This commit is contained in:
Mike Wiedenbauer
2019-02-26 16:44:17 +00:00
committed by Marshall Greenblatt
parent 8d1453fd24
commit ba8b4e8b9d
13 changed files with 149 additions and 9 deletions

View File

@ -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.
// -----------------------------------------------------------------------------