| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/desktop_capture_access_handler.h" | 5 #include "chrome/browser/media/webrtc/desktop_capture_access_handler.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 std::unique_ptr<content::MediaStreamUI> ui; | 157 std::unique_ptr<content::MediaStreamUI> ui; |
| 158 | 158 |
| 159 DVLOG(2) << __func__ << ": media_id " << media_id.ToString() | 159 DVLOG(2) << __func__ << ": media_id " << media_id.ToString() |
| 160 << ", capture_audio " << capture_audio << ", disable_local_echo " | 160 << ", capture_audio " << capture_audio << ", disable_local_echo " |
| 161 << disable_local_echo << ", display_notification " | 161 << disable_local_echo << ", display_notification " |
| 162 << display_notification << ", application_title " | 162 << display_notification << ", application_title " |
| 163 << application_title << ", extension_name " | 163 << application_title << ", extension_name " |
| 164 << registered_extension_name; | 164 << registered_extension_name; |
| 165 | 165 |
| 166 // Add selected desktop source to the list. | 166 // Add selected desktop source to the list. |
| 167 devices->push_back(content::MediaStreamDevice( | 167 devices->push_back( |
| 168 content::MEDIA_DESKTOP_VIDEO_CAPTURE, media_id.ToString(), "Screen")); | 168 content::MediaStreamDevice(content::MEDIA_DESKTOP_VIDEO_CAPTURE, |
| 169 media_id.ToString(), media_id.ToString())); |
| 169 if (capture_audio) { | 170 if (capture_audio) { |
| 170 if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { | 171 if (media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS) { |
| 171 content::WebContentsMediaCaptureId web_id = media_id.web_contents_id; | 172 content::WebContentsMediaCaptureId web_id = media_id.web_contents_id; |
| 172 web_id.disable_local_echo = disable_local_echo; | 173 web_id.disable_local_echo = disable_local_echo; |
| 173 devices->push_back( | 174 devices->push_back( |
| 174 content::MediaStreamDevice(content::MEDIA_DESKTOP_AUDIO_CAPTURE, | 175 content::MediaStreamDevice(content::MEDIA_DESKTOP_AUDIO_CAPTURE, |
| 175 web_id.ToString(), "Tab audio")); | 176 web_id.ToString(), "Tab audio")); |
| 176 } else if (disable_local_echo) { | 177 } else if (disable_local_echo) { |
| 177 // Use the special loopback device ID for system audio capture. | 178 // Use the special loopback device ID for system audio capture. |
| 178 devices->push_back(content::MediaStreamDevice( | 179 devices->push_back(content::MediaStreamDevice( |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 const bool display_notification = ShouldDisplayNotification(extension); | 450 const bool display_notification = ShouldDisplayNotification(extension); |
| 450 | 451 |
| 451 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, | 452 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, |
| 452 request.disable_local_echo, | 453 request.disable_local_echo, |
| 453 display_notification, | 454 display_notification, |
| 454 GetApplicationTitle(web_contents, extension), | 455 GetApplicationTitle(web_contents, extension), |
| 455 base::UTF8ToUTF16(original_extension_name)); | 456 base::UTF8ToUTF16(original_extension_name)); |
| 456 UpdateExtensionTrusted(request, extension); | 457 UpdateExtensionTrusted(request, extension); |
| 457 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui)); | 458 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui)); |
| 458 } | 459 } |
| OLD | NEW |