blob: 211f7298764734edd98b24bf53d91d863f99aee0 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/macros.h"
#include "base/memory/ref_counted.h"
namespace content {
class WebContents;
// Mutes all audio output from a WebContents. Internally, this is accomplished
// by providing a MirroringDestination implementation, similar to that found in
// WebContentsAudioInputStream for audio capture/mirroring. However, the
// WebContentsAudioMuter::MuteDestination only pumps the audio data and discards
// it.
class WebContentsAudioMuter {
explicit WebContentsAudioMuter(WebContents* web_contents);
bool is_muting() const { return is_muting_; }
void StartMuting();
void StopMuting();
// AudioMirroringManager::MirroringDestination implementation which is
// ref-counted so it remains alive as tasks referencing it are posted on both
// the UI and IO threads.
class MuteDestination;
const scoped_refptr<MuteDestination> destination_;
bool is_muting_;
} // namespace content