Commit 29ef1efc authored by Jason Lin's avatar Jason Lin Committed by Commit Bot

Whitelist chrome UI scheme for CLIPBOARD_READ

This will allow the terminal SWA (and other chrome:// pages) to programmatically
read clipboard in the JS code.

Bug: 1019034
Change-Id: I0d838c67593c8499af9fc69c8052b7594bc464fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1954991Reviewed-by: default avatarcalamity <calamity@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722922}
parent eb726b50
......@@ -34,6 +34,11 @@ std::vector<std::string> WhitelistedSchemes() {
return std::vector<std::string>();
}
std::vector<std::string> WhitelistedSchemes(const char* scheme1) {
const char* schemes[] = {scheme1};
return std::vector<std::string>(schemes, schemes + base::size(schemes));
}
std::vector<std::string> WhitelistedSchemes(const char* scheme1,
const char* scheme2) {
const char* schemes[] = {scheme1, scheme2};
......@@ -424,7 +429,7 @@ void ContentSettingsRegistry::Init() {
Register(ContentSettingsType::CLIPBOARD_READ_WRITE, "clipboard",
CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE,
WhitelistedSchemes(),
WhitelistedSchemes(kChromeUIScheme),
ValidSettings(CONTENT_SETTING_ALLOW, CONTENT_SETTING_BLOCK,
CONTENT_SETTING_ASK),
WebsiteSettingsInfo::SINGLE_ORIGIN_ONLY_SCOPE,
......
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