Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(249)

Unified Diff: grit/format/policy_templates/writers/doc_writer.py

Issue 92213002: Add support for Chrome policy type that references external data (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: grit/format/policy_templates/writers/doc_writer.py
===================================================================
--- grit/format/policy_templates/writers/doc_writer.py (revision 139)
+++ grit/format/policy_templates/writers/doc_writer.py (working copy)
@@ -464,19 +464,21 @@
self._REG_TYPE_MAP.get(policy['type'], None)):
data_type += ' (%s)' % self._REG_TYPE_MAP[policy['type']]
self._AddPolicyAttribute(dl, 'data_type', data_type)
- if self.IsPolicySupportedOnPlatform(policy, 'win'):
- self._AddPolicyAttribute(
- dl,
- 'win_reg_loc',
- self.config['win_reg_mandatory_key_name'] + '\\' + policy['name'],
- ['.monospace'])
- if (self.IsPolicySupportedOnPlatform(policy, 'linux') or
- self.IsPolicySupportedOnPlatform(policy, 'mac')):
- self._AddPolicyAttribute(
- dl,
- 'mac_linux_pref_name',
- policy['name'],
- ['.monospace'])
+ if policy['type'] != 'external':
+ # All types except 'external' can be set through platform policy.
+ if self.IsPolicySupportedOnPlatform(policy, 'win'):
+ self._AddPolicyAttribute(
+ dl,
+ 'win_reg_loc',
+ self.config['win_reg_mandatory_key_name'] + '\\' + policy['name'],
+ ['.monospace'])
+ if (self.IsPolicySupportedOnPlatform(policy, 'linux') or
+ self.IsPolicySupportedOnPlatform(policy, 'mac')):
+ self._AddPolicyAttribute(
+ dl,
+ 'mac_linux_pref_name',
+ policy['name'],
+ ['.monospace'])
dd = self._AddPolicyAttribute(dl, 'supported_on')
self._AddSupportedOnList(dd, policy['supported_on'])
dd = self._AddPolicyAttribute(dl, 'supported_features')
@@ -487,8 +489,10 @@
self.IsPolicySupportedOnPlatform(policy, 'linux') or
self.IsPolicySupportedOnPlatform(policy, 'mac')):
# Don't add an example for ChromeOS-only policies.
- dd = self._AddPolicyAttribute(dl, 'example_value')
- self._AddExample(dd, policy)
+ if policy['type'] != 'external':
+ # All types except 'external' can be set through platform policy.
+ dd = self._AddPolicyAttribute(dl, 'example_value')
+ self._AddExample(dd, policy)
def _AddPolicyNote(self, parent, policy):
'''If a policy has an additional web page assigned with it, then add
@@ -644,6 +648,7 @@
'string-enum': 'String',
'list': 'List of strings',
'dict': 'Dictionary',
+ 'external': 'External data reference',
}
self._REG_TYPE_MAP = {
'string': 'REG_SZ',
« no previous file with comments | « grit/format/policy_templates/writers/admx_writer.py ('k') | grit/format/policy_templates/writers/json_writer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698