summaryrefslogtreecommitdiff
path: root/chromium/components/permissions/permission_context_base.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/permissions/permission_context_base.cc
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/permissions/permission_context_base.cc')
-rw-r--r--chromium/components/permissions/permission_context_base.cc15
1 files changed, 15 insertions, 0 deletions
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