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

Unified Diff: tools/grit/grit/format/policy_templates/writers/admx_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/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 1573d78719452b7b42f9f9683793d5402edeceee..8737f547f7bb5737bb4cb10b2ff754799bf031a6 100644
--- a/tools/grit/grit/format/policy_templates/writers/admx_writer.py
+++ b/tools/grit/grit/format/policy_templates/writers/admx_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.
@@ -157,6 +157,17 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
'valueName': name,
}
self.AddElement(parent, 'text', attributes)
+
+ def _AddIntPolicy(self, parent, name):
+ '''Generates ADMX elements for an Int-Policy and adds them to the passed
+ parent node.
+ '''
+ attributes = {
+ 'id': name,
+ 'valueName': name,
+ }
+ self.AddElement(parent, 'decimal', attributes)
+
def _AddEnumPolicy(self, parent, policy):
'''Generates ADMX elements for an Enum-Policy and adds them to the
passed parent element.
@@ -254,6 +265,9 @@ class ADMXWriter(xml_formatted_writer.XMLFormattedWriter):
elif policy_type == 'string':
parent = self._GetElements(policy_elem)
self._AddStringPolicy(parent, policy_name)
+ elif policy_type == 'int':
+ parent = self._GetElements(policy_elem)
+ self._AddIntPolicy(parent, policy_name)
elif policy_type in ('int-enum', 'string-enum'):
parent = self._GetElements(policy_elem)
self._AddEnumPolicy(parent, policy)

Powered by Google App Engine
This is Rietveld 408576698