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

Unified Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 11198044: Make tab capture media stream requests verify that the request came from extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/extensions/api_test/tab_capture/permissions/test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_manager.cc
diff --git a/content/browser/renderer_host/media/media_stream_manager.cc b/content/browser/renderer_host/media/media_stream_manager.cc
index c8b25bc9a1247141e55c4921c79c59c286cb4c6a..45eb90b883bdebb77233e3f1b60ca97c7c014b90 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -269,7 +269,6 @@ void MediaStreamManager::GenerateStreamForDevice(
// |device_id| actually exists. Note that no such MediaStreamProvider API for
// this currently exists. Also, we don't have a user-friendly device name for
// the infobar UI.
- StreamDeviceInfoArray devices;
if (content::IsAudioMediaType(options.audio_type)) {
// TODO(justinlin): Updating the state to requested and pending are no-ops
// in terms of the media manager, but these are the state changes we want to
@@ -278,22 +277,21 @@ void MediaStreamManager::GenerateStreamForDevice(
content::MEDIA_REQUEST_STATE_REQUESTED);
request.setState(options.audio_type,
content::MEDIA_REQUEST_STATE_PENDING_APPROVAL);
- devices.push_back(
- StreamDeviceInfo(options.audio_type, device_id, device_id, false));
+ ui_controller_->AddAvailableDevicesToRequest(
+ *label, options.audio_type, StreamDeviceInfoArray(
+ 1, StreamDeviceInfo(options.audio_type, device_id, device_id,
+ false)));
}
if (content::IsVideoMediaType(options.video_type)) {
request.setState(options.video_type,
content::MEDIA_REQUEST_STATE_REQUESTED);
request.setState(options.video_type,
content::MEDIA_REQUEST_STATE_PENDING_APPROVAL);
- devices.push_back(
- StreamDeviceInfo(options.video_type, device_id, device_id, false));
+ ui_controller_->AddAvailableDevicesToRequest(
+ *label, options.video_type, StreamDeviceInfoArray(
+ 1, StreamDeviceInfo(options.video_type, device_id, device_id,
+ false)));
}
-
- // Bypass the user authorization dropdown for tab capture.
- BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
- base::Bind(&MediaStreamManager::DevicesAccepted,
- base::Unretained(this), *label, devices));
}
void MediaStreamManager::CancelRequest(const std::string& label) {
« no previous file with comments | « chrome/test/data/extensions/api_test/tab_capture/permissions/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698