| Index: chrome/browser/ui/tabs/tab_utils.cc
|
| diff --git a/chrome/browser/ui/tabs/tab_utils.cc b/chrome/browser/ui/tabs/tab_utils.cc
|
| index cfe6282b03aeb2d6ad9a80104fae4874f394a759..29e514420319925f94902fbb46c0ce93e99a7407 100644
|
| --- a/chrome/browser/ui/tabs/tab_utils.cc
|
| +++ b/chrome/browser/ui/tabs/tab_utils.cc
|
| @@ -276,16 +276,23 @@ const std::string& GetTabAudioMutedCause(content::WebContents* contents) {
|
| return LastMuteMetadata::FromWebContents(contents)->cause;
|
| }
|
|
|
| -void SetTabAudioMuted(content::WebContents* contents,
|
| - bool mute,
|
| - const std::string& cause) {
|
| - if (!contents || !chrome::CanToggleAudioMute(contents))
|
| - return;
|
| +TabMutedResult SetTabAudioMuted(content::WebContents* contents,
|
| + bool mute,
|
| + const std::string& cause) {
|
| + DCHECK(contents);
|
| +
|
| + if (!IsTabAudioMutingFeatureEnabled())
|
| + return TAB_MUTED_RESULT_FAIL_NOT_ENABLED;
|
| +
|
| + if (!chrome::CanToggleAudioMute(contents))
|
| + return TAB_MUTED_RESULT_FAIL_TABCAPTURE;
|
|
|
| LastMuteMetadata::CreateForWebContents(contents); // Create if not exists.
|
| - LastMuteMetadata::FromWebContents(contents)->cause = cause;
|
|
|
| contents->SetAudioMuted(mute);
|
| + LastMuteMetadata::FromWebContents(contents)->cause = cause;
|
| +
|
| + return TAB_MUTED_RESULT_SUCCESS;
|
| }
|
|
|
| bool IsTabAudioMuted(content::WebContents* contents) {
|
|
|