0

Rename 'whitelist' occurrences in chrome/browser/extensions

Bug: 1097252
Change-Id: I97d977c6017d5ea4be6175484ed1707281892770
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2397044
Reviewed-by: Ben Wells <benwells@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Min Qin <qinmin@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Alex Danilo <adanilo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#806987}
This commit is contained in:
Alex Danilo
2020-09-15 12:03:04 +00:00
committed by Commit Bot
parent 67053526eb
commit a8ed6173f4
76 changed files with 496 additions and 505 deletions
build
chrome
browser
extensions
BUILD.gnactive_tab_permission_granter.cc
activity_log
all_urls_apitest.cc
api
chrome_process_manager_delegate.cc
component_extensions_allowlist
component_loader.cccomponent_loader.hcomponent_loader_unittest.cccontent_capabilities_browsertest.cccrx_installer_browsertest.ccextension_browsertest.ccextension_management.ccextension_management.hextension_service.ccextension_service.hextension_service_test_base.ccextension_service_unittest.ccextension_view_host.ccexternal_component_loader.ccinstall_verifier.hpermissions_updater_unittest.ccshared_module_apitest.ccshared_module_service_unittest.ccstandard_management_policy_provider.hunpacked_installer.cc
updater
window_open_apitest.cc
test
data
extensions
permissions
tools
metrics
histograms
traffic_annotation

@ -29,7 +29,7 @@ file://base/metrics/OWNERS
file://third_party/blink/API_OWNERS
# Extension related files.
file://chrome/browser/extensions/component_extensions_whitelist/EXTENSION_WHITELIST_OWNERS
file://chrome/browser/extensions/component_extensions_allowlist/EXTENSION_ALLOWLIST_OWNERS
file://extensions/common/api/API_OWNERS
# This restriction is in place to avoid accidental addition to our top level

@ -470,8 +470,8 @@ static_library("extensions") {
"chrome_url_request_util.h",
"chrome_zipfile_installer.cc",
"chrome_zipfile_installer.h",
"component_extensions_whitelist/whitelist.cc",
"component_extensions_whitelist/whitelist.h",
"component_extensions_allowlist/allowlist.cc",
"component_extensions_allowlist/allowlist.h",
"component_loader.cc",
"component_loader.h",
"context_menu_matcher.cc",

@ -37,22 +37,22 @@ IPC::Message* CreateUpdateMessage(const GURL& visible_url,
const std::string& extension_id,
const URLPatternSet& new_hosts,
int tab_id,
bool update_whitelist) {
bool update_allowlist) {
return new ExtensionMsg_UpdateTabSpecificPermissions(
visible_url, extension_id, new_hosts, update_whitelist, tab_id);
visible_url, extension_id, new_hosts, update_allowlist, tab_id);
}
// Creates a new IPC message for clearing tab-specific permissions.
IPC::Message* CreateClearMessage(const std::vector<std::string>& ids,
int tab_id,
bool update_whitelist) {
return new ExtensionMsg_ClearTabSpecificPermissions(
ids, update_whitelist, tab_id);
bool update_allowlist) {
return new ExtensionMsg_ClearTabSpecificPermissions(ids, update_allowlist,
tab_id);
}
// Sends a message exactly once to each render process host owning one of the
// given |frame_hosts| and |tab_process|. If |tab_process| doesn't own any of
// the |frame_hosts|, it will not be signaled to update its origin whitelist.
// the |frame_hosts|, it will not be signaled to update its origin allowlist.
void SendMessageToProcesses(
const std::set<content::RenderFrameHost*>& frame_hosts,
content::RenderProcessHost* tab_process,
@ -61,13 +61,13 @@ void SendMessageToProcesses(
for (content::RenderFrameHost* frame_host : frame_hosts) {
content::RenderProcessHost* process_host = frame_host->GetProcess();
if (sent_to_hosts.count(process_host) == 0) {
// Extension processes have to update the origin whitelists.
// Extension processes have to update the origin allowlists.
process_host->Send(create_message.Run(true));
sent_to_hosts.insert(frame_host->GetProcess());
}
}
// If the tab wasn't one of those processes already updated (it likely
// wasn't), update it. Tabs don't need to update the origin whitelist.
// wasn't), update it. Tabs don't need to update the origin allowlist.
if (sent_to_hosts.count(tab_process) == 0)
tab_process->Send(create_message.Run(false));
}

@ -361,7 +361,7 @@ void LogApiActivity(content::BrowserContext* browser_context,
const base::ListValue& args,
Action::ActionType type) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (ActivityLogAPI::IsExtensionWhitelisted(extension_id))
if (ActivityLogAPI::IsExtensionAllowlisted(extension_id))
return;
ActivityLog* activity_log = SafeGetActivityLog(browser_context);
@ -400,7 +400,7 @@ void LogWebRequestActivity(content::BrowserContext* browser_context,
const std::string& api_call,
std::unique_ptr<base::DictionaryValue> details) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (ActivityLogAPI::IsExtensionWhitelisted(extension_id))
if (ActivityLogAPI::IsExtensionAllowlisted(extension_id))
return;
ActivityLog* activity_log = SafeGetActivityLog(browser_context);
@ -563,7 +563,7 @@ void ActivityLog::SetHasListeners(bool has_listeners) {
void ActivityLog::OnExtensionLoaded(content::BrowserContext* browser_context,
const Extension* extension) {
if (!ActivityLogAPI::IsExtensionWhitelisted(extension->id()))
if (!ActivityLogAPI::IsExtensionAllowlisted(extension->id()))
return;
++active_consumers_;
@ -578,7 +578,7 @@ void ActivityLog::OnExtensionLoaded(content::BrowserContext* browser_context,
void ActivityLog::OnExtensionUnloaded(content::BrowserContext* browser_context,
const Extension* extension,
UnloadedExtensionReason reason) {
if (!ActivityLogAPI::IsExtensionWhitelisted(extension->id()))
if (!ActivityLogAPI::IsExtensionAllowlisted(extension->id()))
return;
--active_consumers_;
@ -594,7 +594,7 @@ void ActivityLog::OnExtensionUninstalled(
content::BrowserContext* browser_context,
const Extension* extension,
extensions::UninstallReason reason) {
if (ActivityLogAPI::IsExtensionWhitelisted(extension->id()) &&
if (ActivityLogAPI::IsExtensionAllowlisted(extension->id()) &&
!base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableExtensionActivityLogging) &&
active_consumers_ == 0) {
@ -651,7 +651,7 @@ bool ActivityLog::ShouldLog(const std::string& extension_id) const {
// Do not log for activities from the browser/WebUI, which is indicated by an
// empty extension ID.
return is_active_ && !extension_id.empty() &&
!ActivityLogAPI::IsExtensionWhitelisted(extension_id);
!ActivityLogAPI::IsExtensionAllowlisted(extension_id);
}
void ActivityLog::OnScriptsExecuted(content::WebContents* web_contents,
@ -663,7 +663,7 @@ void ActivityLog::OnScriptsExecuted(content::WebContents* web_contents,
for (auto it = extension_ids.begin(); it != extension_ids.end(); ++it) {
const Extension* extension =
registry->GetExtensionById(it->first, ExtensionRegistry::ENABLED);
if (!extension || ActivityLogAPI::IsExtensionWhitelisted(extension->id()))
if (!extension || ActivityLogAPI::IsExtensionAllowlisted(extension->id()))
continue;
// If OnScriptsExecuted is fired because of tabs.executeScript, the list

@ -96,7 +96,7 @@ class ActivityLog : public BrowserContextKeyedAPI,
void(std::unique_ptr<std::vector<scoped_refptr<Action>>>)> callback);
// ExtensionRegistryObserver.
// We keep track of whether the whitelisted extension is installed; if it is,
// We keep track of whether the allowlisted extension is installed; if it is,
// we want to recompute whether to have logging enabled.
void OnExtensionLoaded(content::BrowserContext* browser_context,
const Extension* extension) override;
@ -205,7 +205,7 @@ class ActivityLog : public BrowserContextKeyedAPI,
// testing_mode_ also causes us to print to the console.
bool testing_mode_;
// Used to track whether the whitelisted extension is installed. If it's
// Used to track whether the allowlisted extension is installed. If it's
// added or removed, enabled_ may change.
ScopedObserver<extensions::ExtensionRegistry,
extensions::ExtensionRegistryObserver>

@ -118,11 +118,10 @@ void ActivityLogPolicy::Util::StripPrivacySensitiveFields(
}
// static
void ActivityLogPolicy::Util::StripArguments(const ApiSet& api_whitelist,
void ActivityLogPolicy::Util::StripArguments(const ApiSet& api_allowlist,
scoped_refptr<Action> action) {
if (api_whitelist.find(
std::make_pair(action->action_type(), action->api_name())) ==
api_whitelist.end()) {
if (api_allowlist.find(std::make_pair(
action->action_type(), action->api_name())) == api_allowlist.end()) {
action->set_args(std::unique_ptr<base::ListValue>());
}
}

@ -89,7 +89,7 @@ class ActivityLogPolicy {
// these methods more convenient from within a policy, but they are public.
class Util {
public:
// A collection of API calls, used to specify whitelists for argument
// A collection of API calls, used to specify allowlists for argument
// filtering.
typedef std::set<std::pair<Action::ActionType, std::string> > ApiSet;
@ -104,9 +104,9 @@ class ActivityLogPolicy {
// call ->Clone() first.
static void StripPrivacySensitiveFields(scoped_refptr<Action> action);
// Strip arguments from most API actions, preserving actions only for a
// whitelisted set. Modifies the Action object in-place.
static void StripArguments(const ApiSet& api_whitelist,
// Strip arguments from most API actions, preserving actions only for an
// allowlisted set. Modifies the Action object in-place.
static void StripArguments(const ApiSet& api_allowlist,
scoped_refptr<Action> action);
// Given a base day (timestamp at local midnight), computes the timestamp

@ -61,25 +61,25 @@ TEST_F(ActivityLogPolicyUtilTest, StripPrivacySensitiveWebRequest) {
// Test that argument values are stripped as appropriate.
TEST_F(ActivityLogPolicyUtilTest, StripArguments) {
ActivityLogPolicy::Util::ApiSet whitelist;
whitelist.insert(
ActivityLogPolicy::Util::ApiSet allowlist;
allowlist.insert(
std::make_pair(Action::ACTION_API_CALL, "tabs.executeScript"));
// API is in whitelist; not stripped.
// API is in allowlist; not stripped.
scoped_refptr<Action> action =
new Action("punky",
base::Time::Now(),
Action::ACTION_API_CALL,
"tabs.executeScript");
action->mutable_args()->AppendString("woof");
ActivityLogPolicy::Util::StripArguments(whitelist, action);
ActivityLogPolicy::Util::StripArguments(allowlist, action);
ASSERT_EQ("[\"woof\"]", ActivityLogPolicy::Util::Serialize(action->args()));
// Not in whitelist: stripped.
// Not in allowlist: stripped.
action = new Action(
"punky", base::Time::Now(), Action::ACTION_API_CALL, "tabs.create");
action->mutable_args()->AppendString("woof");
ActivityLogPolicy::Util::StripArguments(whitelist, action);
ActivityLogPolicy::Util::StripArguments(allowlist, action);
ASSERT_EQ("", ActivityLogPolicy::Util::Serialize(action->args()));
}

@ -427,9 +427,9 @@ TEST_F(ActivityLogTestWithoutSwitch, TestShouldLog) {
// Since the command line switch for logging isn't enabled and there's no
// watchdog app active, the activity log shouldn't log anything.
EXPECT_FALSE(activity_log->ShouldLog(empty_extension->id()));
const char kWhitelistedExtensionId[] = "eplckmlabaanikjjcgnigddmagoglhmp";
const char kAllowlistedExtensionId[] = "eplckmlabaanikjjcgnigddmagoglhmp";
scoped_refptr<const Extension> activity_log_extension =
ExtensionBuilder("Test").SetID(kWhitelistedExtensionId).Build();
ExtensionBuilder("Test").SetID(kAllowlistedExtensionId).Build();
extension_service_->AddExtension(activity_log_extension.get());
// Loading a watchdog app means the activity log should log other extension
// activities...

@ -61,10 +61,10 @@ using extensions::Action;
constexpr base::TimeDelta kCleaningDelay = base::TimeDelta::FromHours(12);
// We should log the arguments to these API calls. Be careful when
// constructing this whitelist to not keep arguments that might compromise
// constructing this allowlist to not keep arguments that might compromise
// privacy by logging too much data to the activity log.
//
// TODO(mvrable): The contents of this whitelist should be reviewed and
// TODO(mvrable): The contents of this allowlist should be reviewed and
// expanded as needed.
struct ApiList {
Action::ActionType type;
@ -173,7 +173,7 @@ CountingPolicy::CountingPolicy(Profile* profile)
url_table_("url_ids"),
retention_time_(base::TimeDelta::FromHours(60)) {
for (size_t i = 0; i < base::size(kAlwaysLog); i++) {
api_arg_whitelist_.insert(
api_arg_allowlist_.insert(
std::make_pair(kAlwaysLog[i].type, kAlwaysLog[i].name));
}
}
@ -205,7 +205,7 @@ void CountingPolicy::QueueAction(scoped_refptr<Action> action) {
if (activity_database()->is_db_valid()) {
action = action->Clone();
Util::StripPrivacySensitiveFields(action);
Util::StripArguments(api_arg_whitelist_, action);
Util::StripArguments(api_arg_allowlist_, action);
// If the current action falls on a different date than the ones in the
// queue, flush the queue out now to prevent any false merging (actions

@ -119,7 +119,7 @@ class CountingPolicy : public ActivityLogDatabasePolicy {
bool CleanStringTables(sql::Database* db);
// API calls for which complete arguments should be logged.
Util::ApiSet api_arg_whitelist_;
Util::ApiSet api_arg_allowlist_;
// Tables for mapping strings to integers for shrinking database storage
// requirements. URLs are kept in a separate table from other strings to

@ -34,13 +34,13 @@ class AllUrlsApiTest : public ExtensionApiTest {
const Extension* content_script() const { return content_script_.get(); }
const Extension* execute_script() const { return execute_script_.get(); }
void WhitelistExtensions() {
void AllowlistExtensions() {
ExtensionsClient::ScriptingAllowlist allowlist;
allowlist.push_back(content_script_->id());
allowlist.push_back(execute_script_->id());
ExtensionsClient::Get()->SetScriptingAllowlist(allowlist);
// Extensions will have certain permissions withheld at initialization if
// they aren't whitelisted, so we need to reload them.
// they aren't allowlisted, so we need to reload them.
ExtensionTestMessageListener listener("execute: ready", false);
extension_service()->ReloadExtension(content_script_->id());
extension_service()->ReloadExtension(execute_script_->id());
@ -78,8 +78,8 @@ class AllUrlsApiTest : public ExtensionApiTest {
DISALLOW_COPY_AND_ASSIGN(AllUrlsApiTest);
};
IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, WhitelistedExtension) {
WhitelistExtensions();
IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, AllowlistedExtension) {
AllowlistExtensions();
auto* bystander = LoadExtension(
test_data_dir_.AppendASCII("all_urls").AppendASCII("bystander"));
@ -98,7 +98,7 @@ IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, WhitelistedExtension) {
NavigateAndWait(test_url);
}
// Test that an extension NOT whitelisted for scripting can ask for <all_urls>
// Test that an extension NOT allowlisted for scripting can ask for <all_urls>
// and run scripts on non-restricted all pages.
IN_PROC_BROWSER_TEST_F(AllUrlsApiTest, RegularExtensions) {
// Now verify we can script a regular http page.

@ -78,7 +78,7 @@ void ActivityLogAPI::Shutdown() {
}
// static
bool ActivityLogAPI::IsExtensionWhitelisted(const std::string& extension_id) {
bool ActivityLogAPI::IsExtensionAllowlisted(const std::string& extension_id) {
// TODO(devlin): Pass in a HashedExtensionId to avoid this conversion.
return FeatureProvider::GetPermissionFeatures()
->GetFeature("activityLogPrivate")

@ -34,8 +34,8 @@ class ActivityLogAPI : public BrowserContextKeyedAPI,
void Shutdown() override;
// Lookup whether the extension ID is whitelisted.
static bool IsExtensionWhitelisted(const std::string& extension_id);
// Lookup whether the extension ID is allowlisted.
static bool IsExtensionAllowlisted(const std::string& extension_id);
private:
friend class BrowserContextKeyedAPIFactory<ActivityLogAPI>;

@ -121,7 +121,7 @@ TEST_F(CryptoTokenPrivateApiTest, CanOriginAssertAppId) {
ASSERT_TRUE(
GetCanOriginAssertAppIdResult(google_origin, gstatic_appid, &result));
EXPECT_TRUE(result);
// Not all gstatic urls are allowed, just those specifically whitelisted.
// Not all gstatic urls are allowed, just those specifically allowlisted.
std::string gstatic_otherurl("https://www.gstatic.com/foobar");
ASSERT_TRUE(
GetCanOriginAssertAppIdResult(google_origin, gstatic_otherurl, &result));

@ -307,7 +307,7 @@ std::unique_ptr<developer::ProfileInfo> DeveloperPrivateAPI::CreateProfileInfo(
prefs->GetBoolean(prefs::kExtensionsUIDeveloperMode);
info->can_load_unpacked =
ExtensionManagementFactory::GetForBrowserContext(profile)
->HasWhitelistedExtension();
->HasAllowlistedExtension();
return info;
}

@ -1247,7 +1247,7 @@ TEST_F(DeveloperPrivateApiUnitTest, LoadUnpackedFailsWithBlocklistingPolicy) {
EXPECT_FALSE(
ExtensionManagementFactory::GetForBrowserContext(browser_context())
->HasWhitelistedExtension());
->HasAllowlistedExtension());
auto info = DeveloperPrivateAPI::CreateProfileInfo(testing_profile());
@ -1262,7 +1262,7 @@ TEST_F(DeveloperPrivateApiUnitTest, LoadUnpackedFailsWithBlocklistingPolicy) {
}
TEST_F(DeveloperPrivateApiUnitTest,
LoadUnpackedWorksWithBlocklistingPolicyAlongWhitelistingPolicy) {
LoadUnpackedWorksWithBlocklistingPolicyAlongAllowlistingPolicy) {
std::unique_ptr<content::WebContents> web_contents(
content::WebContentsTester::CreateTestWebContents(profile(), nullptr));
@ -1282,7 +1282,7 @@ TEST_F(DeveloperPrivateApiUnitTest,
EXPECT_TRUE(
ExtensionManagementFactory::GetForBrowserContext(browser_context())
->HasWhitelistedExtension());
->HasAllowlistedExtension());
auto info = DeveloperPrivateAPI::CreateProfileInfo(testing_profile());

@ -144,7 +144,7 @@ const char kDangerKey[] = "danger";
const char kDangerSafe[] = "safe";
const char kDangerUncommon[] = "uncommon";
const char kDangerUnwanted[] = "unwanted";
const char kDangerWhitelistedByPolicy[] = "whitelistedByPolicy";
const char kDangerAllowlistedByPolicy[] = "allowlistedByPolicy";
const char kDangerAsyncScanning[] = "asyncScanning";
const char kDangerPasswordProtected[] = "passwordProtected";
const char kDangerTooLarge[] = "blockedTooLarge";
@ -185,8 +185,6 @@ const char kUrlRegexKey[] = "urlRegex";
const char kFinalUrlKey[] = "finalUrl";
const char kFinalUrlRegexKey[] = "finalUrlRegex";
// Note: Any change to the danger type strings, should be accompanied by a
// corresponding change to downloads.json.
const char* const kDangerStrings[] = {kDangerSafe,
kDangerFile,
kDangerUrl,
@ -196,7 +194,7 @@ const char* const kDangerStrings[] = {kDangerSafe,
kDangerAccepted,
kDangerHost,
kDangerUnwanted,
kDangerWhitelistedByPolicy,
kDangerAllowlistedByPolicy,
kDangerAsyncScanning,
kDangerPasswordProtected,
kDangerTooLarge,
@ -209,8 +207,6 @@ const char* const kDangerStrings[] = {kDangerSafe,
static_assert(base::size(kDangerStrings) == download::DOWNLOAD_DANGER_TYPE_MAX,
"kDangerStrings should have DOWNLOAD_DANGER_TYPE_MAX elements");
// Note: Any change to the state strings, should be accompanied by a
// corresponding change to downloads.json.
const char* const kStateStrings[] = {
kStateInProgress,
kStateComplete,

@ -90,7 +90,7 @@ class EPKPChallengeMachineKeyTest : public EPKPChallengeKeyTestBase {
// Base 64 encoding of 'challenge'.
const char EPKPChallengeMachineKeyTest::kFuncArgs[] = "[\"Y2hhbGxlbmdl\"]";
TEST_F(EPKPChallengeMachineKeyTest, ExtensionNotAllowed) {
TEST_F(EPKPChallengeMachineKeyTest, ExtensionNotAllowlisted) {
base::ListValue empty_allowlist;
prefs_->Set(prefs::kAttestationExtensionAllowlist, empty_allowlist);
@ -130,7 +130,7 @@ class EPKPChallengeUserKeyTest : public EPKPChallengeKeyTestBase {
// Base 64 encoding of 'challenge', register_key required.
const char EPKPChallengeUserKeyTest::kFuncArgs[] = "[\"Y2hhbGxlbmdl\", true]";
TEST_F(EPKPChallengeUserKeyTest, ExtensionNotAllowed) {
TEST_F(EPKPChallengeUserKeyTest, ExtensionNotAllowlisted) {
base::ListValue empty_allowlist;
prefs_->Set(prefs::kAttestationExtensionAllowlist, empty_allowlist);

@ -267,7 +267,7 @@ bool ChromeFileSystemDelegate::ShowSelectFileDialog(
return false;
// TODO(asargent/benwells) - As a short term remediation for
// crbug.com/179010 we're adding the ability for a whitelisted extension to
// crbug.com/179010 we're adding the ability for a allowlisted extension to
// use this API since chrome.fileBrowserHandler.selectFile is ChromeOS-only.
// Eventually we'd like a better solution and likely this code will go back
// to being platform-app only.
@ -276,7 +276,7 @@ bool ChromeFileSystemDelegate::ShowSelectFileDialog(
// platform apps cannot open the file picker from a background page.
// TODO(michaelpg): As a workaround for https://crbug.com/736930, allow this
// to work from a background page for non-platform apps (which, in practice,
// is restricted to whitelisted extensions).
// is restricted to allowlisted extensions).
if (extension->is_platform_app() &&
!AppWindowRegistry::Get(extension_function->browser_context())
->GetAppWindowForWebContents(web_contents)) {
@ -323,7 +323,7 @@ ChromeFileSystemDelegate::GetGrantVolumesMode(
content::RenderFrameHost* render_frame_host,
const Extension& extension) {
// Only kiosk apps in kiosk sessions can use this API.
// Additionally it is enabled for whitelisted component extensions and apps.
// Additionally it is enabled for allowlisted component extensions and apps.
ConsentProviderDelegate consent_provider_delegate(
Profile::FromBrowserContext(browser_context));
return ConsentProvider(&consent_provider_delegate)

@ -29,9 +29,9 @@ namespace extensions {
namespace {
// List of whitelisted component apps and extensions by their ids for
// List of allowlisted component apps and extensions by their ids for
// chrome.fileSystem.requestFileSystem.
const char* const kRequestFileSystemComponentWhitelist[] = {
const char* const kRequestFileSystemComponentAllowlist[] = {
file_manager::kFileManagerAppId, file_manager::kVideoPlayerAppId,
file_manager::kGalleryAppId, file_manager::kAudioPlayerAppId,
file_manager::kImageLoaderExtensionId, file_manager::kZipArchiverId,
@ -93,15 +93,15 @@ void ConsentProvider::RequestConsent(
ConsentCallback callback) {
DCHECK(IsGrantableForVolume(extension, volume));
// If a whitelisted component, then no need to ask or inform the user.
// If a allowlisted component, then no need to ask or inform the user.
if (extension.location() == Manifest::COMPONENT &&
delegate_->IsWhitelistedComponent(extension)) {
delegate_->IsAllowlistedComponent(extension)) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(std::move(callback), CONSENT_GRANTED));
return;
}
// If a whitelisted app or extensions to access Downloads folder, then no
// If a allowlisted app or extensions to access Downloads folder, then no
// need to ask or inform the user.
if (volume.get() &&
volume->type() == file_manager::VOLUME_TYPE_DOWNLOADS_DIRECTORY &&
@ -135,21 +135,21 @@ void ConsentProvider::RequestConsent(
FileSystemDelegate::GrantVolumesMode ConsentProvider::GetGrantVolumesMode(
const Extension& extension) {
const bool is_whitelisted_component =
delegate_->IsWhitelistedComponent(extension);
const bool is_allowlisted_component =
delegate_->IsAllowlistedComponent(extension);
const bool is_running_in_kiosk_session =
KioskModeInfo::IsKioskOnly(&extension) &&
user_manager::UserManager::Get()->IsLoggedInAsKioskApp();
if (is_whitelisted_component || is_running_in_kiosk_session) {
if (is_allowlisted_component || is_running_in_kiosk_session) {
return FileSystemDelegate::kGrantAll;
}
const bool is_whitelisted_non_component =
const bool is_allowlisted_non_component =
delegate_->HasRequestDownloadsPermission(extension);
return is_whitelisted_non_component ? FileSystemDelegate::kGrantPerVolume
return is_allowlisted_non_component ? FileSystemDelegate::kGrantPerVolume
: FileSystemDelegate::kGrantNone;
}
@ -245,10 +245,10 @@ bool ConsentProviderDelegate::IsAutoLaunched(const Extension& extension) {
app_info.was_auto_launched_with_zero_delay;
}
bool ConsentProviderDelegate::IsWhitelistedComponent(
bool ConsentProviderDelegate::IsAllowlistedComponent(
const Extension& extension) {
for (auto* whitelisted_id : kRequestFileSystemComponentWhitelist) {
if (extension.id().compare(whitelisted_id) == 0)
for (auto* allowlisted_id : kRequestFileSystemComponentAllowlist) {
if (extension.id().compare(allowlisted_id) == 0)
return true;
}
return false;

@ -29,7 +29,7 @@ class ScopedSkipRequestFileSystemDialog;
namespace file_system_api {
// Requests consent for the chrome.fileSystem.requestFileSystem() method.
// Interaction with UI and environmental checks (kiosk mode, whitelist) are
// Interaction with UI and environmental checks (kiosk mode, allowlist) are
// provided by a delegate: ConsentProviderDelegate. For testing, it is
// TestingConsentProviderDelegate.
// This class may post callbacks given to it, but does not asynchronously call
@ -61,8 +61,8 @@ class ConsentProvider {
// Checks if the extension was launched in auto-launch kiosk mode.
virtual bool IsAutoLaunched(const Extension& extension) = 0;
// Checks if the extension is a whitelisted component extension or app.
virtual bool IsWhitelistedComponent(const Extension& extension) = 0;
// Checks if the extension is a allowlisted component extension or app.
virtual bool IsAllowlistedComponent(const Extension& extension) = 0;
// Checks if the extension has the permission to access Downloads.
virtual bool HasRequestDownloadsPermission(const Extension& extension) = 0;
@ -95,7 +95,7 @@ class ConsentProvider {
DISALLOW_COPY_AND_ASSIGN(ConsentProvider);
};
// Handles interaction with user as well as environment checks (whitelists,
// Handles interaction with user as well as environment checks (allowlists,
// context of running extensions) for ConsentProvider.
class ConsentProviderDelegate : public ConsentProvider::DelegateInterface {
public:
@ -120,7 +120,7 @@ class ConsentProviderDelegate : public ConsentProvider::DelegateInterface {
const base::WeakPtr<file_manager::Volume>& volume,
bool writable) override;
bool IsAutoLaunched(const Extension& extension) override;
bool IsWhitelistedComponent(const Extension& extension) override;
bool IsAllowlistedComponent(const Extension& extension) override;
bool HasRequestDownloadsPermission(const Extension& extension) override;
Profile* const profile_;

@ -52,9 +52,9 @@ class TestingConsentProviderDelegate
is_auto_launched_ = is_auto_launched;
}
// Sets a whitelisted components list with a single id.
void SetComponentWhitelist(const std::string& extension_id) {
whitelisted_component_id_ = extension_id;
// Sets an allowlisted components list with a single id.
void SetComponentAllowlist(const std::string& extension_id) {
allowlisted_component_id_ = extension_id;
}
int show_dialog_counter() const { return show_dialog_counter_; }
@ -81,8 +81,8 @@ class TestingConsentProviderDelegate
return is_auto_launched_;
}
bool IsWhitelistedComponent(const extensions::Extension& extension) override {
return whitelisted_component_id_.compare(extension.id()) == 0;
bool IsAllowlistedComponent(const extensions::Extension& extension) override {
return allowlisted_component_id_.compare(extension.id()) == 0;
}
bool HasRequestDownloadsPermission(const Extension& extension) override {
@ -94,7 +94,7 @@ class TestingConsentProviderDelegate
int show_notification_counter_;
ui::DialogButton dialog_button_;
bool is_auto_launched_;
std::string whitelisted_component_id_;
std::string allowlisted_component_id_;
DISALLOW_COPY_AND_ASSIGN(TestingConsentProviderDelegate);
};
@ -142,7 +142,7 @@ class FileSystemApiConsentProviderTest : public testing::Test {
};
TEST_F(FileSystemApiConsentProviderTest, ForNonKioskApps) {
// Component apps are not granted unless they are whitelisted.
// Component apps are not granted unless they are allowlisted.
{
scoped_refptr<const Extension> component_extension(
ExtensionBuilder("Test", ExtensionBuilder::Type::PLATFORM_APP)
@ -154,21 +154,21 @@ TEST_F(FileSystemApiConsentProviderTest, ForNonKioskApps) {
FileSystemDelegate::kGrantNone);
}
// Whitelisted component apps are instantly granted access without asking
// Allowlisted component apps are instantly granted access without asking
// user.
{
scoped_refptr<const Extension> whitelisted_component_extension(
scoped_refptr<const Extension> allowlisted_component_extension(
ExtensionBuilder("Test", ExtensionBuilder::Type::PLATFORM_APP)
.SetLocation(Manifest::COMPONENT)
.Build());
TestingConsentProviderDelegate delegate;
delegate.SetComponentWhitelist(whitelisted_component_extension->id());
delegate.SetComponentAllowlist(allowlisted_component_extension->id());
ConsentProvider provider(&delegate);
EXPECT_EQ(provider.GetGrantVolumesMode(*whitelisted_component_extension),
EXPECT_EQ(provider.GetGrantVolumesMode(*allowlisted_component_extension),
FileSystemDelegate::kGrantAll);
ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE;
provider.RequestConsent(*whitelisted_component_extension.get(), nullptr,
provider.RequestConsent(*allowlisted_component_extension.get(), nullptr,
volume_, true /* writable */,
base::BindOnce(&OnConsentReceived, &result));
base::RunLoop().RunUntilIdle();
@ -178,25 +178,25 @@ TEST_F(FileSystemApiConsentProviderTest, ForNonKioskApps) {
EXPECT_EQ(ConsentProvider::CONSENT_GRANTED, result);
}
// Whitelisted extensions are instantly granted downloads access without
// Allowlisted extensions are instantly granted downloads access without
// asking user.
{
scoped_refptr<const Extension> whitelisted_extension(
scoped_refptr<const Extension> allowlisted_extension(
ExtensionBuilder("Test", ExtensionBuilder::Type::PLATFORM_APP)
.SetLocation(Manifest::COMPONENT)
.AddPermission("fileSystem.requestDownloads")
.Build());
TestingConsentProviderDelegate delegate;
ConsentProvider provider(&delegate);
EXPECT_EQ(provider.GetGrantVolumesMode(*whitelisted_extension),
EXPECT_EQ(provider.GetGrantVolumesMode(*allowlisted_extension),
FileSystemDelegate::kGrantPerVolume);
EXPECT_FALSE(
provider.IsGrantableForVolume(*whitelisted_extension, volume_));
EXPECT_TRUE(provider.IsGrantableForVolume(*whitelisted_extension,
provider.IsGrantableForVolume(*allowlisted_extension, volume_));
EXPECT_TRUE(provider.IsGrantableForVolume(*allowlisted_extension,
download_volume_->AsWeakPtr()));
ConsentProvider::Consent result = ConsentProvider::CONSENT_IMPOSSIBLE;
provider.RequestConsent(*whitelisted_extension.get(), nullptr,
provider.RequestConsent(*allowlisted_extension.get(), nullptr,
download_volume_->AsWeakPtr(), true /* writable */,
base::BindRepeating(&OnConsentReceived, &result));
base::RunLoop().RunUntilIdle();

@ -502,7 +502,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem, NotKioskSession) {
}
IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem,
WhitelistedComponent) {
AllowlistedComponent) {
ScopedSkipRequestFileSystemDialog dialog_skipper(ui::DIALOG_BUTTON_CANCEL);
ASSERT_TRUE(RunPlatformAppTestWithFlags(
"api_test/file_system/request_file_system_whitelisted_component",
@ -511,7 +511,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem,
}
IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem,
NotWhitelistedComponent) {
NotAllowlistedComponent) {
ScopedSkipRequestFileSystemDialog dialog_skipper(ui::DIALOG_BUTTON_OK);
ASSERT_TRUE(RunPlatformAppTestWithFlags(
"api_test/file_system/request_file_system_not_whitelisted_component",
@ -547,7 +547,7 @@ IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem,
}
IN_PROC_BROWSER_TEST_F(FileSystemApiTestForRequestFileSystem,
WhitelistedExtensionForDownloads) {
AllowlistedExtensionForDownloads) {
ScopedSkipRequestFileSystemDialog dialog_skipper(ui::DIALOG_BUTTON_CANCEL);
ASSERT_TRUE(RunPlatformAppTestWithFlags(
"api_test/file_system/request_downloads_whitelisted_extension", kFlagNone,

@ -2962,9 +2962,9 @@ class GetAuthTokenFunctionPublicSessionTest : public GetAuthTokenFunctionTest {
chromeos::MockUserManager* user_manager_;
};
IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, NonWhitelisted) {
IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, NonAllowlisted) {
// GetAuthToken() should return UserNotSignedIn in public sessions for
// non-whitelisted extensions.
// non-allowlisted extensions.
user_manager::ScopedUserManager user_manager_enabler(
base::WrapUnique(user_manager_));
scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());
@ -2976,11 +2976,11 @@ IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, NonWhitelisted) {
EXPECT_FALSE(func->scope_ui_shown());
histogram_tester()->ExpectUniqueSample(
kGetAuthTokenResultHistogramName,
IdentityGetAuthTokenError::State::kNotWhitelistedInPublicSession, 1);
IdentityGetAuthTokenError::State::kNotAllowlistedInPublicSession, 1);
}
IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, Whitelisted) {
// GetAuthToken() should return a token for whitelisted extensions.
IN_PROC_BROWSER_TEST_F(GetAuthTokenFunctionPublicSessionTest, Allowlisted) {
// GetAuthToken() should return a token for allowlisted extensions.
user_manager::ScopedUserManager user_manager_enabler(
base::WrapUnique(user_manager_));
scoped_refptr<FakeGetAuthTokenFunction> func(new FakeGetAuthTokenFunction());

@ -80,7 +80,7 @@ std::string IdentityGetAuthTokenError::ToString() const {
case State::kRemoteConsentFlowRejected:
return identity_constants::kUserRejected;
case State::kUserNotSignedIn:
case State::kNotWhitelistedInPublicSession:
case State::kNotAllowlistedInPublicSession:
case State::kSignInFailed:
case State::kRemoteConsentUserNotSignedIn:
return identity_constants::kUserNotSignedIn;

@ -31,7 +31,7 @@ class IdentityGetAuthTokenError {
kGaiaFlowRejected = 12,
kRemoteConsentFlowRejected = 13,
kUserNotSignedIn = 14,
kNotWhitelistedInPublicSession = 15,
kNotAllowlistedInPublicSession = 15,
kSignInFailed = 16,
kRemoteConsentUserNotSignedIn = 17,
kUserNonPrimary = 18,

@ -261,9 +261,9 @@ void IdentityGetAuthTokenFunction::OnReceivedExtensionAccountInfo(
user_manager::UserManager::Get()->IsLoggedInAsPublicAccount();
if (connector->IsEnterpriseManaged() && (is_kiosk || is_public_session)) {
if (is_public_session && !IsOriginWhitelistedInPublicSession()) {
if (is_public_session && !IsOriginAllowlistedInPublicSession()) {
CompleteFunctionWithError(IdentityGetAuthTokenError(
IdentityGetAuthTokenError::State::kNotWhitelistedInPublicSession));
IdentityGetAuthTokenError::State::kNotAllowlistedInPublicSession));
return;
}
@ -490,10 +490,10 @@ void IdentityGetAuthTokenFunction::StartMintToken(
#if defined(OS_CHROMEOS)
// Always force minting token for ChromeOS kiosk app and public session.
if (user_manager::UserManager::Get()->IsLoggedInAsPublicAccount() &&
!IsOriginWhitelistedInPublicSession()) {
!IsOriginAllowlistedInPublicSession()) {
CompleteFunctionWithError(
IdentityGetAuthTokenError(IdentityGetAuthTokenError::State::
kNotWhitelistedInPublicSession));
kNotAllowlistedInPublicSession));
return;
}
@ -513,7 +513,7 @@ void IdentityGetAuthTokenFunction::StartMintToken(
#endif
if (oauth2_info.auto_approve)
// oauth2_info.auto_approve is protected by a whitelist in
// oauth2_info.auto_approve is protected by an allowlist in
// _manifest_features.json hence only selected extensions take
// advantage of forcefully minting the token.
gaia_mint_token_mode_ = OAuth2MintTokenFlow::MODE_MINT_TOKEN_FORCE;
@ -951,7 +951,7 @@ void IdentityGetAuthTokenFunction::StartDeviceAccessTokenRequest() {
device_access_token_request_ = service->StartAccessTokenRequest(scopes, this);
}
bool IdentityGetAuthTokenFunction::IsOriginWhitelistedInPublicSession() {
bool IdentityGetAuthTokenFunction::IsOriginAllowlistedInPublicSession() {
DCHECK(extension());
GURL extension_url = extension()->url();
for (size_t i = 0; i < base::size(kPublicSessionAllowedOrigins); i++) {

@ -206,10 +206,10 @@ class IdentityGetAuthTokenFunction : public ExtensionFunction,
// Starts a login access token request for device robot account. This method
// will be called only in Chrome OS for:
// 1. Enterprise kiosk mode.
// 2. Whitelisted first party apps in public session.
// 2. Allowlisted first party apps in public session.
virtual void StartDeviceAccessTokenRequest();
bool IsOriginWhitelistedInPublicSession();
bool IsOriginAllowlistedInPublicSession();
#endif
// Methods for invoking UI. Overridable for testing.

@ -103,7 +103,7 @@ void WriteFromUrlOperation::Download(base::OnceClosure continuation) {
cookies_store: "user"
setting:
"This feature cannot be disabled by settings, it can only be used "
"by whitelisted apps/extension."
"by allowlisted apps/extension."
policy_exception_justification:
"Not implemented, considered not useful."
})");

@ -23,12 +23,12 @@ namespace mdns = api::mdns;
namespace {
// Whitelisted mDNS service types.
// Allowlisted mDNS service types.
const char kCastServiceType[] = "_googlecast._tcp.local";
const char kPrivetServiceType[] = "_privet._tcp.local";
const char kTestServiceType[] = "_testing._tcp.local";
bool IsServiceTypeWhitelisted(const std::string& service_type) {
bool IsServiceTypeAllowlisted(const std::string& service_type) {
return service_type == kCastServiceType ||
service_type == kPrivetServiceType ||
service_type == kTestServiceType;
@ -179,7 +179,7 @@ void MDnsAPI::OnDnsSdEvent(const std::string& service_type,
// TODO(justinlin): To avoid having listeners without filters getting all
// events, modify API to have this event require filters.
// TODO(reddaly): If event isn't on whitelist, ensure it does not get
// TODO(reddaly): If event isn't on allowlist, ensure it does not get
// broadcast to extensions.
extensions::EventRouter::Get(browser_context_)
->BroadcastEvent(std::move(event));
@ -198,7 +198,7 @@ bool MDnsAPI::IsMDnsAllowed(const std::string& extension_id,
->enabled_extensions()
.GetByID(extension_id);
return (extension && (extension->is_platform_app() ||
IsServiceTypeWhitelisted(service_type)));
IsServiceTypeAllowlisted(service_type)));
}
void MDnsAPI::GetValidOnServiceListListeners(
@ -218,7 +218,7 @@ void MDnsAPI::GetValidOnServiceListListeners(
continue;
// Don't listen for services associated only with disabled extensions
// or non-whitelisted, non-platform-app extensions.
// or non-allowlisted, non-platform-app extensions.
if (!IsMDnsAllowed(listener->extension_id(), service_type))
continue;

@ -346,20 +346,20 @@ TEST_F(MDnsAPIMaxServicesTest, OnServiceListDoesNotExceedLimit) {
dns_sd_registry()->DispatchMDnsEvent("_testing._tcp.local", services);
}
TEST_F(MDnsAPITest, ExtensionRespectsWhitelist) {
TEST_F(MDnsAPITest, ExtensionRespectsAllowlist) {
scoped_refptr<extensions::Extension> extension =
CreateExtension("Dinosaur networker", false, kExtId);
ExtensionRegistry::Get(browser_context())->AddEnabled(extension);
ASSERT_EQ(Manifest::TYPE_EXTENSION, extension->GetType());
// There is a whitelist of mdns service types extensions may access, which
// includes "_testing._tcp.local" and exludes "_trex._tcp.local"
// There is a allowlist of mdns service types extensions may access, which
// includes "_testing._tcp.local" and excludes "_trex._tcp.local"
{
base::DictionaryValue filter;
filter.SetString(kEventFilterServiceTypeKey, "_trex._tcp.local");
ASSERT_TRUE(dns_sd_registry());
// Test that the extension is able to listen to a non-whitelisted service
// Test that the extension is able to listen to a non-allowlisted service
EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener("_trex._tcp.local"))
.Times(0);
EventRouter::Get(browser_context())
@ -379,7 +379,7 @@ TEST_F(MDnsAPITest, ExtensionRespectsWhitelist) {
filter.SetString(kEventFilterServiceTypeKey, "_testing._tcp.local");
ASSERT_TRUE(dns_sd_registry());
// Test that the extension is able to listen to a whitelisted service
// Test that the extension is able to listen to a allowlisted service
EXPECT_CALL(*dns_sd_registry(),
RegisterDnsSdListener("_testing._tcp.local"));
EventRouter::Get(browser_context())
@ -396,7 +396,7 @@ TEST_F(MDnsAPITest, ExtensionRespectsWhitelist) {
}
}
TEST_F(MDnsAPITest, PlatformAppsNotSubjectToWhitelist) {
TEST_F(MDnsAPITest, PlatformAppsNotSubjectToAllowlist) {
scoped_refptr<extensions::Extension> extension =
CreateExtension("Dinosaur networker", true, kExtId);
ExtensionRegistry::Get(browser_context())->AddEnabled(extension);
@ -406,7 +406,7 @@ TEST_F(MDnsAPITest, PlatformAppsNotSubjectToWhitelist) {
filter.SetString(kEventFilterServiceTypeKey, "_trex._tcp.local");
ASSERT_TRUE(dns_sd_registry());
// Test that the extension is able to listen to a non-whitelisted service
// Test that the extension is able to listen to a non-allowlisted service
EXPECT_CALL(*dns_sd_registry(), RegisterDnsSdListener("_trex._tcp.local"));
EventRouter::Get(browser_context())

@ -148,594 +148,594 @@ PrefsUtil::~PrefsUtil() {}
using CrosSettings = chromeos::CrosSettings;
#endif
const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
static PrefsUtil::TypedPrefMap* s_whitelist = nullptr;
if (s_whitelist)
return *s_whitelist;
s_whitelist = new PrefsUtil::TypedPrefMap();
const PrefsUtil::TypedPrefMap& PrefsUtil::GetAllowlistedKeys() {
static PrefsUtil::TypedPrefMap* s_allowlist = nullptr;
if (s_allowlist)
return *s_allowlist;
s_allowlist = new PrefsUtil::TypedPrefMap();
// Miscellaneous
(*s_whitelist)[::embedder_support::kAlternateErrorPagesEnabled] =
(*s_allowlist)[::embedder_support::kAlternateErrorPagesEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[autofill::prefs::kAutofillProfileEnabled] =
(*s_allowlist)[autofill::prefs::kAutofillProfileEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[autofill::prefs::kAutofillCreditCardEnabled] =
(*s_allowlist)[autofill::prefs::kAutofillCreditCardEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[autofill::prefs::kAutofillCreditCardFidoAuthEnabled] =
(*s_allowlist)[autofill::prefs::kAutofillCreditCardFidoAuthEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[payments::kCanMakePaymentEnabled] =
(*s_allowlist)[payments::kCanMakePaymentEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[bookmarks::prefs::kShowBookmarkBar] =
(*s_allowlist)[bookmarks::prefs::kShowBookmarkBar] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
(*s_whitelist)[::prefs::kUseCustomChromeFrame] =
(*s_allowlist)[::prefs::kUseCustomChromeFrame] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
(*s_whitelist)[::prefs::kShowHomeButton] =
(*s_allowlist)[::prefs::kShowHomeButton] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Appearance settings.
(*s_whitelist)[::prefs::kCurrentThemeID] =
(*s_allowlist)[::prefs::kCurrentThemeID] =
settings_api::PrefType::PREF_TYPE_STRING;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
(*s_whitelist)[::prefs::kUsesSystemTheme] =
(*s_allowlist)[::prefs::kUsesSystemTheme] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
(*s_whitelist)[::prefs::kHomePage] = settings_api::PrefType::PREF_TYPE_URL;
(*s_whitelist)[::prefs::kHomePageIsNewTabPage] =
(*s_allowlist)[::prefs::kHomePage] = settings_api::PrefType::PREF_TYPE_URL;
(*s_allowlist)[::prefs::kHomePageIsNewTabPage] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kWebKitDefaultFixedFontSize] =
(*s_allowlist)[::prefs::kWebKitDefaultFixedFontSize] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kWebKitDefaultFontSize] =
(*s_allowlist)[::prefs::kWebKitDefaultFontSize] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kWebKitMinimumFontSize] =
(*s_allowlist)[::prefs::kWebKitMinimumFontSize] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kWebKitFixedFontFamily] =
(*s_allowlist)[::prefs::kWebKitFixedFontFamily] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kWebKitSansSerifFontFamily] =
(*s_allowlist)[::prefs::kWebKitSansSerifFontFamily] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kWebKitSerifFontFamily] =
(*s_allowlist)[::prefs::kWebKitSerifFontFamily] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kWebKitStandardFontFamily] =
(*s_allowlist)[::prefs::kWebKitStandardFontFamily] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kDefaultCharset] =
(*s_allowlist)[::prefs::kDefaultCharset] =
settings_api::PrefType::PREF_TYPE_STRING;
#if defined(OS_MAC)
(*s_whitelist)[::prefs::kWebkitTabsToLinks] =
(*s_allowlist)[::prefs::kWebkitTabsToLinks] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kConfirmToQuitEnabled] =
(*s_allowlist)[::prefs::kConfirmToQuitEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
(*s_whitelist)[dom_distiller::prefs::kOfferReaderMode] =
(*s_allowlist)[dom_distiller::prefs::kOfferReaderMode] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// On startup.
(*s_whitelist)[::prefs::kRestoreOnStartup] =
(*s_allowlist)[::prefs::kRestoreOnStartup] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kURLsToRestoreOnStartup] =
(*s_allowlist)[::prefs::kURLsToRestoreOnStartup] =
settings_api::PrefType::PREF_TYPE_LIST;
// Downloads settings.
(*s_whitelist)[::prefs::kDownloadDefaultDirectory] =
(*s_allowlist)[::prefs::kDownloadDefaultDirectory] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kPromptForDownload] =
(*s_allowlist)[::prefs::kPromptForDownload] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[drive::prefs::kDisableDrive] =
(*s_allowlist)[drive::prefs::kDisableDrive] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#if defined(OS_CHROMEOS)
(*s_whitelist)[::prefs::kNetworkFileSharesAllowed] =
(*s_allowlist)[::prefs::kNetworkFileSharesAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kMostRecentlyUsedNetworkFileShareURL] =
(*s_allowlist)[::prefs::kMostRecentlyUsedNetworkFileShareURL] =
settings_api::PrefType::PREF_TYPE_STRING;
#endif
// Printing settings.
(*s_whitelist)[::prefs::kLocalDiscoveryNotificationsEnabled] =
(*s_allowlist)[::prefs::kLocalDiscoveryNotificationsEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Miscellaneous. TODO(stevenjb): categorize.
(*s_whitelist)[::prefs::kEnableDoNotTrack] =
(*s_allowlist)[::prefs::kEnableDoNotTrack] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kEnableEncryptedMedia] =
(*s_allowlist)[::prefs::kEnableEncryptedMedia] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::language::prefs::kApplicationLocale] =
(*s_allowlist)[::language::prefs::kApplicationLocale] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kNetworkPredictionOptions] =
(*s_allowlist)[::prefs::kNetworkPredictionOptions] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[password_manager::prefs::kCredentialsEnableService] =
(*s_allowlist)[password_manager::prefs::kCredentialsEnableService] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[password_manager::prefs::kCredentialsEnableAutosignin] =
(*s_allowlist)[password_manager::prefs::kCredentialsEnableAutosignin] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[password_manager::prefs::kPasswordLeakDetectionEnabled] =
(*s_allowlist)[password_manager::prefs::kPasswordLeakDetectionEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Privacy page
(*s_whitelist)[::prefs::kSigninAllowedOnNextStartup] =
(*s_allowlist)[::prefs::kSigninAllowedOnNextStartup] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kDnsOverHttpsMode] =
(*s_allowlist)[::prefs::kDnsOverHttpsMode] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kDnsOverHttpsTemplates] =
(*s_allowlist)[::prefs::kDnsOverHttpsTemplates] =
settings_api::PrefType::PREF_TYPE_STRING;
// Security page
(*s_whitelist)[::kGeneratedPasswordLeakDetectionPref] =
(*s_allowlist)[::kGeneratedPasswordLeakDetectionPref] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSafeBrowsingEnabled] =
(*s_allowlist)[::prefs::kSafeBrowsingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSafeBrowsingEnhanced] =
(*s_allowlist)[::prefs::kSafeBrowsingEnhanced] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSafeBrowsingScoutReportingEnabled] =
(*s_allowlist)[::prefs::kSafeBrowsingScoutReportingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::safe_browsing::kGeneratedSafeBrowsingPref] =
(*s_allowlist)[::safe_browsing::kGeneratedSafeBrowsingPref] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Sync and personalization page.
(*s_whitelist)[::prefs::kSearchSuggestEnabled] =
(*s_allowlist)[::prefs::kSearchSuggestEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)
(*s_allowlist)
[::unified_consent::prefs::kUrlKeyedAnonymizedDataCollectionEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::omnibox::kDocumentSuggestEnabled] =
(*s_allowlist)[::omnibox::kDocumentSuggestEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Languages page
(*s_whitelist)[spellcheck::prefs::kSpellCheckEnable] =
(*s_allowlist)[spellcheck::prefs::kSpellCheckEnable] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[spellcheck::prefs::kSpellCheckDictionaries] =
(*s_allowlist)[spellcheck::prefs::kSpellCheckDictionaries] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[spellcheck::prefs::kSpellCheckForcedDictionaries] =
(*s_allowlist)[spellcheck::prefs::kSpellCheckForcedDictionaries] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[spellcheck::prefs::kSpellCheckBlocklistedDictionaries] =
(*s_allowlist)[spellcheck::prefs::kSpellCheckBlocklistedDictionaries] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[spellcheck::prefs::kSpellCheckUseSpellingService] =
(*s_allowlist)[spellcheck::prefs::kSpellCheckUseSpellingService] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kOfferTranslateEnabled] =
(*s_allowlist)[::prefs::kOfferTranslateEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[language::prefs::kFluentLanguages] =
(*s_allowlist)[language::prefs::kFluentLanguages] =
settings_api::PrefType::PREF_TYPE_LIST;
#if defined(OS_CHROMEOS)
(*s_whitelist)[::prefs::kLanguageImeMenuActivated] =
(*s_allowlist)[::prefs::kLanguageImeMenuActivated] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::prefs::kAssistPersonalInfoEnabled] =
(*s_allowlist)[chromeos::prefs::kAssistPersonalInfoEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::prefs::kEmojiSuggestionEnabled] =
(*s_allowlist)[chromeos::prefs::kEmojiSuggestionEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kLanguageInputMethodSpecificSettings] =
(*s_allowlist)[::prefs::kLanguageInputMethodSpecificSettings] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
#endif
// Nearby Share.
(*s_whitelist)[::prefs::kNearbySharingEnabledPrefName] =
(*s_allowlist)[::prefs::kNearbySharingEnabledPrefName] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kNearbySharingActiveProfilePrefName] =
(*s_allowlist)[::prefs::kNearbySharingActiveProfilePrefName] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kNearbySharingDeviceNamePrefName] =
(*s_allowlist)[::prefs::kNearbySharingDeviceNamePrefName] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kNearbySharingDataUsageName] =
(*s_allowlist)[::prefs::kNearbySharingDataUsageName] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Search page.
(*s_whitelist)[DefaultSearchManager::kDefaultSearchProviderDataPrefName] =
(*s_allowlist)[DefaultSearchManager::kDefaultSearchProviderDataPrefName] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
// Site Settings prefs.
(*s_whitelist)[::content_settings::kCookiePrimarySetting] =
(*s_allowlist)[::content_settings::kCookiePrimarySetting] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::content_settings::kCookieSessionOnly] =
(*s_allowlist)[::content_settings::kCookieSessionOnly] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kCookieControlsMode] =
(*s_allowlist)[::prefs::kCookieControlsMode] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kPluginsAlwaysOpenPdfExternally] =
(*s_allowlist)[::prefs::kPluginsAlwaysOpenPdfExternally] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kEnableDRM] =
(*s_allowlist)[::prefs::kEnableDRM] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kEnableQuietNotificationPermissionUi] =
(*s_allowlist)[::prefs::kEnableQuietNotificationPermissionUi] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Clear browsing data settings.
(*s_whitelist)[browsing_data::prefs::kDeleteBrowsingHistory] =
(*s_allowlist)[browsing_data::prefs::kDeleteBrowsingHistory] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteBrowsingHistoryBasic] =
(*s_allowlist)[browsing_data::prefs::kDeleteBrowsingHistoryBasic] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteDownloadHistory] =
(*s_allowlist)[browsing_data::prefs::kDeleteDownloadHistory] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteCache] =
(*s_allowlist)[browsing_data::prefs::kDeleteCache] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteCacheBasic] =
(*s_allowlist)[browsing_data::prefs::kDeleteCacheBasic] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteCookies] =
(*s_allowlist)[browsing_data::prefs::kDeleteCookies] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteCookiesBasic] =
(*s_allowlist)[browsing_data::prefs::kDeleteCookiesBasic] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeletePasswords] =
(*s_allowlist)[browsing_data::prefs::kDeletePasswords] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteFormData] =
(*s_allowlist)[browsing_data::prefs::kDeleteFormData] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteSiteSettings] =
(*s_allowlist)[browsing_data::prefs::kDeleteSiteSettings] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteHostedAppsData] =
(*s_allowlist)[browsing_data::prefs::kDeleteHostedAppsData] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[browsing_data::prefs::kDeleteTimePeriod] =
(*s_allowlist)[browsing_data::prefs::kDeleteTimePeriod] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[browsing_data::prefs::kDeleteTimePeriodBasic] =
(*s_allowlist)[browsing_data::prefs::kDeleteTimePeriodBasic] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[browsing_data::prefs::kLastClearBrowsingDataTab] =
(*s_allowlist)[browsing_data::prefs::kLastClearBrowsingDataTab] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Accessibility.
(*s_whitelist)[::prefs::kAccessibilityImageLabelsEnabled] =
(*s_allowlist)[::prefs::kAccessibilityImageLabelsEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kAccessibilityCaptionsTextSize] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsTextSize] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kAccessibilityCaptionsTextFont] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsTextFont] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kAccessibilityCaptionsTextColor] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsTextColor] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kAccessibilityCaptionsTextOpacity] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsTextOpacity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kAccessibilityCaptionsBackgroundColor] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsBackgroundColor] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kAccessibilityCaptionsTextShadow] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsTextShadow] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kAccessibilityCaptionsBackgroundOpacity] =
(*s_allowlist)[::prefs::kAccessibilityCaptionsBackgroundOpacity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
#if !defined(OS_ANDROID)
(*s_whitelist)[::prefs::kLiveCaptionEnabled] =
(*s_allowlist)[::prefs::kLiveCaptionEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
#if !defined(OS_CHROMEOS)
(*s_whitelist)[::prefs::kAccessibilityFocusHighlightEnabled] =
(*s_allowlist)[::prefs::kAccessibilityFocusHighlightEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
(*s_whitelist)[::prefs::kCaretBrowsingEnabled] =
(*s_allowlist)[::prefs::kCaretBrowsingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#if defined(OS_CHROMEOS)
// Accounts / Users / People.
(*s_whitelist)[chromeos::kAccountsPrefAllowGuest] =
(*s_allowlist)[chromeos::kAccountsPrefAllowGuest] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kAccountsPrefSupervisedUsersEnabled] =
(*s_allowlist)[chromeos::kAccountsPrefSupervisedUsersEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kAccountsPrefShowUserNamesOnSignIn] =
(*s_allowlist)[chromeos::kAccountsPrefShowUserNamesOnSignIn] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kAccountsPrefAllowNewUser] =
(*s_allowlist)[chromeos::kAccountsPrefAllowNewUser] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kAccountsPrefUsers] =
(*s_allowlist)[chromeos::kAccountsPrefUsers] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[chromeos::prefs::kSecondaryGoogleAccountSigninAllowed] =
(*s_allowlist)[chromeos::prefs::kSecondaryGoogleAccountSigninAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// kEnableAutoScreenLock is read-only.
(*s_whitelist)[ash::prefs::kEnableAutoScreenLock] =
(*s_allowlist)[ash::prefs::kEnableAutoScreenLock] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// kPinUnlockAutosubmitEnabled is read-only.
(*s_whitelist)[prefs::kPinUnlockAutosubmitEnabled] =
(*s_allowlist)[prefs::kPinUnlockAutosubmitEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kMessageCenterLockScreenMode] =
(*s_allowlist)[ash::prefs::kMessageCenterLockScreenMode] =
settings_api::PrefType::PREF_TYPE_STRING;
// Accessibility.
(*s_whitelist)[ash::prefs::kAccessibilitySpokenFeedbackEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilitySpokenFeedbackEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickDelayMs] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickDelayMs] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickEventType] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickEventType] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickRevertToLeftClick] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickRevertToLeftClick] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickStabilizePosition] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickStabilizePosition] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityAutoclickMovementThreshold] =
(*s_allowlist)[ash::prefs::kAccessibilityAutoclickMovementThreshold] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityCaretHighlightEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityCaretHighlightEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityCursorHighlightEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityCursorHighlightEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kShouldAlwaysShowAccessibilityMenu] =
(*s_allowlist)[ash::prefs::kShouldAlwaysShowAccessibilityMenu] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityDictationEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityDictationEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityFocusHighlightEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityFocusHighlightEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityHighContrastEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityHighContrastEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityLargeCursorEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityLargeCursorEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityLargeCursorDipSize] =
(*s_allowlist)[ash::prefs::kAccessibilityLargeCursorDipSize] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityCursorColorEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityCursorColorEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityCursorColor] =
(*s_allowlist)[ash::prefs::kAccessibilityCursorColor] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityScreenMagnifierEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityScreenMagnifierEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityScreenMagnifierScale] =
(*s_allowlist)[ash::prefs::kAccessibilityScreenMagnifierScale] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilitySelectToSpeakEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilitySelectToSpeakEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityStickyKeysEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityStickyKeysEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessSelectKeyCodes] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessSelectKeyCodes] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessSelectSetting] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessSelectSetting] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessNextKeyCodes] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessNextKeyCodes] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessNextSetting] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessNextSetting] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessPreviousKeyCodes] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessPreviousKeyCodes] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessPreviousSetting] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessPreviousSetting] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessAutoScanEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessAutoScanEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilitySwitchAccessAutoScanSpeedMs] =
(*s_allowlist)[ash::prefs::kAccessibilitySwitchAccessAutoScanSpeedMs] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)
(*s_allowlist)
[ash::prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)
(*s_allowlist)
[ash::prefs::kAccessibilitySwitchAccessAutoScanKeyboardSpeedMs] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kAccessibilityVirtualKeyboardEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityVirtualKeyboardEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kAccessibilityMonoAudioEnabled] =
(*s_allowlist)[ash::prefs::kAccessibilityMonoAudioEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Text to Speech.
(*s_whitelist)[::prefs::kTextToSpeechLangToVoiceName] =
(*s_allowlist)[::prefs::kTextToSpeechLangToVoiceName] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
(*s_whitelist)[::prefs::kTextToSpeechRate] =
(*s_allowlist)[::prefs::kTextToSpeechRate] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kTextToSpeechPitch] =
(*s_allowlist)[::prefs::kTextToSpeechPitch] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kTextToSpeechVolume] =
(*s_allowlist)[::prefs::kTextToSpeechVolume] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Guest OS
(*s_whitelist)[crostini::prefs::kCrostiniEnabled] =
(*s_allowlist)[crostini::prefs::kCrostiniEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[crostini::prefs::kCrostiniSharedUsbDevices] =
(*s_allowlist)[crostini::prefs::kCrostiniSharedUsbDevices] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[crostini::prefs::kCrostiniContainers] =
(*s_allowlist)[crostini::prefs::kCrostiniContainers] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[crostini::prefs::kCrostiniPortForwarding] =
(*s_allowlist)[crostini::prefs::kCrostiniPortForwarding] =
settings_api::PrefType::PREF_TYPE_LIST;
(*s_whitelist)[guest_os::prefs::kGuestOSPathsSharedToVms] =
(*s_allowlist)[guest_os::prefs::kGuestOSPathsSharedToVms] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
// Plugin Vm
(*s_whitelist)[plugin_vm::prefs::kPluginVmImageExists] =
(*s_allowlist)[plugin_vm::prefs::kPluginVmImageExists] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[plugin_vm::prefs::kPluginVmPrintersAllowed] =
(*s_allowlist)[plugin_vm::prefs::kPluginVmPrintersAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Android Apps.
(*s_whitelist)[arc::prefs::kArcEnabled] =
(*s_allowlist)[arc::prefs::kArcEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Ambient Mode.
(*s_whitelist)[ash::ambient::prefs::kAmbientModeEnabled] =
(*s_allowlist)[ash::ambient::prefs::kAmbientModeEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Google Assistant.
(*s_whitelist)[chromeos::assistant::prefs::kAssistantConsentStatus] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantConsentStatus] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantDisabledByPolicy] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantDisabledByPolicy] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantEnabled] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantContextEnabled] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantContextEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantHotwordAlwaysOn] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantHotwordAlwaysOn] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantHotwordEnabled] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantHotwordEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantLaunchWithMicOpen] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantLaunchWithMicOpen] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantNotificationEnabled] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantNotificationEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::assistant::prefs::kAssistantQuickAnswersEnabled] =
(*s_allowlist)[chromeos::assistant::prefs::kAssistantQuickAnswersEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Misc.
(*s_whitelist)[::prefs::kUse24HourClock] =
(*s_allowlist)[::prefs::kUse24HourClock] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::language::prefs::kPreferredLanguages] =
(*s_allowlist)[::language::prefs::kPreferredLanguages] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[ash::prefs::kTapDraggingEnabled] =
(*s_allowlist)[ash::prefs::kTapDraggingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kStatsReportingPref] =
(*s_allowlist)[chromeos::kStatsReportingPref] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::chromeos::prefs::kSuggestedContentEnabled] =
(*s_allowlist)[::chromeos::prefs::kSuggestedContentEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kAttestationForContentProtectionEnabled] =
(*s_allowlist)[chromeos::kAttestationForContentProtectionEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[prefs::kRestoreLastLockScreenNote] =
(*s_allowlist)[prefs::kRestoreLastLockScreenNote] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSettingsShowOSBanner] =
(*s_allowlist)[::prefs::kSettingsShowOSBanner] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Bluetooth & Internet settings.
(*s_whitelist)[chromeos::kAllowBluetooth] =
(*s_allowlist)[chromeos::kAllowBluetooth] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[proxy_config::prefs::kUseSharedProxies] =
(*s_allowlist)[proxy_config::prefs::kUseSharedProxies] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::chromeos::kSignedDataRoamingEnabled] =
(*s_allowlist)[::chromeos::kSignedDataRoamingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::ash::prefs::kUserBluetoothAdapterEnabled] =
(*s_allowlist)[::ash::prefs::kUserBluetoothAdapterEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::ash::prefs::kVpnConfigAllowed] =
(*s_allowlist)[::ash::prefs::kVpnConfigAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[arc::prefs::kAlwaysOnVpnPackage] =
(*s_allowlist)[arc::prefs::kAlwaysOnVpnPackage] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[arc::prefs::kAlwaysOnVpnLockdown] =
(*s_allowlist)[arc::prefs::kAlwaysOnVpnLockdown] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Timezone settings.
(*s_whitelist)[chromeos::kSystemTimezone] =
(*s_allowlist)[chromeos::kSystemTimezone] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[prefs::kUserTimezone] =
(*s_allowlist)[prefs::kUserTimezone] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[settings_private::kResolveTimezoneByGeolocationOnOff] =
(*s_allowlist)[settings_private::kResolveTimezoneByGeolocationOnOff] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kPerUserTimezoneEnabled] =
(*s_allowlist)[chromeos::kPerUserTimezoneEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[settings_private::kResolveTimezoneByGeolocationMethodShort] =
(*s_allowlist)[settings_private::kResolveTimezoneByGeolocationMethodShort] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[chromeos::kFineGrainedTimeZoneResolveEnabled] =
(*s_allowlist)[chromeos::kFineGrainedTimeZoneResolveEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[prefs::kSystemTimezoneAutomaticDetectionPolicy] =
(*s_allowlist)[prefs::kSystemTimezoneAutomaticDetectionPolicy] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Ash settings.
(*s_whitelist)[ash::prefs::kAmbientColorEnabled] =
(*s_allowlist)[ash::prefs::kAmbientColorEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kEnableStylusTools] =
(*s_allowlist)[ash::prefs::kEnableStylusTools] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kLaunchPaletteOnEjectEvent] =
(*s_allowlist)[ash::prefs::kLaunchPaletteOnEjectEvent] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kNightLightEnabled] =
(*s_allowlist)[ash::prefs::kNightLightEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kNightLightTemperature] =
(*s_allowlist)[ash::prefs::kNightLightTemperature] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kNightLightScheduleType] =
(*s_allowlist)[ash::prefs::kNightLightScheduleType] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kNightLightCustomStartTime] =
(*s_allowlist)[ash::prefs::kNightLightCustomStartTime] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kNightLightCustomEndTime] =
(*s_allowlist)[ash::prefs::kNightLightCustomEndTime] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[ash::prefs::kDockedMagnifierEnabled] =
(*s_allowlist)[ash::prefs::kDockedMagnifierEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kDockedMagnifierScale] =
(*s_allowlist)[ash::prefs::kDockedMagnifierScale] =
settings_api::PrefType::PREF_TYPE_NUMBER;
// Input method settings.
(*s_whitelist)[::prefs::kLanguagePreloadEngines] =
(*s_allowlist)[::prefs::kLanguagePreloadEngines] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kLanguageEnabledImes] =
(*s_allowlist)[::prefs::kLanguageEnabledImes] =
settings_api::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kLanguageAllowedInputMethods] =
(*s_allowlist)[::prefs::kLanguageAllowedInputMethods] =
settings_api::PrefType::PREF_TYPE_LIST;
// Device settings.
(*s_whitelist)[::prefs::kTapToClickEnabled] =
(*s_allowlist)[::prefs::kTapToClickEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kNaturalScroll] =
(*s_allowlist)[ash::prefs::kNaturalScroll] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kTouchpadSensitivity] =
(*s_allowlist)[::prefs::kTouchpadSensitivity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kTouchpadScrollSensitivity] =
(*s_allowlist)[::prefs::kTouchpadScrollSensitivity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kPrimaryMouseButtonRight] =
(*s_allowlist)[::prefs::kPrimaryMouseButtonRight] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[ash::prefs::kMouseReverseScroll] =
(*s_allowlist)[ash::prefs::kMouseReverseScroll] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kMouseAcceleration] =
(*s_allowlist)[::prefs::kMouseAcceleration] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kMouseScrollAcceleration] =
(*s_allowlist)[::prefs::kMouseScrollAcceleration] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kTouchpadAcceleration] =
(*s_allowlist)[::prefs::kTouchpadAcceleration] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kTouchpadScrollAcceleration] =
(*s_allowlist)[::prefs::kTouchpadScrollAcceleration] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kMouseSensitivity] =
(*s_allowlist)[::prefs::kMouseSensitivity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kMouseScrollSensitivity] =
(*s_allowlist)[::prefs::kMouseScrollSensitivity] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapSearchKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapSearchKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapControlKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapControlKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapAltKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapAltKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapCapsLockKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapCapsLockKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapBackspaceKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapBackspaceKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapAssistantKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapAssistantKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapEscapeKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapEscapeKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapExternalCommandKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapExternalCommandKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageRemapExternalMetaKeyTo] =
(*s_allowlist)[::prefs::kLanguageRemapExternalMetaKeyTo] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::prefs::kLanguageSendFunctionKeys] =
(*s_allowlist)[::prefs::kLanguageSendFunctionKeys] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::ash::prefs::kXkbAutoRepeatEnabled] =
(*s_allowlist)[::ash::prefs::kXkbAutoRepeatEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::ash::prefs::kXkbAutoRepeatDelay] =
(*s_allowlist)[::ash::prefs::kXkbAutoRepeatDelay] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[::ash::prefs::kXkbAutoRepeatInterval] =
(*s_allowlist)[::ash::prefs::kXkbAutoRepeatInterval] =
settings_api::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[chromeos::kDeviceDisplayResolution] =
(*s_allowlist)[chromeos::kDeviceDisplayResolution] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
(*s_whitelist)[chromeos::kDisplayRotationDefault] =
(*s_allowlist)[chromeos::kDisplayRotationDefault] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
(*s_whitelist)[arc::prefs::kArcVisibleExternalStorages] =
(*s_allowlist)[arc::prefs::kArcVisibleExternalStorages] =
settings_api::PrefType::PREF_TYPE_LIST;
// Native Printing settings.
(*s_whitelist)[::prefs::kUserPrintersAllowed] =
(*s_allowlist)[::prefs::kUserPrintersAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#else
(*s_whitelist)[::language::prefs::kAcceptLanguages] =
(*s_allowlist)[::language::prefs::kAcceptLanguages] =
settings_api::PrefType::PREF_TYPE_STRING;
// System settings.
(*s_whitelist)[::prefs::kBackgroundModeEnabled] =
(*s_allowlist)[::prefs::kBackgroundModeEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kHardwareAccelerationModeEnabled] =
(*s_allowlist)[::prefs::kHardwareAccelerationModeEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
// Import data
(*s_whitelist)[::prefs::kImportDialogAutofillFormData] =
(*s_allowlist)[::prefs::kImportDialogAutofillFormData] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kImportDialogBookmarks] =
(*s_allowlist)[::prefs::kImportDialogBookmarks] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kImportDialogHistory] =
(*s_allowlist)[::prefs::kImportDialogHistory] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kImportDialogSavedPasswords] =
(*s_allowlist)[::prefs::kImportDialogSavedPasswords] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kImportDialogSearchEngine] =
(*s_allowlist)[::prefs::kImportDialogSearchEngine] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
// Proxy settings.
(*s_whitelist)[proxy_config::prefs::kProxy] =
(*s_allowlist)[proxy_config::prefs::kProxy] =
settings_api::PrefType::PREF_TYPE_DICTIONARY;
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
(*s_whitelist)[::prefs::kMediaRouterEnableCloudServices] =
(*s_allowlist)[::prefs::kMediaRouterEnableCloudServices] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kUserFeedbackAllowed] =
(*s_allowlist)[::prefs::kUserFeedbackAllowed] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif // BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Media Remoting settings.
(*s_whitelist)[::prefs::kMediaRouterMediaRemotingEnabled] =
(*s_allowlist)[::prefs::kMediaRouterMediaRemotingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#if defined(OS_WIN)
// SwReporter settings.
(*s_whitelist)[::prefs::kSwReporterEnabled] =
(*s_allowlist)[::prefs::kSwReporterEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[::prefs::kSwReporterReportingEnabled] =
(*s_allowlist)[::prefs::kSwReporterReportingEnabled] =
settings_api::PrefType::PREF_TYPE_BOOLEAN;
#endif
return *s_whitelist;
return *s_allowlist;
}
settings_api::PrefType PrefsUtil::GetWhitelistedPrefType(
settings_api::PrefType PrefsUtil::GetAllowlistedPrefType(
const std::string& pref_name) {
const TypedPrefMap& keys = GetWhitelistedKeys();
const TypedPrefMap& keys = GetAllowlistedKeys();
const auto& iter = keys.find(pref_name);
return iter != keys.end() ? iter->second
: settings_api::PrefType::PREF_TYPE_NONE;
@ -782,7 +782,7 @@ std::unique_ptr<settings_api::PrefObject> PrefsUtil::GetCrosSettingsPref(
std::unique_ptr<settings_api::PrefObject> PrefsUtil::GetPref(
const std::string& name) {
if (GetWhitelistedPrefType(name) == settings_api::PrefType::PREF_TYPE_NONE) {
if (GetAllowlistedPrefType(name) == settings_api::PrefType::PREF_TYPE_NONE) {
return nullptr;
}
@ -907,7 +907,7 @@ std::unique_ptr<settings_api::PrefObject> PrefsUtil::GetPref(
settings_private::SetPrefResult PrefsUtil::SetPref(const std::string& pref_name,
const base::Value* value) {
if (GetWhitelistedPrefType(pref_name) ==
if (GetAllowlistedPrefType(pref_name) ==
settings_api::PrefType::PREF_TYPE_NONE) {
return settings_private::SetPrefResult::PREF_NOT_FOUND;
}
@ -1035,7 +1035,7 @@ bool PrefsUtil::RemoveFromListCrosSetting(const std::string& pref_name,
}
bool PrefsUtil::IsPrefTypeURL(const std::string& pref_name) {
return GetWhitelistedPrefType(pref_name) ==
return GetAllowlistedPrefType(pref_name) ==
settings_api::PrefType::PREF_TYPE_URL;
}

@ -29,14 +29,14 @@ class PrefsUtil {
explicit PrefsUtil(Profile* profile);
virtual ~PrefsUtil();
// Gets the list of whitelisted pref keys -- that is, those which correspond
// Gets the list of allowlisted pref keys -- that is, those which correspond
// to prefs that clients of the settingsPrivate API may retrieve and
// manipulate.
const TypedPrefMap& GetWhitelistedKeys();
const TypedPrefMap& GetAllowlistedKeys();
// Returns the pref type for |pref_name| or PREF_TYPE_NONE if not in the
// whitelist.
api::settings_private::PrefType GetWhitelistedPrefType(
// allowlist.
api::settings_private::PrefType GetAllowlistedPrefType(
const std::string& pref_name);
// Gets the value of the pref with the given |name|. Returns a pointer to an

@ -42,7 +42,7 @@ std::unique_ptr<base::Value> SettingsPrivateDelegate::GetPref(
std::unique_ptr<base::Value> SettingsPrivateDelegate::GetAllPrefs() {
std::unique_ptr<base::ListValue> prefs(new base::ListValue());
const TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys();
const TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
for (const auto& it : keys) {
std::unique_ptr<base::Value> pref = GetPref(it.first);
if (!pref->is_none())

@ -41,7 +41,7 @@ class SettingsPrivateDelegate : public KeyedService {
// Gets the value of the pref with the given |name|.
virtual std::unique_ptr<base::Value> GetPref(const std::string& name);
// Gets the values of all whitelisted prefs.
// Gets the values of all allowlisted prefs.
virtual std::unique_ptr<base::Value> GetAllPrefs();
// Gets the value.

@ -50,7 +50,7 @@ void SettingsPrivateEventRouter::Shutdown() {
#if defined(OS_CHROMEOS)
cros_settings_subscription_map_.clear();
#endif
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys();
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
settings_private::GeneratedPrefs* generated_prefs =
settings_private::GeneratedPrefsFactory::GetForBrowserContext(context_);
for (const auto& it : keys) {
@ -94,7 +94,7 @@ void SettingsPrivateEventRouter::StartOrStopListeningForPrefsChanges() {
settings_private::GeneratedPrefs* generated_prefs =
settings_private::GeneratedPrefsFactory::GetForBrowserContext(context_);
if (should_listen && !listening_) {
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys();
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
for (const auto& it : keys) {
std::string pref_name = it.first;
if (prefs_util_->IsCrosSetting(pref_name)) {
@ -117,7 +117,7 @@ void SettingsPrivateEventRouter::StartOrStopListeningForPrefsChanges() {
}
}
} else if (!should_listen && listening_) {
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetWhitelistedKeys();
const PrefsUtil::TypedPrefMap& keys = prefs_util_->GetAllowlistedKeys();
for (const auto& it : keys) {
if (prefs_util_->IsCrosSetting(it.first)) {
#if defined(OS_CHROMEOS)

@ -48,8 +48,7 @@ TEST_F(StreamsPrivateManifestTest, ValidMimeTypesHandlerMIMETypes) {
EXPECT_TRUE(handler->CanHandleMIMEType("text/plain"));
}
TEST_F(StreamsPrivateManifestTest,
MimeTypesHandlerMIMETypesNotWhitelisted) {
TEST_F(StreamsPrivateManifestTest, MimeTypesHandlerMIMETypesNotAllowlisted) {
scoped_refptr<const Extension> extension =
ExtensionBuilder()
.SetManifest(

@ -56,8 +56,8 @@ const char kGrantError[] =
"Extension has not been invoked for the current page (see activeTab "
"permission). Chrome pages cannot be captured.";
const char kNotWhitelistedForOffscreenTabApi[] =
"Extension is not whitelisted for use of the unstable, in-development "
const char kNotAllowlistedForOffscreenTabApi[] =
"Extension is not allowlisted for use of the unstable, in-development "
"chrome.tabCapture.captureOffscreenTab API.";
const char kInvalidStartUrl[] =
"Invalid/Missing/Malformatted starting URL for off-screen tab.";
@ -216,10 +216,10 @@ Browser* GetLastActiveBrowser(const Profile* profile,
} // namespace
// Whitelisted extensions that do not check for a browser action grant because
// Allowlisted extensions that do not check for a browser action grant because
// they provide API's. If there are additional extension ids that need
// whitelisting and are *not* the Media Router extension, add them to a new
// kWhitelist array.
// allowlisting and are *not* the Media Router extension, add them to a new
// kAllowlist array.
const char* const kMediaRouterExtensionIds[] = {
"enhhojjnijigcajfphajepfemndkmdlo", // Dev
"pkedcjkdefgpdelpbcmbmeomcjbeemfm", // Stable
@ -301,7 +301,7 @@ ExtensionFunction::ResponseAction TabCaptureCaptureOffscreenTabFunction::Run() {
TabCapture::CaptureOffscreenTab::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params);
// Make sure the extension is whitelisted for using this API, regardless of
// Make sure the extension is allowlisted for using this API, regardless of
// Chrome channel.
//
// TODO(miu): Use _api_features.json and extensions::Feature library instead.
@ -312,7 +312,7 @@ ExtensionFunction::ResponseAction TabCaptureCaptureOffscreenTabFunction::Run() {
SimpleFeature::IsIdInArray(extension()->id(), kMediaRouterExtensionIds,
base::size(kMediaRouterExtensionIds));
if (!is_allowlisted_extension)
return RespondNow(Error(kNotWhitelistedForOffscreenTabApi));
return RespondNow(Error(kNotAllowlistedForOffscreenTabApi));
const GURL start_url(params->start_url);
if (!IsAcceptableOffscreenTabUrl(start_url))

@ -279,12 +279,12 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, GetUserMediaTest) {
// http://crbug.com/427730
// Make sure tabCapture.capture only works if the tab has been granted
// permission via an extension icon click or the extension is whitelisted.
// permission via an extension icon click or the extension is allowlisted.
IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_ActiveTabPermission) {
ExtensionTestMessageListener before_open_tab("ready1", true);
ExtensionTestMessageListener before_grant_permission("ready2", true);
ExtensionTestMessageListener before_open_new_tab("ready3", true);
ExtensionTestMessageListener before_whitelist_extension("ready4", true);
ExtensionTestMessageListener before_allowlist_extension("ready4", true);
ASSERT_TRUE(RunExtensionSubtest("tab_capture",
"active_tab_permission_test.html"))
@ -312,10 +312,10 @@ IN_PROC_BROWSER_TEST_F(TabCaptureApiTest, DISABLED_ActiveTabPermission) {
browser()->OpenURL(params);
before_open_new_tab.Reply("");
// Add extension to whitelist and make sure capture succeeds.
EXPECT_TRUE(before_whitelist_extension.WaitUntilSatisfied());
// Add extension to allowlist and make sure capture succeeds.
EXPECT_TRUE(before_allowlist_extension.WaitUntilSatisfied());
AddExtensionToCommandLineAllowlist();
before_whitelist_extension.Reply("");
before_allowlist_extension.Reply("");
ResultCatcher catcher;
catcher.RestrictToBrowserContext(browser()->profile());

@ -44,7 +44,7 @@ class TabCapturePerformanceTestBase : public InProcessBrowserTest {
~TabCapturePerformanceTestBase() override;
// SetUp overrides to enable pixel output, configure the embedded test server,
// whitelist the extension loaded by the tests.
// allowlist the extension loaded by the tests.
void SetUp() override;
void SetUpOnMainThread() override;
void SetUpCommandLine(base::CommandLine* command_line) override;

@ -262,7 +262,7 @@ TEST_F(ExtensionWebRequestHelpersTestWithThreadsTest,
chromeos::ScopedTestPublicSessionLoginState login_state;
// Host permission checks are disabled in Public Sessions, instead all URLs
// are whitelisted.
// are allowlisted.
EXPECT_EQ(PermissionsData::PageAccess::kAllowed,
WebRequestPermissions::CanExtensionAccessURL(
permission_helper_, com_policy_extension_->id(), org_url,

@ -91,13 +91,13 @@ content::RenderProcessHost* WebrtcLoggingPrivateFunction::RphFromRequest(
std::string* error) {
// There are 2 ways these API functions can get called.
//
// 1. From a whitelisted component extension on behalf of a page with the
// 1. From an allowlisted component extension on behalf of a page with the
// appropriate origin via a message from that page. In this case, either the
// guest process id or the tab id is on the message received by the component
// extension, and the extension can pass that along in RequestInfo as
// |guest_process_id| or |tab_id|.
//
// 2. From a whitelisted app that hosts a page in a webview. In this case,
// 2. From an allowlisted app that hosts a page in a webview. In this case,
// the app should call these API functions with the |target_webview| flag
// set, from a web contents that has exactly 1 webview .

@ -498,7 +498,7 @@ TEST_F(ExtensionInstallStatusTest, ExtensionBlockedByPermissionsWithUpdateUrl) {
}
TEST_F(ExtensionInstallStatusTest,
ExtensionBlockedByPermissionButWhitelistById) {
ExtensionBlockedByPermissionButAllowlistById) {
SetExtensionSettings(R"({
"*": {
"blocked_permissions": ["storage"]
@ -506,7 +506,7 @@ TEST_F(ExtensionInstallStatusTest,
"installation_mode": "allowed"
}})");
// Per-id whitelisted has higher priority than blocked permissions.
// Per-id allowlisted has higher priority than blocked permissions.
APIPermissionSet api_permissions;
api_permissions.insert(APIPermission::kStorage);
EXPECT_EQ(ExtensionInstallStatus::kInstallable,

@ -671,8 +671,8 @@ void WebstorePrivateBeginInstallWithManifest3Function::
void WebstorePrivateBeginInstallWithManifest3Function::HandleInstallProceed() {
// This gets cleared in CrxInstaller::ConfirmInstall(). TODO(asargent) - in
// the future we may also want to add time-based expiration, where a whitelist
// entry is only valid for some number of minutes.
// the future we may also want to add time-based expiration, where an
// allowlist entry is only valid for some number of minutes.
std::unique_ptr<WebstoreInstaller::Approval> approval(
WebstoreInstaller::Approval::CreateWithNoInstallPrompt(
chrome_details_.GetProfile(), details().id,
@ -812,7 +812,7 @@ WebstorePrivateCompleteInstallFunction::Run() {
AddRef();
// The extension will install through the normal extension install flow, but
// the whitelist entry will bypass the normal permissions install dialog.
// the allowlist entry will bypass the normal permissions install dialog.
scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
chrome_details_.GetProfile(), this, web_contents, params->expected_id,
std::move(approval_), WebstoreInstaller::INSTALL_SOURCE_OTHER);

@ -23,7 +23,7 @@
#if defined(OS_CHROMEOS)
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h"
#include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
#include "chromeos/constants/chromeos_switches.h"
#endif
@ -90,9 +90,9 @@ bool ChromeProcessManagerDelegate::IsExtensionBackgroundPageAllowed(
->GetForceInstallList();
// For the ChromeOS login profile, only allow apps installed by device
// policy or that are explicitly whitelisted.
// policy or that are explicitly allowlisted.
return login_screen_apps_list->HasKey(extension.id()) ||
IsComponentExtensionWhitelistedForSignInProfile(extension.id());
IsComponentExtensionAllowlistedForSignInProfile(extension.id());
}
if (chromeos::ProfileHelper::IsLockScreenAppProfile(profile) &&

@ -1,8 +1,8 @@
# Adding new component extensions requires approval from the Extensions Tech
# Lead. See comment in whitelist.h
# Lead. See comment in allowlist.h
set noparent
file://chrome/browser/extensions/component_extensions_whitelist/EXTENSION_WHITELIST_OWNERS
file://chrome/browser/extensions/component_extensions_allowlist/EXTENSION_ALLOWLIST_OWNERS
# TEAM: extensions-dev@chromium.org
# COMPONENT: Platform>Extensions

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h"
#include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
#include <stddef.h>
@ -24,7 +24,7 @@
namespace extensions {
bool IsComponentExtensionWhitelisted(const std::string& extension_id) {
bool IsComponentExtensionAllowlisted(const std::string& extension_id) {
const char* const kAllowed[] = {
extension_misc::kInAppPaymentsSupportAppId,
extension_misc::kCastExtensionIdRelease,
@ -54,12 +54,12 @@ bool IsComponentExtensionWhitelisted(const std::string& extension_id) {
}
#endif
LOG(ERROR) << "Component extension with id " << extension_id << " not in "
<< "whitelist and is not being loaded as a result.";
<< "allowlist and is not being loaded as a result.";
NOTREACHED();
return false;
}
bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
bool IsComponentExtensionAllowlisted(int manifest_resource_id) {
switch (manifest_resource_id) {
// Please keep the list in alphabetical order.
#if BUILDFLAG(ENABLE_PRINTING)
@ -101,14 +101,14 @@ bool IsComponentExtensionWhitelisted(int manifest_resource_id) {
}
LOG(ERROR) << "Component extension with manifest resource id "
<< manifest_resource_id << " not in whitelist and is not being "
<< manifest_resource_id << " not in allowlist and is not being "
<< "loaded as a result.";
NOTREACHED();
return false;
}
#if defined(OS_CHROMEOS)
bool IsComponentExtensionWhitelistedForSignInProfile(
bool IsComponentExtensionAllowlistedForSignInProfile(
const std::string& extension_id) {
const char* const kAllowed[] = {
extension_misc::kAccessibilityCommonExtensionId,

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_WHITELIST_WHITELIST_H_
#define CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_WHITELIST_WHITELIST_H_
#ifndef CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_ALLOWLIST_ALLOWLIST_H_
#define CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_ALLOWLIST_ALLOWLIST_H_
#include <string>
@ -37,17 +37,17 @@ namespace extensions {
// =============================================================================
// Checks using an extension ID.
bool IsComponentExtensionWhitelisted(const std::string& extension_id);
bool IsComponentExtensionAllowlisted(const std::string& extension_id);
// Checks using resource ID of manifest.
bool IsComponentExtensionWhitelisted(int manifest_resource_id);
bool IsComponentExtensionAllowlisted(int manifest_resource_id);
#if defined(OS_CHROMEOS)
// Checks using extension id for sign in profile.
bool IsComponentExtensionWhitelistedForSignInProfile(
bool IsComponentExtensionAllowlistedForSignInProfile(
const std::string& extension_id);
#endif
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_WHITELIST_WHITELIST_H_
#endif // CHROME_BROWSER_EXTENSIONS_COMPONENT_EXTENSIONS_ALLOWLIST_ALLOWLIST_H_

@ -19,7 +19,7 @@
#include "base/trace_event/trace_event.h"
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h"
#include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
#include "chrome/browser/extensions/data_deleter.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/launch_util.h"
@ -160,7 +160,7 @@ ComponentLoader::ComponentLoader(ExtensionSystem* extension_system,
Profile* profile)
: profile_(profile),
extension_system_(extension_system),
ignore_whitelist_for_testing_(false) {}
ignore_allowlist_for_testing_(false) {}
ComponentLoader::~ComponentLoader() = default;
@ -186,8 +186,8 @@ std::unique_ptr<base::DictionaryValue> ComponentLoader::ParseManifest(
std::string ComponentLoader::Add(int manifest_resource_id,
const base::FilePath& root_directory) {
if (!ignore_whitelist_for_testing_ &&
!IsComponentExtensionWhitelisted(manifest_resource_id))
if (!ignore_allowlist_for_testing_ &&
!IsComponentExtensionAllowlisted(manifest_resource_id))
return std::string();
base::StringPiece manifest_contents =
@ -203,23 +203,23 @@ std::string ComponentLoader::Add(const base::StringPiece& manifest_contents,
std::string ComponentLoader::Add(const base::StringPiece& manifest_contents,
const base::FilePath& root_directory,
bool skip_whitelist) {
bool skip_allowlist) {
// The Value is kept for the lifetime of the ComponentLoader. This is
// required in case LoadAll() is called again.
std::unique_ptr<base::DictionaryValue> manifest =
ParseManifest(manifest_contents);
if (manifest)
return Add(std::move(manifest), root_directory, skip_whitelist);
return Add(std::move(manifest), root_directory, skip_allowlist);
return std::string();
}
std::string ComponentLoader::Add(
std::unique_ptr<base::DictionaryValue> parsed_manifest,
const base::FilePath& root_directory,
bool skip_whitelist) {
bool skip_allowlist) {
ComponentExtensionInfo info(std::move(parsed_manifest), root_directory);
if (!ignore_whitelist_for_testing_ && !skip_whitelist &&
!IsComponentExtensionWhitelisted(info.extension_id))
if (!ignore_allowlist_for_testing_ && !skip_allowlist &&
!IsComponentExtensionAllowlisted(info.extension_id))
return std::string();
component_extensions_.push_back(std::move(info));
@ -323,8 +323,8 @@ void ComponentLoader::AddWithNameAndDescription(
const base::FilePath& root_directory,
const std::string& name_string,
const std::string& description_string) {
if (!ignore_whitelist_for_testing_ &&
!IsComponentExtensionWhitelisted(manifest_resource_id))
if (!ignore_allowlist_for_testing_ &&
!IsComponentExtensionAllowlisted(manifest_resource_id))
return;
base::StringPiece manifest_contents =

@ -122,8 +122,8 @@ class ComponentLoader {
void AddChromeOsSpeechSynthesisExtensions();
#endif
void set_ignore_whitelist_for_testing(bool value) {
ignore_whitelist_for_testing_ = value;
void set_ignore_allowlist_for_testing(bool value) {
ignore_allowlist_for_testing_ = value;
}
private:
@ -159,10 +159,10 @@ class ComponentLoader {
std::string Add(const base::StringPiece& manifest_contents,
const base::FilePath& root_directory,
bool skip_whitelist);
bool skip_allowlist);
std::string Add(std::unique_ptr<base::DictionaryValue> parsed_manifest,
const base::FilePath& root_directory,
bool skip_whitelist);
bool skip_allowlist);
// Loads a registered component extension.
void Load(const ComponentExtensionInfo& info);
@ -225,7 +225,7 @@ class ComponentLoader {
typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions;
RegisteredComponentExtensions component_extensions_;
bool ignore_whitelist_for_testing_;
bool ignore_allowlist_for_testing_;
base::WeakPtrFactory<ComponentLoader> weak_factory_{this};

@ -61,7 +61,7 @@ class ComponentLoaderTest : public testing::Test {
base::CommandLine::ForCurrentProcess(),
base::FilePath() /* install_directory */,
false /* autoupdate_enabled */);
component_loader_.set_ignore_whitelist_for_testing(true);
component_loader_.set_ignore_allowlist_for_testing(true);
}
void SetUp() override {

@ -57,7 +57,7 @@ class ContentCapabilitiesTest : public extensions::ExtensionApiTest {
}
// Builds an extension manifest with the given content_capabilities matches
// and permissions. The extension always has the same (whitelisted) ID.
// and permissions. The extension always has the same (allowlisted) ID.
scoped_refptr<const Extension> LoadExtensionWithCapabilities(
const std::string& matches,
const std::string& permissions,

@ -1034,7 +1034,7 @@ IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest,
#if defined(OS_CHROMEOS)
IN_PROC_BROWSER_TEST_F(ExtensionCrxInstallerTest, KioskOnlyTest) {
base::ScopedAllowBlockingForTesting allow_io;
// kiosk_only is whitelisted from non-chromeos.
// kiosk_only is allowlisted from non-chromeos.
base::FilePath crx_path =
test_data_dir_.AppendASCII("kiosk/kiosk_only.crx");
EXPECT_FALSE(InstallExtension(crx_path, 0));

@ -461,7 +461,7 @@ const Extension* ExtensionBrowserTest::LoadExtensionAsComponentWithManifest(
return NULL;
}
extension_service()->component_loader()->set_ignore_whitelist_for_testing(
extension_service()->component_loader()->set_ignore_allowlist_for_testing(
true);
std::string extension_id =
extension_service()->component_loader()->Add(manifest, path);

@ -153,7 +153,7 @@ ExtensionManagement::GetRecommendedInstallList() const {
return GetInstallListByMode(INSTALLATION_RECOMMENDED);
}
bool ExtensionManagement::HasWhitelistedExtension() const {
bool ExtensionManagement::HasAllowlistedExtension() const {
if (default_settings_->installation_mode != INSTALLATION_BLOCKED &&
default_settings_->installation_mode != INSTALLATION_REMOVED) {
return true;
@ -173,7 +173,7 @@ bool ExtensionManagement::IsInstallationExplicitlyAllowed(
if (it == settings_by_id_.end())
return false;
// Checks if the extension is on the automatically installed list or
// install white-list.
// install allow-list.
InstallationMode mode = it->second->installation_mode;
return mode == INSTALLATION_FORCED || mode == INSTALLATION_RECOMMENDED ||
mode == INSTALLATION_ALLOWED;
@ -202,7 +202,7 @@ bool ExtensionManagement::IsOffstoreInstallAllowed(
if (!url_patterns.MatchesURL(url))
return false;
// The referrer URL must also be whitelisted, unless the URL has the file
// The referrer URL must also be allowlisted, unless the URL has the file
// scheme (there's no referrer for those URLs).
return url.SchemeIsFile() || url_patterns.MatchesURL(referrer_url);
}
@ -351,7 +351,7 @@ void ExtensionManagement::Refresh() {
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kInstallAllowList, true, base::Value::Type::LIST));
// Allow user to use preference to block certain extensions. Note that policy
// managed forcelist or whitelist will always override this.
// managed forcelist or allowlist will always override this.
const base::ListValue* denied_list_pref =
static_cast<const base::ListValue*>(LoadPreference(
pref_names::kInstallDenyList, false, base::Value::Type::LIST));

@ -111,7 +111,7 @@ class ExtensionManagement : public KeyedService {
// Returns |true| if there is at least one extension with
// |INSTALLATION_ALLOWED| as installation mode. This excludes force installed
// extensions.
bool HasWhitelistedExtension() const;
bool HasAllowlistedExtension() const;
// Returns if an extension with id |id| is explicitly allowed by enterprise
// policy or not.

@ -683,7 +683,7 @@ void ExtensionService::LoadExtensionsFromCommandLineFlag(
std::string extension_id;
UnpackedInstaller::Create(this)->LoadFromCommandLine(
base::FilePath(t.token()), &extension_id, false /*only-allow-apps*/);
// Extension id is added to whitelist after its extension is loaded
// Extension id is added to allowlist after its extension is loaded
// because code is executed asynchronously. TODO(michaelpg): Remove this
// assumption so loading extensions does not have to be asynchronous:
// crbug.com/708354.

@ -291,7 +291,7 @@ class ExtensionService : public ExtensionServiceInterface,
// preventing them from ever loading until UnblockAllExtensions is called.
// This state is stored in preferences, so persists until Chrome restarts.
//
// Component, external component and whitelisted policy installed extensions
// Component, external component and allowlisted policy installed extensions
// are exempt from being Blocked (see CanBlockExtension in .cc file).
void BlockAllExtensions();
@ -618,7 +618,7 @@ class ExtensionService : public ExtensionServiceInterface,
// These extensions should appear in registry_.
ExtensionSet greylist_;
// Set of whitelisted enabled extensions loaded from the
// Set of allowlisted enabled extensions loaded from the
// --disable-extensions-except command line flag.
std::set<std::string> disable_flag_exempted_extensions_;

@ -353,7 +353,7 @@ void ExtensionServiceTestBase::CreateExtensionService(
base::CommandLine::ForCurrentProcess(), params.extensions_install_dir,
params.autoupdate_enabled, params.extensions_enabled);
service_->component_loader()->set_ignore_whitelist_for_testing(true);
service_->component_loader()->set_ignore_allowlist_for_testing(true);
// When we start up, we want to make sure there is no external provider,
// since the ExtensionService on Windows will use the Registry as a default

@ -3553,7 +3553,7 @@ TEST_F(ExtensionServiceTest, UnloadBlocklistedExtensionPolicy) {
test_blocklist.SetBlocklistState(good_crx, BLOCKLISTED_MALWARE, true);
content::RunAllTasksUntilIdle();
// The good_crx is blocklisted and the whitelist doesn't negate it.
// The good_crx is blocklisted and the allowlist doesn't negate it.
ASSERT_TRUE(ValidateBooleanPref(good_crx, kPrefBlocklist, true));
EXPECT_EQ(0u, registry()->enabled_extensions().size());
}
@ -4052,7 +4052,7 @@ TEST_F(ExtensionServiceTest, ComponentExtensionAllowlisted) {
// Tests that active permissions are not revoked from component extensions
// by policy when the policy is updated. https://crbug.com/746017.
TEST_F(ExtensionServiceTest, ComponentExtensionWhitelistedPermission) {
TEST_F(ExtensionServiceTest, ComponentExtensionAllowlistedPermission) {
InitializeEmptyExtensionServiceWithTestingPrefs();
// Install a component extension.
@ -6614,19 +6614,17 @@ TEST_F(ExtensionServiceTest, ConcurrentExternalLocalFile) {
EXPECT_FALSE(pending_info->version().IsValid());
}
// This makes sure we can package and install CRX files that use whitelisted
// This makes sure we can package and install CRX files that use allowlisted
// permissions.
TEST_F(ExtensionServiceTest, InstallWhitelistedExtension) {
TEST_F(ExtensionServiceTest, InstallAllowlistedExtension) {
std::string test_id = "hdkklepkcpckhnpgjnmbdfhehckloojk";
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kAllowlistedExtensionID, test_id);
InitializeEmptyExtensionService();
base::FilePath path = data_dir().AppendASCII("permissions");
base::FilePath pem_path = path
.AppendASCII("whitelist.pem");
path = path
.AppendASCII("whitelist");
base::FilePath pem_path = path.AppendASCII("allowlist.pem");
path = path.AppendASCII("allowlist");
const Extension* extension = PackAndInstallCRX(path, pem_path, INSTALL_NEW);
EXPECT_EQ(0u, GetErrors().size());

@ -157,7 +157,7 @@ bool ExtensionViewHost::IsBackgroundPage() const {
content::WebContents* ExtensionViewHost::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
// Whitelist the dispositions we will allow to be opened.
// Allowlist the dispositions we will allow to be opened.
switch (params.disposition) {
case WindowOpenDisposition::SINGLETON_TAB:
case WindowOpenDisposition::NEW_FOREGROUND_TAB:

@ -7,7 +7,7 @@
#include "build/branding_buildflags.h"
#include "build/build_config.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h"
#include "chrome/browser/extensions/component_extensions_allowlist/allowlist.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/extensions/extension_constants.h"
@ -55,7 +55,7 @@ void ExternalComponentLoader::StartLoading() {
void ExternalComponentLoader::AddExternalExtension(
const std::string& extension_id,
base::DictionaryValue* prefs) {
if (!IsComponentExtensionWhitelisted(extension_id))
if (!IsComponentExtensionAllowlisted(extension_id))
return;
prefs->SetString(extension_id + ".external_update_url",

@ -28,7 +28,7 @@ class InstallSigner;
struct InstallSignature;
// This class implements verification that a set of extensions are either from
// the webstore or are whitelisted by enterprise policy. The webstore
// the webstore or are allowlisted by enterprise policy. The webstore
// verification process works by sending a request to a backend server to get a
// signature proving that a set of extensions are verified. This signature is
// written into the extension preferences and is checked for validity when

@ -408,8 +408,8 @@ TEST_F(PermissionsUpdaterTest, RevokingPermissions) {
EXPECT_TRUE(can_access_page(extension, kExampleGoogle));
// Block google.com for the Individual scope.
// Whitelist example.google.com for the Indiviaul scope.
// Leave google.com and example.google.com off both the whitelist and
// Allowlist example.google.com for the Indiviaul scope.
// Leave google.com and example.google.com off both the allowlist and
// blocklist for Default scope.
AddPattern(&policy_blocked_hosts, "*://*.google.com/*");
AddPattern(&policy_allowed_hosts, "*://example.google.com/*");

@ -28,14 +28,13 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModule) {
.AppendASCII("import_non_existent"), 0));
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModuleWhitelist) {
ASSERT_TRUE(LoadExtension(
test_data_dir_.AppendASCII("shared_module")
.AppendASCII("shared_whitelist")));
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModuleAllowlist) {
ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("shared_module")
.AppendASCII("shared_whitelist")));
EXPECT_FALSE(InstallExtension(
test_data_dir_.AppendASCII("shared_module")
.AppendASCII("import_not_in_whitelist"), 0));
EXPECT_FALSE(InstallExtension(test_data_dir_.AppendASCII("shared_module")
.AppendASCII("import_not_in_whitelist"),
0));
}
IN_PROC_BROWSER_TEST_F(ExtensionApiTest, SharedModuleInstallEvent) {

@ -232,11 +232,11 @@ TEST_F(SharedModuleServiceUnitTest, PruneSharedModulesOnUpdate) {
}
TEST_F(SharedModuleServiceUnitTest, WhitelistedImports) {
std::string whitelisted_id = crx_file::id_util::GenerateId("whitelisted");
std::string nonwhitelisted_id =
crx_file::id_util::GenerateId("nonwhitelisted");
// Create a module which exports to a restricted whitelist.
TEST_F(SharedModuleServiceUnitTest, AllowlistedImports) {
std::string allowlisted_id = crx_file::id_util::GenerateId("allowlisted");
std::string nonallowlisted_id =
crx_file::id_util::GenerateId("nonallowlisted");
// Create a module which exports to a restricted allowlist.
std::unique_ptr<base::DictionaryValue> manifest =
DictionaryBuilder()
.Set("name", "Shared Module")
@ -244,8 +244,8 @@ TEST_F(SharedModuleServiceUnitTest, WhitelistedImports) {
.Set("manifest_version", 2)
.Set("export",
DictionaryBuilder()
.Set("whitelist",
ListBuilder().Append(whitelisted_id).Build())
.Set("allowlist",
ListBuilder().Append(allowlisted_id).Build())
.Set("resources", ListBuilder().Append("*").Build())
.Build())
.Build();
@ -258,23 +258,23 @@ TEST_F(SharedModuleServiceUnitTest, WhitelistedImports) {
EXPECT_TRUE(InstallExtension(shared_module.get(), false));
// Create and install an extension with the whitelisted ID.
scoped_refptr<const Extension> whitelisted_extension =
// Create and install an extension with the allowlisted ID.
scoped_refptr<const Extension> allowlisted_extension =
CreateExtensionImportingModules(
std::vector<std::string>(1, shared_module->id()), whitelisted_id,
std::vector<std::string>(1, shared_module->id()), allowlisted_id,
"1.0");
EXPECT_TRUE(InstallExtension(whitelisted_extension.get(), false));
EXPECT_TRUE(InstallExtension(allowlisted_extension.get(), false));
// Try to install an extension with an ID that is not whitelisted.
scoped_refptr<const Extension> nonwhitelisted_extension =
// Try to install an extension with an ID that is not allowlisted.
scoped_refptr<const Extension> nonallowlisted_extension =
CreateExtensionImportingModules(
std::vector<std::string>(1, shared_module->id()), nonwhitelisted_id,
std::vector<std::string>(1, shared_module->id()), nonallowlisted_id,
"1.0");
// This should succeed because only CRX installer (and by extension the
// WebStore Installer) checks the shared module whitelist. InstallExtension
// bypasses the whitelist check because the SharedModuleService does not
// care about whitelists.
EXPECT_TRUE(InstallExtension(nonwhitelisted_extension.get(), false));
// WebStore Installer) checks the shared module allowlist. InstallExtension
// bypasses the allowlist check because the SharedModuleService does not
// care about allowlists.
EXPECT_TRUE(InstallExtension(nonallowlisted_extension.get(), false));
}
TEST_F(SharedModuleServiceUnitTest, PruneMultipleSharedModules) {

@ -16,7 +16,7 @@ class Extension;
class ExtensionManagement;
// The standard management policy provider, which takes into account the
// extension black/whitelists and admin black/whitelists.
// extension block/allowlists and admin block/allowlists.
class StandardManagementPolicyProvider : public ManagementPolicy::Provider {
public:
explicit StandardManagementPolicyProvider(

@ -288,7 +288,7 @@ bool UnpackedInstaller::IsLoadingUnpackedAllowed() const {
if (!service_weak_.get())
return true;
// If there is a "*" in the extension blocklist, then no extensions should be
// allowed at all (except explicitly whitelisted extensions).
// allowed at all (except explicitly allowlisted extensions).
return !ExtensionManagementFactory::GetForBrowserContext(
service_weak_->profile())
->BlocklistedByDefault();

@ -37,7 +37,7 @@ class ChromeExtensionDownloaderFactory {
// non-empty.
//
// |profile_path| is used exclusely to support download of extensions through
// the file:// protocol. In practice, it whitelists specific directories the
// the file:// protocol. In practice, it allowlists specific directories the
// the browser has access to.
static std::unique_ptr<extensions::ExtensionDownloader>
CreateForURLLoaderFactory(

@ -439,7 +439,7 @@ IN_PROC_BROWSER_TEST_F(WindowOpenApiTest, VerifyCommandsInLockedFullscreen) {
EXPECT_FALSE(
browser()->command_controller()->IsCommandEnabled(IDC_ZOOM_PLUS));
// Verify some whitelisted commands.
// Verify some allowlisted commands.
EXPECT_TRUE(browser()->command_controller()->IsCommandEnabled(IDC_COPY));
EXPECT_TRUE(browser()->command_controller()->IsCommandEnabled(IDC_PASTE));
}

@ -33353,7 +33353,7 @@ Called by update_feature_policy_enum.py.-->
<int value="12" label="kGaiaFlowRejected"/>
<int value="13" label="kRemoteConsentFlowRejected"/>
<int value="14" label="kUserNotSignedIn"/>
<int value="15" label="kNotWhitelistedInPublicSession"/>
<int value="15" label="kNotAllowlistedInPublicSession"/>
<int value="16" label="kSignInFailed"/>
<int value="17" label="kRemoteConsentUserNotSignedIn"/>
<int value="18" label="kUserNonPrimary"/>

@ -59,7 +59,7 @@ Refer to README.md for content description and update process.
<item id="content_suggestion_get_favicon" hash_code="16653985" type="0" content_hash_code="134280933" os_list="linux,windows" file_path="components/ntp_snippets/content_suggestions_service.cc"/>
<item id="conversion_measurement_report" hash_code="113422320" type="0" content_hash_code="60688877" os_list="linux,windows" file_path="content/browser/conversions/conversion_network_sender_impl.cc"/>
<item id="credenential_avatar" hash_code="53695122" type="0" content_hash_code="113035371" os_list="linux,windows" file_path="chrome/browser/ui/passwords/account_avatar_fetcher.cc"/>
<item id="cros_recovery_image_download" hash_code="101725581" type="0" content_hash_code="23088027" os_list="linux,windows" file_path="chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc"/>
<item id="cros_recovery_image_download" hash_code="101725581" type="0" content_hash_code="10999698" os_list="linux,windows" file_path="chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc"/>
<item id="cryptauth_device_sync_tickle" hash_code="96565489" type="1" second_id="29188932" deprecated="2018-03-15" content_hash_code="115714668" file_path=""/>
<item id="cryptauth_enrollment_flow_finish" hash_code="54836939" type="1" second_id="29188932" deprecated="2018-04-04" content_hash_code="17060642" file_path=""/>
<item id="cryptauth_enrollment_flow_setup" hash_code="84889397" type="1" second_id="29188932" deprecated="2018-04-04" content_hash_code="128348931" file_path=""/>