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

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 and move flag check into extension_host 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
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 c3245c8657e81ef41d2befcf14debba8a90b0a74..d25b9cb3d51c610759bb22f0b9b6b17a255b5625 100644
--- a/content/browser/renderer_host/media/media_stream_manager.cc
+++ b/content/browser/renderer_host/media/media_stream_manager.cc
@@ -286,7 +286,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
@@ -295,22 +294,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) {

Powered by Google App Engine
This is Rietveld 408576698