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

Unified Diff: tools/grit/grit/format/policy_templates/writers/admx_writer.py

Issue 5958014: Policy: Add ProxyMode and deprecate ProxyServerMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests on all platforms Created 9 years, 11 months 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: tools/grit/grit/format/policy_templates/writers/admx_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/admx_writer.py b/tools/grit/grit/format/policy_templates/writers/admx_writer.py
index 164175bdfed40b28570eaef21a9eebc55ea7ed37..65f3df2ad13f7771e229edb05a2708614c758da8 100644
--- a/tools/grit/grit/format/policy_templates/writers/admx_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/admx_writer.py
@@ -158,7 +158,7 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
}
self.AddElement(parent, 'text', attributes)
- def _AddEnumPolicy(self, parent, name, items):
+ def _AddEnumPolicy(self, parent, name, items, integer_enum):
gfeher 2011/01/10 14:20:33 I'd prefer to pass policy_type here, or better, wh
danno 2011/01/11 08:46:46 Done.
'''Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element.
'''
@@ -172,7 +172,11 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
item_elem = self.AddElement(enum_elem, 'item', attributes)
value_elem = self.AddElement(item_elem, 'value')
attributes = {'value': str(item['value'])}
- self.AddElement(value_elem, 'decimal', attributes)
+ if integer_enum is True:
+ element_type = 'decimal'
+ else:
+ element_type = 'string'
+ self.AddElement(value_elem, element_type, attributes)
def _AddListPolicy(self, parent, name):
'''Generates ADMX XML elements for a List-Policy and adds them to the
@@ -249,9 +253,10 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
elif policy_type == 'string':
parent = self._GetElements(policy_elem)
self._AddStringPolicy(parent, policy_name)
- elif policy_type == 'enum':
+ elif policy_type in ('int-enum', 'string-enum'):
parent = self._GetElements(policy_elem)
- self._AddEnumPolicy(parent, policy_name, policy['items'])
+ self._AddEnumPolicy(parent, policy_name, policy['items'],
+ policy['type'] == 'int-enum')
elif policy_type == 'list':
parent = self._GetElements(policy_elem)
self._AddListPolicy(parent, policy_name)

Powered by Google App Engine
This is Rietveld 408576698