Index: chromium-128.0.6613.119/chrome/browser/media/webrtc/capture_policy_utils.cc =================================================================== --- chromium-128.0.6613.119.orig/chrome/browser/media/webrtc/capture_policy_utils.cc +++ chromium-128.0.6613.119/chrome/browser/media/webrtc/capture_policy_utils.cc @@ -63,46 +63,7 @@ void IsMultiCaptureAllowedForAnyOriginOn base::OnceCallback<void(bool)> callback, content::BrowserContext* context, bool is_multi_capture_allowed_for_any_origin_on_main_profile) { - // If the new MultiScreenCaptureAllowedForUrls policy permits access, exit - // early. If not, check the legacy - // GetDisplayMediaSetSelectAllScreensAllowedForUrls policy. - if (is_multi_capture_allowed_for_any_origin_on_main_profile) { - std::move(callback).Run(true); - return; - } - - // TODO(b/329064666): Remove the checks below once the pivot to IWAs is - // complete. - Profile* profile = Profile::FromBrowserContext(context); - if (!profile) { - std::move(callback).Run(false); - return; - } - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - // To ensure that a user is informed at login time that capturing of all - // screens can happen (for privacy reasons), this API is only available on - // primary profiles. - if (!profile->IsMainProfile()) { - std::move(callback).Run(false); - return; - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - - HostContentSettingsMap* host_content_settings_map = - HostContentSettingsMapFactory::GetForProfile(profile); - if (!host_content_settings_map) { std::move(callback).Run(false); - return; - } - ContentSettingsForOneType content_settings = - host_content_settings_map->GetSettingsForOneType( - ContentSettingsType::ALL_SCREEN_CAPTURE); - std::move(callback).Run(base::ranges::any_of( - content_settings, [](const ContentSettingPatternSource& source) { - return source.GetContentSetting() == - ContentSetting::CONTENT_SETTING_ALLOW; - })); } void CheckAllScreensMediaAllowedForIwaResultReceived( @@ -290,58 +251,13 @@ void RegisterProfilePrefs(PrefRegistrySi void CheckGetAllScreensMediaAllowedForAnyOrigin( content::BrowserContext* context, base::OnceCallback<void(bool)> callback) { -#if BUILDFLAG(IS_CHROMEOS) - if (crosapi::mojom::MultiCaptureService* multi_capture_service = - GetMultiCaptureService()) { - multi_capture_service->IsMultiCaptureAllowedForAnyOriginOnMainProfile( - base::BindOnce( - IsMultiCaptureAllowedForAnyOriginOnMainProfileResultReceived, - std::move(callback), context)); - } else { - // If the multi capture service is not available with the required version, - // fall back to the original flow using the deprecated policy. - IsMultiCaptureAllowedForAnyOriginOnMainProfileResultReceived( - std::move(callback), context, /*result=*/false); - } -#else std::move(callback).Run(false); -#endif // BUILDFLAG(IS_CHROMEOS) } void CheckGetAllScreensMediaAllowed(content::BrowserContext* context, const GURL& url, base::OnceCallback<void(bool)> callback) { -#if BUILDFLAG(IS_CHROMEOS_LACROS) - Profile* profile = Profile::FromBrowserContext(context); - if (!profile) { - std::move(callback).Run(false); - return; - } - // To ensure that a user is informed at login time that capturing of all - // screens can happen (for privacy reasons), this API is only available on - // primary profiles. - if (!profile->IsMainProfile()) { - std::move(callback).Run(false); - return; - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - -#if BUILDFLAG(IS_CHROMEOS) - crosapi::mojom::MultiCaptureService* multi_capture_service = - GetMultiCaptureService(); - if (multi_capture_service) { - multi_capture_service->IsMultiCaptureAllowed( - url, base::BindOnce(&CheckAllScreensMediaAllowedForIwaResultReceived, - std::move(callback), std::move(url), context)); - } else { - // If the multi capture service is not available with the required version, - // fall back to the original flow using the deprecated policy. - CheckAllScreensMediaAllowedForIwaResultReceived( - std::move(callback), std::move(url), context, /*result=*/false); - } -#else std::move(callback).Run(false); -#endif // BUILDFLAG(IS_CHROMEOS) } #if !BUILDFLAG(IS_ANDROID)