From c30a6232df03e1efbd9f3b226777b07e087a1122 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 12 Oct 2020 14:27:29 +0200 Subject: BASELINE: Update Chromium to 85.0.4183.140 Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen --- .../components/permissions/permission_context_base.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'chromium/components/permissions/permission_context_base.cc') diff --git a/chromium/components/permissions/permission_context_base.cc b/chromium/components/permissions/permission_context_base.cc index 0d55900ad8e..0308b2e3ffc 100644 --- a/chromium/components/permissions/permission_context_base.cc +++ b/chromium/components/permissions/permission_context_base.cc @@ -75,6 +75,10 @@ const char kPermissionBlockedFeaturePolicyMessage[] = "%s permission has been blocked because of a Feature Policy applied to the " "current document. See https://goo.gl/EuHzyv for more details."; +const char kPermissionBlockedPortalsMessage[] = + "%s permission has been blocked because it was requested inside a portal. " + "Portals don't currently support permission requests."; + void LogPermissionBlockedMessage(content::WebContents* web_contents, const char* message, ContentSettingsType type) { @@ -164,6 +168,11 @@ void PermissionContextBase::RequestPermission( kPermissionBlockedFeaturePolicyMessage, content_settings_type_); break; + case PermissionStatusSource::PORTAL: + LogPermissionBlockedMessage(web_contents, + kPermissionBlockedPortalsMessage, + content_settings_type_); + break; case PermissionStatusSource::INSECURE_ORIGIN: case PermissionStatusSource::UNSPECIFIED: case PermissionStatusSource::VIRTUAL_URL_DIFFERENT_ORIGIN: @@ -231,6 +240,12 @@ PermissionResult PermissionContextBase::GetPermissionStatus( content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(render_frame_host); + // Permissions are denied for portals. + if (web_contents && web_contents->IsPortal()) { + return PermissionResult(CONTENT_SETTING_BLOCK, + PermissionStatusSource::PORTAL); + } + // Automatically deny all HTTP or HTTPS requests where the virtual URL and // the loaded URL are for different origins. The loaded URL is the one // actually in the renderer, but the virtual URL is the one -- cgit v1.2.1