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

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

Issue 6176005: Support int-typed policies in policy template generator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment 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/adml_writer.py
diff --git a/tools/grit/grit/format/policy_templates/writers/adml_writer.py b/tools/grit/grit/format/policy_templates/writers/adml_writer.py
index 99f989539b45274552dc18b54a5e1fa4191ae040..a518a2fbb68caacbfe27fb8fe1bb46275d862ae1 100644
--- a/tools/grit/grit/format/policy_templates/writers/adml_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/adml_writer.py
@@ -1,4 +1,4 @@
-# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -77,7 +77,7 @@ class ADMLWriter(xml_formatted_writer.XMLFormattedWriter):
self._AddString(self._string_table_elem, policy_name, policy_caption)
self._AddString(self._string_table_elem, policy_name + '_Explain',
policy_description)
- presentation_elem = self.AddElement(
+ presentation_elem = self.AddElement(
self._presentation_table_elem, 'presentation', {'id': policy_name})
if policy_type == 'main':
@@ -87,6 +87,11 @@ class ADMLWriter(xml_formatted_writer.XMLFormattedWriter):
{'refId': policy_name})
label_elem = self.AddElement(textbox_elem, 'label')
label_elem.appendChild(self._doc.createTextNode(policy_label))
+ elif policy_type == 'int':
+ textbox_elem = self.AddElement(presentation_elem, 'decimalTextBox',
+ {'refId': policy_name})
+ label_elem = self.AddElement(textbox_elem, 'label')
+ label_elem.appendChild(self._doc.createTextNode(policy_label))
elif policy_type in ('int-enum', 'string-enum'):
for item in policy['items']:
self._AddString(self._string_table_elem, item['name'], item['caption'])

Powered by Google App Engine
This is Rietveld 408576698