| OLD | NEW |
| 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 "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "content/public/browser/render_frame_host.h" | 29 #include "content/public/browser/render_frame_host.h" |
| 30 #include "content/public/browser/render_process_host.h" | 30 #include "content/public/browser/render_process_host.h" |
| 31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/common/media_stream_request.h" | 32 #include "content/public/common/media_stream_request.h" |
| 33 #include "extensions/common/constants.h" | 33 #include "extensions/common/constants.h" |
| 34 #include "extensions/features/features.h" | 34 #include "extensions/features/features.h" |
| 35 #include "media/base/media_switches.h" | 35 #include "media/base/media_switches.h" |
| 36 | 36 |
| 37 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 38 #include "ash/shell.h" | 38 #include "ash/shell.h" |
| 39 #include "chrome/browser/media/webrtc/public_session_tab_capture_access_handler.
h" |
| 39 #endif // defined(OS_CHROMEOS) | 40 #endif // defined(OS_CHROMEOS) |
| 40 | 41 |
| 41 #if BUILDFLAG(ENABLE_EXTENSIONS) | 42 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 42 #include "chrome/browser/media/extension_media_access_handler.h" | 43 #include "chrome/browser/media/extension_media_access_handler.h" |
| 43 #include "chrome/browser/media/webrtc/desktop_capture_access_handler.h" | 44 #include "chrome/browser/media/webrtc/desktop_capture_access_handler.h" |
| 44 #include "chrome/browser/media/webrtc/tab_capture_access_handler.h" | 45 #include "chrome/browser/media/webrtc/tab_capture_access_handler.h" |
| 45 #include "extensions/browser/extension_registry.h" | 46 #include "extensions/browser/extension_registry.h" |
| 46 #include "extensions/common/extension.h" | 47 #include "extensions/common/extension.h" |
| 47 #include "extensions/common/permissions/permissions_data.h" | 48 #include "extensions/common/permissions/permissions_data.h" |
| 48 #endif | 49 #endif |
| (...skipping 30 matching lines...) Expand all Loading... |
| 79 } | 80 } |
| 80 | 81 |
| 81 MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() | 82 MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher() |
| 82 : is_device_enumeration_disabled_(false), | 83 : is_device_enumeration_disabled_(false), |
| 83 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { | 84 media_stream_capture_indicator_(new MediaStreamCaptureIndicator()) { |
| 84 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 85 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 85 | 86 |
| 86 #if BUILDFLAG(ENABLE_EXTENSIONS) | 87 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 87 media_access_handlers_.push_back(new ExtensionMediaAccessHandler()); | 88 media_access_handlers_.push_back(new ExtensionMediaAccessHandler()); |
| 88 media_access_handlers_.push_back(new DesktopCaptureAccessHandler()); | 89 media_access_handlers_.push_back(new DesktopCaptureAccessHandler()); |
| 90 #if defined(OS_CHROMEOS) |
| 91 // Wrapper around TabCaptureAccessHandler used in Public Sessions. |
| 92 media_access_handlers_.push_back(new PublicSessionTabCaptureAccessHandler()); |
| 93 #else |
| 89 media_access_handlers_.push_back(new TabCaptureAccessHandler()); | 94 media_access_handlers_.push_back(new TabCaptureAccessHandler()); |
| 90 #endif | 95 #endif |
| 96 #endif |
| 91 media_access_handlers_.push_back(new PermissionBubbleMediaAccessHandler()); | 97 media_access_handlers_.push_back(new PermissionBubbleMediaAccessHandler()); |
| 92 } | 98 } |
| 93 | 99 |
| 94 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} | 100 MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher() {} |
| 95 | 101 |
| 96 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( | 102 void MediaCaptureDevicesDispatcher::RegisterProfilePrefs( |
| 97 user_prefs::PrefRegistrySyncable* registry) { | 103 user_prefs::PrefRegistrySyncable* registry) { |
| 98 registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice, | 104 registry->RegisterStringPref(prefs::kDefaultAudioCaptureDevice, |
| 99 std::string()); | 105 std::string()); |
| 100 registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice, | 106 registry->RegisterStringPref(prefs::kDefaultVideoCaptureDevice, |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 #if BUILDFLAG(ENABLE_EXTENSIONS) | 440 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 435 for (MediaAccessHandler* handler : media_access_handlers_) { | 441 for (MediaAccessHandler* handler : media_access_handlers_) { |
| 436 if (handler->SupportsStreamType(stream_type, nullptr)) { | 442 if (handler->SupportsStreamType(stream_type, nullptr)) { |
| 437 ToCaptureAccessHandlerBase(handler)->UpdateCapturingLinkSecured( | 443 ToCaptureAccessHandlerBase(handler)->UpdateCapturingLinkSecured( |
| 438 render_process_id, render_frame_id, page_request_id, is_secure); | 444 render_process_id, render_frame_id, page_request_id, is_secure); |
| 439 break; | 445 break; |
| 440 } | 446 } |
| 441 } | 447 } |
| 442 #endif | 448 #endif |
| 443 } | 449 } |
| OLD | NEW |