Chromium Code Reviews| 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) |