Chromium Code Reviews| Index: chrome/browser/extensions/extension_host.cc |
| diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc |
| index d370c268c555b51ae652538ac323cac0c26de36b..53666cdd99e4af4095174931245228ff52ab94f2 100644 |
| --- a/chrome/browser/extensions/extension_host.cc |
| +++ b/chrome/browser/extensions/extension_host.cc |
| @@ -640,4 +640,35 @@ void ExtensionHost::RenderViewReady() { |
| content::Details<ExtensionHost>(this)); |
| } |
| +void ExtensionHost::RequestMediaAccessPermission( |
| + content::WebContents* web_contents, |
| + const content::MediaStreamRequest* request, |
| + const content::MediaResponseCallback& callback) { |
| + content::MediaStreamDevices devices; |
| + |
| + bool accepted_an_audio_device = false; |
| + bool accepted_a_video_device = false; |
| + for (content::MediaStreamDeviceMap::const_iterator it = |
| + request->devices.begin(); it != request->devices.end(); ++it) { |
| + if (!accepted_an_audio_device && content::IsAudioMediaType(it->first) && |
|
no longer working on chromium
2012/10/18 08:36:17
fix the alignment to help readability.
If (*** &&
justinlin
2012/10/18 09:33:29
Done.
|
| + !it->second.empty()) { |
| + // For tab capture, we require the tabCapture permission. |
| + if (it->first != content::MEDIA_TAB_AUDIO_CAPTURE || |
|
no longer working on chromium
2012/10/18 08:36:17
I don't understand here, shouldn't it be
it->first
justinlin
2012/10/18 09:33:29
Sorry if this is confusing. We add the device if i
|
| + extension()->HasAPIPermission(APIPermission::kTabCapture)) { |
| + devices.push_back(it->second.front()); |
| + accepted_an_audio_device = true; |
| + } |
| + } else if (!accepted_a_video_device && |
| + content::IsVideoMediaType(it->first) && !it->second.empty()) { |
| + if (it->first != content::MEDIA_TAB_VIDEO_CAPTURE || |
| + extension()->HasAPIPermission(APIPermission::kTabCapture)) { |
| + devices.push_back(it->second.front()); |
| + accepted_a_video_device = true; |
| + } |
| + } |
| + } |
| + |
| + callback.Run(devices); |
| +} |
| + |
| } // namespace extensions |