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

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

Issue 5958014: Policy: Add ProxyMode and deprecate ProxyServerMode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: check final diff 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/adm_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/adm_writer.py b/tools/grit/grit/format/policy_templates/writers/adm_writer.py
index 23df695979b20c1f6442c942958f12f56cab6311..3067282205c5a41546501a02451199b8521bbc18 100644
--- a/tools/grit/grit/format/policy_templates/writers/adm_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/adm_writer.py
@@ -21,7 +21,8 @@ class AdmWriter(template_writer.TemplateWriter):
TYPE_TO_INPUT = {
'string': 'EDITTEXT',
- 'enum': 'DROPDOWNLIST',
+ 'string-enum': 'DROPDOWNLIST',
+ 'int-enum': 'DROPDOWNLIST',
'list': 'LISTBOX'}
NEWLINE = '\r\n'
@@ -76,11 +77,15 @@ class AdmWriter(template_writer.TemplateWriter):
self._PrintLine('VALUEPREFIX ""')
else:
self._PrintLine('VALUENAME "%s"' % policy['name'])
- if policy['type'] == 'enum':
+ if policy['type'] in ('int-enum', 'string-enum'):
self._PrintLine('ITEMLIST', 1)
for item in policy['items']:
- self._PrintLine('NAME !!%s_DropDown VALUE NUMERIC %s' %
- (item['name'], item['value']))
+ if policy['type'] == 'int-enum':
+ value_text = 'NUMERIC ' + str(item['value'])
+ else:
+ value_text = '"' + item['value'] + '"'
+ self._PrintLine('NAME !!%s_DropDown VALUE %s' %
+ (item['name'], value_text))
self._AddGuiString(item['name'] + '_DropDown', item['caption'])
self._PrintLine('END ITEMLIST', -1)
self._PrintLine('END PART', -1)

Powered by Google App Engine
This is Rietveld 408576698