Chromium Code Reviews| 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/desktop_capture_access_handler.h" | 5 #include "chrome/browser/media/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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 359 request.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE; | 359 request.audio_type == content::MEDIA_DESKTOP_AUDIO_CAPTURE; |
| 360 | 360 |
| 361 // This value shows for a given capture type, whether the system or our code | 361 // This value shows for a given capture type, whether the system or our code |
| 362 // can support audio sharing. Currently audio is only supported for screen and | 362 // can support audio sharing. Currently audio is only supported for screen and |
| 363 // tab/webcontents capture streams. | 363 // tab/webcontents capture streams. |
| 364 const bool audio_supported = | 364 const bool audio_supported = |
| 365 (media_id.type == content::DesktopMediaID::TYPE_SCREEN && | 365 (media_id.type == content::DesktopMediaID::TYPE_SCREEN && |
| 366 loopback_audio_supported) || | 366 loopback_audio_supported) || |
| 367 media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS; | 367 media_id.type == content::DesktopMediaID::TYPE_WEB_CONTENTS; |
| 368 | 368 |
| 369 const bool has_flag = base::CommandLine::ForCurrentProcess()->HasSwitch( | 369 const bool has_flag = base::CommandLine::ForCurrentProcess()->HasSwitch( |
|
Sergey Ulanov
2016/03/29 18:48:19
See my next comment first, but if you decide to ke
qiangchen
2016/03/29 20:10:44
Done.
I changed to check_audio_permission.
| |
| 370 extensions::switches::kEnableDesktopCaptureAudio); | 370 extensions::switches::kDisableDesktopCaptureAudio); |
| 371 const bool capture_audio = | 371 const bool capture_audio = (!has_flag ? audio_permitted : true) && |
|
Sergey Ulanov
2016/03/29 18:48:19
This looks weird. capture_audio may still be set t
qiangchen
2016/03/29 20:10:44
I found it weird also. Before my change, we do not
Sergey Ulanov
2016/03/30 19:34:22
Audio was supported for rather long time. See crb
| |
| 372 (has_flag ? audio_permitted : true) && audio_requested && audio_supported; | 372 audio_requested && audio_supported; |
| 373 | 373 |
| 374 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, true, | 374 ui = GetDevicesForDesktopCapture(&devices, media_id, capture_audio, true, |
| 375 GetApplicationTitle(web_contents, extension), | 375 GetApplicationTitle(web_contents, extension), |
| 376 base::UTF8ToUTF16(original_extension_name)); | 376 base::UTF8ToUTF16(original_extension_name)); |
| 377 | 377 |
| 378 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui)); | 378 callback.Run(devices, content::MEDIA_DEVICE_OK, std::move(ui)); |
| 379 } | 379 } |
| 380 | 380 |
| 381 void DesktopCaptureAccessHandler::UpdateMediaRequestState( | 381 void DesktopCaptureAccessHandler::UpdateMediaRequestState( |
| 382 int render_process_id, | 382 int render_process_id, |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 405 desktop_capture_sessions_.erase(it); | 405 desktop_capture_sessions_.erase(it); |
| 406 break; | 406 break; |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 } | 409 } |
| 410 } | 410 } |
| 411 | 411 |
| 412 bool DesktopCaptureAccessHandler::IsCaptureInProgress() { | 412 bool DesktopCaptureAccessHandler::IsCaptureInProgress() { |
| 413 return desktop_capture_sessions_.size() > 0; | 413 return desktop_capture_sessions_.size() > 0; |
| 414 } | 414 } |
| OLD | NEW |