| Index: chrome/browser/extensions/api/tabs/tabs_api.cc
|
| diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| index 83827fb16c30ebaace2bf039766634fd3036c383..4ef6db3b873a1c2116feea67eea9eb4ea5cf6cc5 100644
|
| --- a/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc
|
| @@ -1241,23 +1241,21 @@ bool TabsUpdateFunction::RunAsync() {
|
| }
|
|
|
| if (params->update_properties.muted.get()) {
|
| - if (chrome::IsTabAudioMutingFeatureEnabled()) {
|
| - if (!chrome::CanToggleAudioMute(contents)) {
|
| - WriteToConsole(
|
| - content::CONSOLE_MESSAGE_LEVEL_WARNING,
|
| - base::StringPrintf(
|
| - "Cannot update mute state for tab %d, tab has audio or video "
|
| - "currently being captured",
|
| - tab_id));
|
| - } else {
|
| - chrome::SetTabAudioMuted(contents, *params->update_properties.muted,
|
| - extension()->id());
|
| - }
|
| - } else {
|
| - WriteToConsole(content::CONSOLE_MESSAGE_LEVEL_WARNING,
|
| - base::StringPrintf(
|
| - "Failed to update mute state, --%s must be enabled",
|
| - switches::kEnableTabAudioMuting));
|
| + TabMutedResult tab_muted_result = chrome::SetTabAudioMuted(
|
| + contents, *params->update_properties.muted, extension()->id());
|
| +
|
| + switch (tab_muted_result) {
|
| + case TAB_MUTED_RESULT_SUCCESS:
|
| + break;
|
| + case TAB_MUTED_RESULT_FAIL_NOT_ENABLED:
|
| + error_ = ErrorUtils::FormatErrorMessage(
|
| + keys::kCannotUpdateMuteDisabled, base::IntToString(tab_id),
|
| + switches::kEnableTabAudioMuting);
|
| + return false;
|
| + case TAB_MUTED_RESULT_FAIL_TABCAPTURE:
|
| + error_ = ErrorUtils::FormatErrorMessage(keys::kCannotUpdateMuteCaptured,
|
| + base::IntToString(tab_id));
|
| + return false;
|
| }
|
| }
|
|
|
|
|