Chromium Code Reviews| Index: chrome/browser/ui/extensions/shell_window.cc |
| diff --git a/chrome/browser/ui/extensions/shell_window.cc b/chrome/browser/ui/extensions/shell_window.cc |
| index cbfb9b817b27661e8955cbad0254f38215c602a6..04701900644ff1295e222ca5e6d2c222c929892b 100644 |
| --- a/chrome/browser/ui/extensions/shell_window.cc |
| +++ b/chrome/browser/ui/extensions/shell_window.cc |
| @@ -198,23 +198,27 @@ void ShellWindow::RequestMediaAccessPermission( |
| // Auto-accept the first audio device and the first video device from the |
| // request when the appropriate API permissions exist. |
| + // For tab media types, we require the tab capture permission instead. |
| 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) && |
| - extension()->HasAPIPermission(APIPermission::kAudioCapture) && |
| + request->devices.begin(); it != request->devices.end(); ++it) { |
| + if (!accepted_an_audio_device && content::IsAudioMediaType(it->first) && |
| !it->second.empty()) { |
| - devices.push_back(it->second.front()); |
| - accepted_an_audio_device = true; |
| + if ((it->first != content::MEDIA_TAB_AUDIO_CAPTURE && |
|
no longer working on chromium
2012/10/18 08:36:17
it should be it->first != content::MEDIA_DEVICE_AU
justinlin
2012/10/18 09:33:29
Sorry, tried to be clever and probably made it too
|
| + extension()->HasAPIPermission(APIPermission::kAudioCapture)) || |
| + extension()->HasAPIPermission(APIPermission::kTabCapture)) { |
|
no longer working on chromium
2012/10/18 08:36:17
indentation.
no longer working on chromium
2012/10/18 08:36:17
Dont you need to
it->first == content::MEDIA_TAB_
justinlin
2012/10/18 09:33:29
Done.
justinlin
2012/10/18 09:33:29
Done.
|
| + devices.push_back(it->second.front()); |
| + accepted_an_audio_device = true; |
| + } |
| } else if (!accepted_a_video_device && |
| - content::IsVideoMediaType(it->first) && |
| - extension()->HasAPIPermission(APIPermission::kVideoCapture) && |
| - !it->second.empty()) { |
| - devices.push_back(it->second.front()); |
| - accepted_a_video_device = true; |
| + content::IsVideoMediaType(it->first) && !it->second.empty()) { |
| + if ((it->first != content::MEDIA_TAB_VIDEO_CAPTURE && |
|
no longer working on chromium
2012/10/18 08:36:17
ditto
justinlin
2012/10/18 09:33:29
Same
|
| + extension()->HasAPIPermission(APIPermission::kVideoCapture)) || |
| + extension()->HasAPIPermission(APIPermission::kTabCapture)) { |
| + devices.push_back(it->second.front()); |
| + accepted_an_audio_device = true; |
| + } |
| } |
| } |