1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_
8 #include "base/memory/ref_counted.h"
14 // Mutes all audio output from a WebContents. Internally, this is accomplished
15 // by providing a MirroringDestination implementation, similar to that found in
16 // WebContentsAudioInputStream for audio capture/mirroring. However, the
17 // WebContentsAudioMuter::MuteDestination only pumps the audio data and discards
19 class WebContentsAudioMuter
{
21 explicit WebContentsAudioMuter(WebContents
* web_contents
);
22 ~WebContentsAudioMuter();
24 bool is_muting() const { return is_muting_
; }
30 // AudioMirroringManager::MirroringDestination implementation which is
31 // ref-counted so it remains alive as tasks referencing it are posted on both
32 // the UI and IO threads.
33 class MuteDestination
;
34 const scoped_refptr
<MuteDestination
> destination_
;
38 DISALLOW_COPY_AND_ASSIGN(WebContentsAudioMuter
);
41 } // namespace content
43 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_