| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 from xml.dom import minidom | 6 from xml.dom import minidom |
| 7 from grit.format.policy_templates.writers import xml_formatted_writer | 7 from grit.format.policy_templates.writers import xml_formatted_writer |
| 8 | 8 |
| 9 | 9 |
| 10 def GetWriter(config): | 10 def GetWriter(config): |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 } | 161 } |
| 162 self.AddElement(definitions_elem, 'definition', attributes) | 162 self.AddElement(definitions_elem, 'definition', attributes) |
| 163 | 163 |
| 164 def _AddStringPolicy(self, parent, name): | 164 def _AddStringPolicy(self, parent, name): |
| 165 '''Generates ADMX elements for a String-Policy and adds them to the | 165 '''Generates ADMX elements for a String-Policy and adds them to the |
| 166 passed parent node. | 166 passed parent node. |
| 167 ''' | 167 ''' |
| 168 attributes = { | 168 attributes = { |
| 169 'id': name, | 169 'id': name, |
| 170 'valueName': name, | 170 'valueName': name, |
| 171 'maxLength': '1000000', |
| 171 } | 172 } |
| 172 self.AddElement(parent, 'text', attributes) | 173 self.AddElement(parent, 'text', attributes) |
| 173 | 174 |
| 174 def _AddIntPolicy(self, parent, name): | 175 def _AddIntPolicy(self, parent, name): |
| 175 '''Generates ADMX elements for an Int-Policy and adds them to the passed | 176 '''Generates ADMX elements for an Int-Policy and adds them to the passed |
| 176 parent node. | 177 parent node. |
| 177 ''' | 178 ''' |
| 178 attributes = { | 179 attributes = { |
| 179 'id': name, | 180 'id': name, |
| 180 'valueName': name, | 181 'valueName': name, |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 self._AddCategories(self.config['win_recommended_category_path']) | 373 self._AddCategories(self.config['win_recommended_category_path']) |
| 373 self._active_policies_elem = self.AddElement(policy_definitions_elem, | 374 self._active_policies_elem = self.AddElement(policy_definitions_elem, |
| 374 'policies') | 375 'policies') |
| 375 self._active_mandatory_policy_group_name = \ | 376 self._active_mandatory_policy_group_name = \ |
| 376 self.config['win_mandatory_category_path'][-1] | 377 self.config['win_mandatory_category_path'][-1] |
| 377 self._active_recommended_policy_group_name = \ | 378 self._active_recommended_policy_group_name = \ |
| 378 self.config['win_recommended_category_path'][-1] | 379 self.config['win_recommended_category_path'][-1] |
| 379 | 380 |
| 380 def GetTemplateText(self): | 381 def GetTemplateText(self): |
| 381 return self.ToPrettyXml(self._doc) | 382 return self.ToPrettyXml(self._doc) |
| OLD | NEW |