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

Side by Side Diff: content/browser/renderer_host/media/media_stream_manager.cc

Issue 1503563004: Desktop chrome tab capture-chooseDesktopMedia() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/renderer_host/media/media_stream_manager.h" 5 #include "content/browser/renderer_host/media/media_stream_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <string.h> 9 #include <string.h>
10 #include <cctype> 10 #include <cctype>
(...skipping 10 matching lines...) Expand all
21 #include "base/profiler/scoped_tracker.h" 21 #include "base/profiler/scoped_tracker.h"
22 #include "base/rand_util.h" 22 #include "base/rand_util.h"
23 #include "base/run_loop.h" 23 #include "base/run_loop.h"
24 #include "base/strings/string_number_conversions.h" 24 #include "base/strings/string_number_conversions.h"
25 #include "base/strings/string_util.h" 25 #include "base/strings/string_util.h"
26 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
27 #include "base/threading/thread.h" 27 #include "base/threading/thread.h"
28 #include "base/threading/thread_local.h" 28 #include "base/threading/thread_local.h"
29 #include "build/build_config.h" 29 #include "build/build_config.h"
30 #include "content/browser/browser_main_loop.h" 30 #include "content/browser/browser_main_loop.h"
31 #include "content/browser/media/capture/web_contents_capture_util.h"
32 #include "content/browser/renderer_host/media/audio_input_device_manager.h" 31 #include "content/browser/renderer_host/media/audio_input_device_manager.h"
33 #include "content/browser/renderer_host/media/audio_output_device_enumerator.h" 32 #include "content/browser/renderer_host/media/audio_output_device_enumerator.h"
34 #include "content/browser/renderer_host/media/media_capture_devices_impl.h" 33 #include "content/browser/renderer_host/media/media_capture_devices_impl.h"
35 #include "content/browser/renderer_host/media/media_stream_requester.h" 34 #include "content/browser/renderer_host/media/media_stream_requester.h"
36 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" 35 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h"
37 #include "content/browser/renderer_host/media/video_capture_manager.h" 36 #include "content/browser/renderer_host/media/video_capture_manager.h"
38 #include "content/browser/renderer_host/render_process_host_impl.h" 37 #include "content/browser/renderer_host/render_process_host_impl.h"
39 #include "content/public/browser/browser_thread.h" 38 #include "content/public/browser/browser_thread.h"
40 #include "content/public/browser/content_browser_client.h" 39 #include "content/public/browser/content_browser_client.h"
41 #include "content/public/browser/media_observer.h" 40 #include "content/public/browser/media_observer.h"
42 #include "content/public/browser/media_request_state.h" 41 #include "content/public/browser/media_request_state.h"
43 #include "content/public/browser/render_process_host.h" 42 #include "content/public/browser/render_process_host.h"
43 #include "content/public/browser/web_contents_media_capture_id.h"
44 #include "content/public/common/content_client.h" 44 #include "content/public/common/content_client.h"
45 #include "content/public/common/content_switches.h" 45 #include "content/public/common/content_switches.h"
46 #include "content/public/common/media_stream_request.h" 46 #include "content/public/common/media_stream_request.h"
47 #include "crypto/hmac.h" 47 #include "crypto/hmac.h"
48 #include "media/audio/audio_manager_base.h" 48 #include "media/audio/audio_manager_base.h"
49 #include "media/audio/audio_parameters.h" 49 #include "media/audio/audio_parameters.h"
50 #include "media/base/channel_layout.h" 50 #include "media/base/channel_layout.h"
51 #include "media/base/media_switches.h" 51 #include "media/base/media_switches.h"
52 #include "media/capture/video/video_capture_device_factory.h" 52 #include "media/capture/video/video_capture_device_factory.h"
53 #include "url/gurl.h" 53 #include "url/gurl.h"
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 } else if (!request->controls.video.device_ids.empty()) { 1262 } else if (!request->controls.video.device_ids.empty()) {
1263 capture_device_id = request->controls.video.device_ids[0]; 1263 capture_device_id = request->controls.video.device_ids[0];
1264 } else { 1264 } else {
1265 return false; 1265 return false;
1266 } 1266 }
1267 1267
1268 // Customize controls for a WebContents based capture. 1268 // Customize controls for a WebContents based capture.
1269 int target_render_process_id = 0; 1269 int target_render_process_id = 0;
1270 int target_render_frame_id = 0; 1270 int target_render_frame_id = 0;
1271 1271
1272 bool has_valid_device_id = WebContentsCaptureUtil::ExtractTabCaptureTarget( 1272 bool has_valid_device_id = WebContentsMediaCaptureId::ExtractTabCaptureTarget(
1273 capture_device_id, &target_render_process_id, &target_render_frame_id); 1273 capture_device_id, &target_render_process_id, &target_render_frame_id);
1274 if (!has_valid_device_id || 1274 if (!has_valid_device_id ||
1275 (request->audio_type() != MEDIA_TAB_AUDIO_CAPTURE && 1275 (request->audio_type() != MEDIA_TAB_AUDIO_CAPTURE &&
1276 request->audio_type() != MEDIA_NO_SERVICE) || 1276 request->audio_type() != MEDIA_NO_SERVICE) ||
1277 (request->video_type() != MEDIA_TAB_VIDEO_CAPTURE && 1277 (request->video_type() != MEDIA_TAB_VIDEO_CAPTURE &&
1278 request->video_type() != MEDIA_NO_SERVICE)) { 1278 request->video_type() != MEDIA_NO_SERVICE)) {
1279 return false; 1279 return false;
1280 } 1280 }
1281 request->tab_capture_device_id = capture_device_id; 1281 request->tab_capture_device_id = capture_device_id;
1282 1282
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after
2073 const std::string& device_guid, 2073 const std::string& device_guid,
2074 const std::string& raw_unique_id) { 2074 const std::string& raw_unique_id) {
2075 DCHECK(security_origin.is_valid()); 2075 DCHECK(security_origin.is_valid());
2076 DCHECK(!raw_unique_id.empty()); 2076 DCHECK(!raw_unique_id.empty());
2077 std::string guid_from_raw_device_id = 2077 std::string guid_from_raw_device_id =
2078 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id); 2078 GetHMACForMediaDeviceID(sc, security_origin, raw_unique_id);
2079 return guid_from_raw_device_id == device_guid; 2079 return guid_from_raw_device_id == device_guid;
2080 } 2080 }
2081 2081
2082 } // namespace content 2082 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/media/audio_input_renderer_host.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698