Commit 53049602 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Register for cookie, image, javascript and sound in chrome://media-app

Currently user settings for default websites that may block these web
features leak into system apps unless explicitly auto-granted.

Bug: b/163088459
Change-Id: I22fb8bfcdd3a83c1a054c663bda0e54f89a6c238
Test: Open an image from ChromeOS Files app after setting chrome://settings/content/javascript to "Blocked"
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2358940
Commit-Queue: dstockwell <dstockwell@google.com>
Commit-Queue: Trent Apted <tapted@chromium.org>
Reviewed-by: default avatardstockwell <dstockwell@google.com>
Cr-Commit-Position: refs/heads/master@{#798534}
parent ca9446ad
...@@ -82,10 +82,15 @@ MediaAppUI::MediaAppUI(content::WebUI* web_ui, ...@@ -82,10 +82,15 @@ MediaAppUI::MediaAppUI(content::WebUI* web_ui,
auto* allowlist = WebUIAllowlist::GetOrCreate(browser_context); auto* allowlist = WebUIAllowlist::GetOrCreate(browser_context);
const url::Origin host_origin = const url::Origin host_origin =
url::Origin::Create(GURL(kChromeUIMediaAppURL)); url::Origin::Create(GURL(kChromeUIMediaAppURL));
allowlist->RegisterAutoGrantedPermission( allowlist->RegisterAutoGrantedPermissions(
host_origin, ContentSettingsType::FILE_SYSTEM_READ_GUARD); host_origin, {
allowlist->RegisterAutoGrantedPermission( ContentSettingsType::COOKIES,
host_origin, ContentSettingsType::FILE_SYSTEM_WRITE_GUARD); ContentSettingsType::FILE_SYSTEM_READ_GUARD,
ContentSettingsType::FILE_SYSTEM_WRITE_GUARD,
ContentSettingsType::IMAGES,
ContentSettingsType::JAVASCRIPT,
ContentSettingsType::SOUND,
});
content::WebUIDataSource* untrusted_source = content::WebUIDataSource* untrusted_source =
CreateMediaAppUntrustedDataSource(delegate_.get()); CreateMediaAppUntrustedDataSource(delegate_.get());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment