Add a WebsiteSettingsRegistry and use it to store website settings type names
Right now we have a bunch of arrays lying around the codebase which map
ContentSettingsTypes to various properties of website settings. When a user
adds a new setting, they have to modify each of these maps. We should
consolidate these into a single object which is registered on startup and
contains all properties of website settings.
This CL introduces a WebsiteSettingsRegistry to where website settings are
registered with these properties in WebsiteSettingsInfo objects. Currently
only the ContentSettingsType and string name of the setting are stored.
Two locations in the codebase which previously had separate arrays listing
the string names for each content setting have been changed to use the
WebsiteSettingsRegistry instead.
In followup CLs more properties will be moved into WebsiteSettingsInfo.
BUG=512683
Review URL: https://codereview.chromium.org/1247253003
Cr-Commit-Position: refs/heads/master@{#340651}
diff --git a/components/content_settings.gypi b/components/content_settings.gypi
index df40838..02420888 100644
--- a/components/content_settings.gypi
+++ b/components/content_settings.gypi
@@ -55,6 +55,10 @@
'content_settings/core/browser/local_shared_objects_counter.h',
'content_settings/core/browser/plugins_field_trial.cc',
'content_settings/core/browser/plugins_field_trial.h',
+ 'content_settings/core/browser/website_settings_info.cc',
+ 'content_settings/core/browser/website_settings_info.h',
+ 'content_settings/core/browser/website_settings_registry.cc',
+ 'content_settings/core/browser/website_settings_registry.h',
],
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
'msvs_disabled_warnings': [4267, ],