summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 13:26:59 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-13 13:26:59 +0000
commit0e6fd884e68670a70a857d092b79fb7e71bf3856 (patch)
treef4203b7ebbf80f50c52780743692a958b68e4b96 /chrome
parent8fbdbc5938f060c003f6d261e4f31ab2d8bf1a98 (diff)
downloadchromium_src-0e6fd884e68670a70a857d092b79fb7e71bf3856.zip
chromium_src-0e6fd884e68670a70a857d092b79fb7e71bf3856.tar.gz
chromium_src-0e6fd884e68670a70a857d092b79fb7e71bf3856.tar.bz2
Auto-generate ADM files
This is the first iteration of my work on the policy MCX/ADM/ADMX/HTML generator. I added chrome/app/policy/policy_templates.grd and a grit extension that parses this file and chrome/app/policy/policy_templates.json and then generates the en-US version of chrome.adm from them. The infrastructure is already in place for other languages and output formats. BUG=49316 TEST=policy_template_generator_unittest.py and manual tests of chrome.adm Review URL: http://codereview.chromium.org/3068012 Patch from Gabor Feher <gfeher@google.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/policy/policy_templates.grd194
-rw-r--r--chrome/app/policy/policy_templates.json138
-rw-r--r--chrome/chrome.gyp1
3 files changed, 333 insertions, 0 deletions
diff --git a/chrome/app/policy/policy_templates.grd b/chrome/app/policy/policy_templates.grd
new file mode 100644
index 0000000..f9086d2
--- /dev/null
+++ b/chrome/app/policy/policy_templates.grd
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- This file contains definitions of resources that are used in policy
+templates and will be translated for each locale. -->
+
+<grit base_dir="." latest_public_release="0" current_release="1"
+ source_lang_id="en" enc_check="möl">
+ <outputs>
+ <!-- TODO(gfeher) set output basedir to chrome/app/policy instead of the
+ current Debug/obj/global_intermediate/chrome/app/policy
+ -->
+ <output filename="./app/policy/windows/adm/en-US/chrome.adm" type="adm" lang="en" />
+ <output filename="./app/policy/windows/adm/de/chrome.adm" type="adm" lang="de" />
+ <output filename="./app/policy/windows/adm/hu/chrome.adm" type="adm" lang="hu" />
+ </outputs>
+ <translations>
+ <!-- TODO(gfeher): add target languages here -->
+ </translations>
+ <!-- TODO(gfeher): set allow_pseudo="false" before release -->
+ <release seq="1" allow_pseudo="true">
+ <messages fallback_to_english="false">
+ <!-- Strings for ADM/ADMX/MCX policy templates -->
+ <!-- TODO(gfeher): new wording of these messages might become necessary when
+ MCX/HTML output is introduced -->
+ <message name="IDS_POLICY_GROUP_HOMEPAGE_CAPTION" desc="Caption of the 'homepage' policy settings page.">
+ Configure default homepage
+ </message>
+ <message name="IDS_POLICY_GROUP_HOMEPAGE_DESC" desc="Description of the 'homepage' policy settings page.">
+ Configures the default home page in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing homepage preferences.
+
+ The homepage can either be set to a URL you specify or set to the New Tab Page.
+
+ If you specify the New Tab Page as the homepage, the homepage URL location is ignored.
+
+ If you enable this setting, users cannot change their homepage settings in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_HOMEPAGELOCATION_CAPTION" desc="Caption of the homepage URL text field in the homepage policy settings page.">
+ The homepage URL:
+ </message>
+ <message name="IDS_POLICY_HOMEPAGEISNEWTABPAGE_CAPTION" desc="Caption of the homepage type selection dropdown menu in the homepage policy settings page.">
+ Homepage type:
+ </message>
+ <message name="IDS_POLICY_ENUM_HOMEPAGEISNEWTABPAGE_CAPTION" desc="Label in the 'Homepage type' dropdown menu for selecting new tab page.">
+ Always use New Tab Page as homepage
+ </message>
+ <message name="IDS_POLICY_ENUM_HOMEPAGEISLOCATIONURL_CAPTION" desc="Label in the 'Homepage type' dropdown menu for selecting an URL.">
+ Always use homepage URL as homepage
+ </message>
+ <message name="IDS_POLICY_GROUP_APPLICATIONLOCALE_CAPTION" desc="Caption of the 'application locale' policy settings page.">
+ Configure the application locale
+ </message>
+ <message name="IDS_POLICY_GROUP_APPLICATIONLOCALE_DESC" desc="Description of the 'application locale' policy settings page.">
+ Configures the application locale in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing the locale.
+
+ If you enable this setting, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> uses the specified locale. If the configured locale is not supported, 'en-US' is used instead.
+
+ If this setting is disabled or not configured, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> uses either the user-specified preferred locale (if configured), the system locale or the fallback locale 'en-US'.
+ </message>
+ <message name="IDS_POLICY_APPLICATIONLOCALEVALUE_CAPTION" desc="Caption of the 'application locale' text field in the 'application locale' policy settings page.">
+ Application locale:
+ </message>
+ <message name="IDS_POLICY_GROUP_ALTERNATEERRORPAGESENABLED_CAPTION" desc="Caption of the 'alternate error pages' policy settings page.">
+ Enable alternate error pages
+ </message>
+ <message name="IDS_POLICY_GROUP_ALTERNATEERRORPAGESENABLED_DESC" desc="Description of the 'alternate error pages' policy settings page.">
+ Enables the use of alternate error pages that are built into <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> (such as 'page not found') and prevents users from changing this setting.
+
+ If you enable this setting, alternate error pages are used.
+
+ If you disable this setting, alternate error pages are never used.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_SEARCHSUGGESTENABLED_CAPTION" desc="Caption of the 'search suggestions' policy settings page.">
+ Enable search suggestions
+ </message>
+ <message name="IDS_POLICY_GROUP_SEARCHSUGGESTENABLED_DESC" desc="Description of the 'search suggestions' policy settings page.">
+ Enables search suggestions in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Omnibox and prevents users from changing this setting.
+
+ If you enable this setting, search suggestions are used.
+
+ If you disable this setting, search suggestions are never used.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_DNSPREFETCHINGENABLED_CAPTION" desc="Caption of the 'DNS prefetching' policy settings page.">
+ Enable DNS prefetching
+ </message>
+ <message name="IDS_POLICY_GROUP_DNSPREFETCHINGENABLED_DESC" desc="Description of the 'DNS prefetching' policy settings page.">
+ Enables DNS prefecthing in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing this setting.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_SAFEBROWSINGENABLED_CAPTION" desc="Caption of the 'safe browsing' policy settings page.">
+ Enable Safe Browsing
+ </message>
+ <message name="IDS_POLICY_GROUP_SAFEBROWSINGENABLED_DESC" desc="Description of the 'safe browsing' policy settings page.">
+ Enables <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>'s Safe Browsing feature and prevents users from changing this setting.
+
+ If you enable this setting, Safe Browsing is always active.
+
+ If you disable this setting, Safe Browsing is never active.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_SYNCDISABLED_CAPTION" desc="Caption of the 'disable sync' policy settings page.">
+ Disallow synchronization of data with Google
+ </message>
+ <message name="IDS_POLICY_GROUP_SYNCDISABLED_DESC" desc="Description of the 'disable sync' policy settings page.">
+ Disallows data synchronization in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> using Google-hosted synchronization services and prevents users from changing this setting.
+
+ If you enable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_PROXY_CAPTION" desc="Caption of the 'proxy' policy settings page.">
+ Configure proxy server
+ </message>
+ <message name="IDS_POLICY_GROUP_PROXY_DESC" desc="Description of the 'proxy' policy settings page.">
+ Allows you to specify the proxy server used by <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing proxy settings.
+
+ If you choose to never use a proxy server and always connect directly, all other options are ignored.
+
+ If you choose to auto detect the proxy server, all other options are ignored.
+
+ For detailed examples, visit:
+ http://www.chromium.org/developers/design-documents/network-settings#TOC-Command-line-options-for-proxy-sett
+
+ If you enable this setting, <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> ignores all proxy-related options specified from the command line.
+ </message>
+ <message name="IDS_POLICY_PROXYSERVERMODE_CAPTION" desc="Text describing the dropdown menu for selecting proxy server mode in the 'proxy' policy settings page.">
+ Choose how to specify proxy server settings:
+ </message>
+ <message name="IDS_POLICY_ENUM_PROXYSERVERDISABLED_CAPTION" desc="Label in the 'proxy server mode' dropdown menu for selecting no proxy server.">
+ Never use a proxy
+ </message>
+ <message name="IDS_POLICY_ENUM_PROXYSERVERAUTODETECT_CAPTION" desc="Label in the 'proxy server mode' dropdown menu for selecting to auto-detect proxy settings.">
+ Auto detect proxy settings
+ </message>
+ <message name="IDS_POLICY_ENUM_PROXYSERVERMANUAL_CAPTION" desc="Label in the 'proxy server mode' dropdown menu for selecting manual proxy settings.">
+ Manually specify proxy settings
+ </message>
+ <message name="IDS_POLICY_ENUM_PROXYSERVERUSESYSTEM_CAPTION" desc="Label in the 'proxy server mode' dropdown menu for selecting to use system proxy settings.">
+ Use system proxy settings
+ </message>
+ <message name="IDS_POLICY_PROXYSERVER_CAPTION" desc="The label of the 'proxy server address' text field in the 'proxy' policy settings page.">
+ Address or URL of proxy server:
+ </message>
+ <message name="IDS_POLICY_PROXYBYPASSLIST_CAPTION" desc="The label of the 'proxy bypass rules' text field in the 'proxy' policy settings page.">
+ Comma-separated list of bypass rules:
+ </message>
+ <message name="IDS_POLICY_PROXYPACURL_CAPTION" desc="The label of the 'proxy pac URL' text field in the 'proxy' policy settings page.">
+ URL to a proxy .pac file:
+ </message>
+ <message name="IDS_POLICY_GROUP_METRICSREPORTINGENABLED_CAPTION" desc="Caption of the 'crash reporting' policy settings page.">
+ Enable reporting of usage and crash-related data
+ </message>
+ <message name="IDS_POLICY_GROUP_METRICSREPORTINGENABLED_DESC" desc="Description of the 'crash reporting' policy settings page.">
+ Enables anonymous reporting of usage and crash-related data about <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> to Google and prevents users from changing this setting.
+
+ If you enable this setting, anonymous reporting of usage and crash-related data is sent to Google.
+
+ If you disable this setting, anonymous reporting of usage and crash-related data is never sent to Google.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_PASSWORDMANAGERENABLED_CAPTION" desc="Caption of the 'password manager' policy settings page.">
+ Enable the password manager
+ </message>
+ <message name="IDS_POLICY_GROUP_PASSWORDMANAGERENABLED_DESC" desc="Description of the 'password manager' policy settings page.">
+ Enables saving passwords and using saved passwords in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+
+ If you enable this setting, users can have <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> memorize passwords and provide them automatically the next time you log into a site.
+
+ If you disable this setting, users are not able to save passwords or use already saved passwords.
+
+ If you enable or disable this setting, users cannot change or override this setting in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>.
+ </message>
+ <message name="IDS_POLICY_GROUP_DISABLEDPLUGINS_CAPTION" desc="Caption of the 'disable plugins' policy settings page.">
+ Specify a list of plugins that are disabled
+ </message>
+ <message name="IDS_POLICY_GROUP_DISABLEDPLUGINS_DESC" desc="Description of the 'disable plugins' policy settings page.">
+ Specifies a list of plugins that are disabled in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> and prevents users from changing this setting. The value is a comma-separated list of the names of plugins to be disabled.
+
+ If you enable this setting, the specified list of plugins is never used in <ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph>. The plugins are marked as disabled in 'about:plugins' and users are not able to enable them.
+ </message>
+ <message name="IDS_POLICY_DISABLEDPLUGINSLIST_CAPTION" desc="The label of the 'list of disabled plugins' text field in the 'disabled plugins' policy settings page.">
+ Comma-separated list of disabled plugins:
+ </message>
+ </messages>
+
+ <structures>
+ <structure name="IDD_POLICY_SOURCE_FILE" file="policy_templates.json" type="policy_template_metafile" />
+ </structures>
+ </release>
+</grit>
diff --git a/chrome/app/policy/policy_templates.json b/chrome/app/policy/policy_templates.json
new file mode 100644
index 0000000..7571abe
--- /dev/null
+++ b/chrome/app/policy/policy_templates.json
@@ -0,0 +1,138 @@
+{
+# policy_templates.json - Metafile for policy templates
+#
+# This file is used as input to generate the following policy templates:
+# ADM (TODO(gfeher): MCX,ADMX,DOC)
+#
+# Policy templates are user interface definitions or documents about the
+# policies that can be used to configure Chrome. Each policy is a name-value
+# pair where the value has a given type. Chrome looks up the values using the
+# names of the policies. In the user interface where the values can be set,
+# related policies might appear together in policy groups. The grouping is not
+# visible to Chrome.
+#
+# This file contains a list of policy groups. Each group contains a list
+# of policies under the key 'policies'. If a policy does not belong to
+# any groups then it should be placed in its own separate group. All the
+# policies and all the groups must have unique names but it is not a problem
+# to have a group and policy with the same name. Group names are in fact
+# not exposed to Chrome at all.
+#
+# Each policy has a type. The currently implemented types:
+# 'string' - a string value
+# 'enum' - the user can select its value from a collection of items
+# 'main' - a boolean value with additional semantics:
+# A group can have at most one main policy and it must have a value of true
+# if the policy group is enabled, false if the group is disabled or no value
+# if the policy is not specified. Chrome will see this policy no differently
+# than other policies, but depending on the platform, the GUI of the
+# templates might reflect the fact that these policies are 'main'. For
+# example on Windows this policy will be assigned to the Enable/Disable
+# buttons of the group, and if it is set to Disabled then other policies of
+# the group will not be visible to Chrome.
+#
+# Policy group descriptions, policy captions and similar texts are localized
+# strings taken from the <message> nodes of the .grd file. Their name
+# attributes are generated from the JSON keys.
+# Possible locations of localized strings in the templates:
+# Policy groups:
+# They can have both captions and descriptions.
+# Policies:
+# Policies with type 'main':
+# none (inherits them from the policy group)
+# Policies of other types:
+# Captions only.
+# Selectable item in an 'enum'-typed policy:
+# Captions only.
+# Generated grd names:
+# Each name has two parts: the second part is either CAPTION or DESC,
+# and the first part identifies the item the text applies to:
+# -For policy groups:
+# IDS_POLICY_GROUP_<NAME OF THE GROUP>
+# e.g. the name of the description of group Homepage:
+# IDS_POLICY_GROUP_HOMEPAGE_DESC
+# -For policies:
+# IDS_POLICY_<NAME OF THE POLICY>
+# e.g. the name of the caption of policy HomepageLocation:
+# IDS_POLICY_HOMEPAGELOCATION_CAPTION
+# -For enum items:
+# IDS_POLICY_ENUM_<NAME OF THE ITEM>
+# e.g. the name of the caption of ProxyServerDisabled:
+# IDS_POLICY_ENUM_PROXYSERVERDISABLED_CAPTION
+#
+# TODO(gfeher): ADMX, MCX, DOC, .h/.cc? files
+#
+ 'Homepage': {
+ 'policies': {
+ 'HomepageLocation': {'type': 'string'},
+ 'HomepageIsNewTabPage': {
+ 'type': 'enum',
+ 'items': {
+ 'HomepageIsLocationURL': {'value': '0'},
+ 'HomepageIsNewTabPage': {'value': '1'},
+ }
+ },
+ }
+ },
+ 'ApplicationLocale': {
+ 'policies': {
+ 'ApplicationLocaleValue': {'type': 'string'},
+ }
+ },
+ 'AlternateErrorPagesEnabled': {
+ 'policies': {
+ 'AlternateErrorPagesEnabled': {'type': 'main'},
+ }
+ },
+ 'SearchSuggestEnabled': {
+ 'policies': {
+ 'SearchSuggestEnabled': {'type': 'main'},
+ }
+ },
+ 'DnsPrefetchingEnabled': {
+ 'policies': {
+ 'DnsPrefetchingEnabled': {'type': 'main'},
+ }
+ },
+ 'SafeBrowsingEnabled': {
+ 'policies': {
+ 'SafeBrowsingEnabled': {'type': 'main'},
+ }
+ },
+ 'MetricsReportingEnabled': {
+ 'policies': {
+ 'MetricsReportingEnabled': {'type': 'main'},
+ }
+ },
+ 'PasswordManagerEnabled': {
+ 'policies': {
+ 'PasswordManagerEnabled': {'type': 'main'},
+ }
+ },
+ 'DisabledPlugins': {
+ 'policies': {
+ 'DisabledPluginsList': {'type': 'string'},
+ }
+ },
+ 'SyncDisabled': {
+ 'policies': {
+ 'SyncDisabled': {'type': 'main'},
+ }
+ },
+ 'Proxy': {
+ 'policies': {
+ 'ProxyServerMode': {
+ 'type': 'enum',
+ 'items': {
+ 'ProxyServerDisabled': {'value': '0'},
+ 'ProxyServerAutoDetect': {'value': '1'},
+ 'ProxyServerManual': {'value': '2'},
+ 'ProxyServerUseSystem': {'value': '3'},
+ }
+ },
+ 'ProxyServer': {'type': 'string'},
+ 'ProxyPacUrl': {'type': 'string'},
+ 'ProxyBypassList': {'type': 'string'},
+ }
+ }
+} \ No newline at end of file
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 21c06da..a68f235 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -48,6 +48,7 @@
'app/chromium_strings.grd',
'app/generated_resources.grd',
'app/google_chrome_strings.grd',
+ 'app/policy/policy_templates.grd',
],
'chrome_resources_grds': [
# Data resources.