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

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

Issue 1897953003: Unmute Tab Audio For Desktop Share (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving Comments Created 4 years, 7 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/capture/web_contents_audio_muter.h" 5 #include "content/browser/media/capture/web_contents_audio_muter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/browser/media/capture/audio_mirroring_manager.h" 10 #include "content/browser/media/capture/audio_mirroring_manager.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // Add each ID to |matches| if it maps to a RenderFrameHost that maps to the 97 // Add each ID to |matches| if it maps to a RenderFrameHost that maps to the
98 // WebContents being muted. 98 // WebContents being muted.
99 for (std::set<SourceFrameRef>::const_iterator i = candidates.begin(); 99 for (std::set<SourceFrameRef>::const_iterator i = candidates.begin();
100 i != candidates.end(); ++i) { 100 i != candidates.end(); ++i) {
101 WebContents* const contents_containing_frame = 101 WebContents* const contents_containing_frame =
102 WebContents::FromRenderFrameHost( 102 WebContents::FromRenderFrameHost(
103 RenderFrameHost::FromID(i->first, i->second)); 103 RenderFrameHost::FromID(i->first, i->second));
104 if (contents_containing_frame == web_contents_) 104 if (contents_containing_frame == web_contents_)
105 matches.insert(*i); 105 matches.insert(*i);
106 } 106 }
107 results_callback.Run(matches); 107 results_callback.Run(matches, false);
108 } 108 }
109 109
110 media::AudioOutputStream* AddInput( 110 media::AudioOutputStream* AddInput(
111 const media::AudioParameters& params) override { 111 const media::AudioParameters& params) override {
112 return new AudioDiscarder(params); 112 return new AudioDiscarder(params);
113 } 113 }
114 114
115 media::AudioPushSink* AddPushInput(
116 const media::AudioParameters& params) override {
117 NOTREACHED();
118 return nullptr;
119 }
120
115 WebContents* const web_contents_; 121 WebContents* const web_contents_;
116 122
117 DISALLOW_COPY_AND_ASSIGN(MuteDestination); 123 DISALLOW_COPY_AND_ASSIGN(MuteDestination);
118 }; 124 };
119 125
120 WebContentsAudioMuter::WebContentsAudioMuter(WebContents* web_contents) 126 WebContentsAudioMuter::WebContentsAudioMuter(WebContents* web_contents)
121 : destination_(new MuteDestination(web_contents)), is_muting_(false) { 127 : destination_(new MuteDestination(web_contents)), is_muting_(false) {
122 DCHECK_CURRENTLY_ON(BrowserThread::UI); 128 DCHECK_CURRENTLY_ON(BrowserThread::UI);
123 } 129 }
124 130
(...skipping 20 matching lines...) Expand all
145 return; 151 return;
146 is_muting_ = false; 152 is_muting_ = false;
147 BrowserThread::PostTask( 153 BrowserThread::PostTask(
148 BrowserThread::IO, FROM_HERE, 154 BrowserThread::IO, FROM_HERE,
149 base::Bind(&AudioMirroringManager::StopMirroring, 155 base::Bind(&AudioMirroringManager::StopMirroring,
150 base::Unretained(AudioMirroringManager::GetInstance()), 156 base::Unretained(AudioMirroringManager::GetInstance()),
151 base::RetainedRef(destination_))); 157 base::RetainedRef(destination_)));
152 } 158 }
153 159
154 } // namespace content 160 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698