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 b44050d390
commit 1501768614
13 changed files with 139 additions and 7 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.
// -----------------------------------------------------------------------------