Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(361)

Side by Side Diff: content/browser/media/capture/web_contents_audio_muter.h

Issue 586303004: WebContentsAudioMuter: Mute all audio output from a WebContentsImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dale's comments. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_
7
8 #include "base/memory/ref_counted.h"
9
10 namespace content {
11
12 class WebContents;
13
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();
23
24 bool is_muting() const { return is_muting_; }
25
26 void StartMuting();
27 void StopMuting();
28
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_;
35
36 bool is_muting_;
37
38 DISALLOW_COPY_AND_ASSIGN(WebContentsAudioMuter);
39 };
40
41 } // namespace content
42
43 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_WEB_CONTENTS_AUDIO_MUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698