Add ICU message format support
[chromium-blink-merge.git] / content / browser / media / capture / web_contents_audio_muter.h
blobd9c5f2fcbb2a939a2a693f573868bf1fc8aacbfb
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"
10 namespace content {
12 class WebContents;
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
18 // it.
19 class WebContentsAudioMuter {
20 public:
21 explicit WebContentsAudioMuter(WebContents* web_contents);
22 ~WebContentsAudioMuter();
24 bool is_muting() const { return is_muting_; }
26 void StartMuting();
27 void StopMuting();
29 private:
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_;
36 bool is_muting_;
38 DISALLOW_COPY_AND_ASSIGN(WebContentsAudioMuter);
41 } // namespace content
43 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_