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/media_capture_devices_dispatcher.h" | 5 #include "chrome/browser/media/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/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 application_name); | 577 application_name); |
578 chrome::MessageBoxResult result = chrome::ShowMessageBox( | 578 chrome::MessageBoxResult result = chrome::ShowMessageBox( |
579 parent_window, | 579 parent_window, |
580 l10n_util::GetStringFUTF16( | 580 l10n_util::GetStringFUTF16( |
581 IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TITLE, application_name), | 581 IDS_MEDIA_SCREEN_CAPTURE_CONFIRMATION_TITLE, application_name), |
582 confirmation_text, | 582 confirmation_text, |
583 chrome::MESSAGE_BOX_TYPE_QUESTION); | 583 chrome::MESSAGE_BOX_TYPE_QUESTION); |
584 user_approved = (result == chrome::MESSAGE_BOX_RESULT_YES); | 584 user_approved = (result == chrome::MESSAGE_BOX_RESULT_YES); |
585 } | 585 } |
586 | 586 |
| 587 #if defined(OS_ANDROID) |
| 588 // For android, MediaProjectionManager API will start an activity to |
| 589 // prompt the user whether to allow screen capture. So here user_approved |
| 590 // is useless. |
| 591 user_approved = true; |
| 592 #endif |
587 if (user_approved || component_extension || whitelisted_extension) { | 593 if (user_approved || component_extension || whitelisted_extension) { |
588 content::DesktopMediaID screen_id; | 594 content::DesktopMediaID screen_id; |
589 #if defined(OS_CHROMEOS) | 595 #if defined(OS_CHROMEOS) |
590 screen_id = content::DesktopMediaID::RegisterAuraWindow( | 596 screen_id = content::DesktopMediaID::RegisterAuraWindow( |
591 ash::Shell::GetInstance()->GetPrimaryRootWindow()); | 597 ash::Shell::GetInstance()->GetPrimaryRootWindow()); |
592 #else // defined(OS_CHROMEOS) | 598 #else // defined(OS_CHROMEOS) |
593 screen_id = | 599 screen_id = |
594 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, | 600 content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, |
595 webrtc::kFullDesktopScreenId); | 601 webrtc::kFullDesktopScreenId); |
596 #endif // !defined(OS_CHROMEOS) | 602 #endif // !defined(OS_CHROMEOS) |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 | 1073 |
1068 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( | 1074 void MediaCaptureDevicesDispatcher::SetTestAudioCaptureDevices( |
1069 const MediaStreamDevices& devices) { | 1075 const MediaStreamDevices& devices) { |
1070 test_audio_devices_ = devices; | 1076 test_audio_devices_ = devices; |
1071 } | 1077 } |
1072 | 1078 |
1073 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( | 1079 void MediaCaptureDevicesDispatcher::SetTestVideoCaptureDevices( |
1074 const MediaStreamDevices& devices) { | 1080 const MediaStreamDevices& devices) { |
1075 test_video_devices_ = devices; | 1081 test_video_devices_ = devices; |
1076 } | 1082 } |
OLD | NEW |