mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
chrome: Implement CefBrowserHost::SetAudioMuted/IsAudioMuted (fixes #3893)
This commit is contained in:
@ -901,29 +901,6 @@ void AlloyBrowserHostImpl::DragSourceEndedAt(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlloyBrowserHostImpl::SetAudioMuted(bool mute) {
|
|
||||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
|
||||||
CEF_POST_TASK(CEF_UIT, base::BindOnce(&AlloyBrowserHostImpl::SetAudioMuted,
|
|
||||||
this, mute));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!web_contents()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
web_contents()->SetAudioMuted(mute);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool AlloyBrowserHostImpl::IsAudioMuted() {
|
|
||||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
|
||||||
DCHECK(false) << "called on invalid thread";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!web_contents()) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return web_contents()->IsAudioMuted();
|
|
||||||
}
|
|
||||||
|
|
||||||
// content::WebContentsDelegate methods.
|
// content::WebContentsDelegate methods.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -115,8 +115,6 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
|
|||||||
void DragTargetDrop(const CefMouseEvent& event) override;
|
void DragTargetDrop(const CefMouseEvent& event) override;
|
||||||
void DragSourceSystemDragEnded() override;
|
void DragSourceSystemDragEnded() override;
|
||||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||||
void SetAudioMuted(bool mute) override;
|
|
||||||
bool IsAudioMuted() override;
|
|
||||||
void SetAutoResizeEnabled(bool enabled,
|
void SetAutoResizeEnabled(bool enabled,
|
||||||
const CefSize& min_size,
|
const CefSize& min_size,
|
||||||
const CefSize& max_size) override;
|
const CefSize& max_size) override;
|
||||||
|
@ -783,6 +783,28 @@ CefRefPtr<CefNavigationEntry> CefBrowserHostBase::GetVisibleNavigationEntry() {
|
|||||||
return new CefNavigationEntryImpl(entry);
|
return new CefNavigationEntryImpl(entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CefBrowserHostBase::SetAudioMuted(bool mute) {
|
||||||
|
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||||
|
CEF_POST_TASK(CEF_UIT, base::BindOnce(&CefBrowserHostBase::SetAudioMuted,
|
||||||
|
this, mute));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (auto web_contents = GetWebContents()) {
|
||||||
|
web_contents->SetAudioMuted(mute);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CefBrowserHostBase::IsAudioMuted() {
|
||||||
|
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||||
|
DCHECK(false) << "called on invalid thread";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (auto web_contents = GetWebContents()) {
|
||||||
|
return web_contents->IsAudioMuted();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void CefBrowserHostBase::NotifyMoveOrResizeStarted() {
|
void CefBrowserHostBase::NotifyMoveOrResizeStarted() {
|
||||||
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
|
#if BUILDFLAG(IS_WIN) || (BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC))
|
||||||
if (!CEF_CURRENTLY_ON_UIT()) {
|
if (!CEF_CURRENTLY_ON_UIT()) {
|
||||||
|
@ -262,6 +262,8 @@ class CefBrowserHostBase : public CefBrowserHost,
|
|||||||
void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
|
void GetNavigationEntries(CefRefPtr<CefNavigationEntryVisitor> visitor,
|
||||||
bool current_only) override;
|
bool current_only) override;
|
||||||
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
|
CefRefPtr<CefNavigationEntry> GetVisibleNavigationEntry() override;
|
||||||
|
void SetAudioMuted(bool mute) override;
|
||||||
|
bool IsAudioMuted() override;
|
||||||
void NotifyMoveOrResizeStarted() override;
|
void NotifyMoveOrResizeStarted() override;
|
||||||
bool IsFullscreen() override;
|
bool IsFullscreen() override;
|
||||||
void ExitFullscreen(bool will_cause_resize) override;
|
void ExitFullscreen(bool will_cause_resize) override;
|
||||||
|
@ -327,15 +327,6 @@ void ChromeBrowserHostImpl::DragSourceEndedAt(int x,
|
|||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::SetAudioMuted(bool mute) {
|
|
||||||
NOTIMPLEMENTED();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ChromeBrowserHostImpl::IsAudioMuted() {
|
|
||||||
NOTIMPLEMENTED();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ChromeBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
|
void ChromeBrowserHostImpl::SetAutoResizeEnabled(bool enabled,
|
||||||
const CefSize& min_size,
|
const CefSize& min_size,
|
||||||
const CefSize& max_size) {
|
const CefSize& max_size) {
|
||||||
|
@ -109,8 +109,6 @@ class ChromeBrowserHostImpl : public CefBrowserHostBase {
|
|||||||
void DragTargetDrop(const CefMouseEvent& event) override;
|
void DragTargetDrop(const CefMouseEvent& event) override;
|
||||||
void DragSourceSystemDragEnded() override;
|
void DragSourceSystemDragEnded() override;
|
||||||
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
void DragSourceEndedAt(int x, int y, DragOperationsMask op) override;
|
||||||
void SetAudioMuted(bool mute) override;
|
|
||||||
bool IsAudioMuted() override;
|
|
||||||
void SetAutoResizeEnabled(bool enabled,
|
void SetAutoResizeEnabled(bool enabled,
|
||||||
const CefSize& min_size,
|
const CefSize& min_size,
|
||||||
const CefSize& max_size) override;
|
const CefSize& max_size) override;
|
||||||
|
Reference in New Issue
Block a user