Chromium Code Reviews| Index: content/browser/media/capture/web_contents_audio_muter.h |
| diff --git a/content/browser/media/capture/web_contents_audio_muter.h b/content/browser/media/capture/web_contents_audio_muter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..44024376d528e0b037f5d848fc71859ff156a695 |
| --- /dev/null |
| +++ b/content/browser/media/capture/web_contents_audio_muter.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
|
Avi (use Gerrit)
2014/09/21 00:20:00
No "(c)" on new files.
miu
2014/09/21 02:33:30
Done.
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_ |
| +#define CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_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 { |
| + public: |
| + explicit WebContentsAudioMuter(WebContents* web_contents); |
| + ~WebContentsAudioMuter(); |
| + |
| + bool is_muting() const { return is_muting_; } |
| + |
| + void StartMuting(); |
| + void StopMuting(); |
| + |
| + private: |
| + // 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_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebContentsAudioMuter); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_ |