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

Side by Side Diff: grit/format/policy_templates/writers/adml_writer.py

Issue 92213002: Add support for Chrome policy type that references external data (Closed) Base URL: http://grit-i18n.googlecode.com/svn/trunk/
Patch Set: Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 dropdownlist_elem.appendChild(self._doc.createTextNode(policy_label)) 101 dropdownlist_elem.appendChild(self._doc.createTextNode(policy_label))
102 elif policy_type == 'list': 102 elif policy_type == 'list':
103 self._AddString(self._string_table_elem, 103 self._AddString(self._string_table_elem,
104 policy_name + 'Desc', 104 policy_name + 'Desc',
105 policy_caption) 105 policy_caption)
106 listbox_elem = self.AddElement(presentation_elem, 'listBox', 106 listbox_elem = self.AddElement(presentation_elem, 'listBox',
107 {'refId': policy_name + 'Desc'}) 107 {'refId': policy_name + 'Desc'})
108 listbox_elem.appendChild(self._doc.createTextNode(policy_label)) 108 listbox_elem.appendChild(self._doc.createTextNode(policy_label))
109 elif policy_type == 'group': 109 elif policy_type == 'group':
110 pass 110 pass
111 elif policy_type == 'external':
112 # This type can only be set through cloud policy.
113 pass
111 else: 114 else:
112 raise Exception('Unknown policy type %s.' % policy_type) 115 raise Exception('Unknown policy type %s.' % policy_type)
113 116
114 def BeginPolicyGroup(self, group): 117 def BeginPolicyGroup(self, group):
115 '''Generates ADML elements for a Policy-Group. For each Policy-Group two 118 '''Generates ADML elements for a Policy-Group. For each Policy-Group two
116 ADML "string" elements are added to the string-table. One contains the 119 ADML "string" elements are added to the string-table. One contains the
117 caption of the Policy-Group and the other a description. A Policy-Group also 120 caption of the Policy-Group and the other a description. A Policy-Group also
118 requires an ADML "presentation" element that must be added to the 121 requires an ADML "presentation" element that must be added to the
119 presentation-table. The "presentation" element is the container for the 122 presentation-table. The "presentation" element is the container for the
120 elements that define the visual presentation of the Policy-Goup's Policies. 123 elements that define the visual presentation of the Policy-Goup's Policies.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 self._presentation_table_elem = self.AddElement(resources_elem, 174 self._presentation_table_elem = self.AddElement(resources_elem,
172 'presentationTable') 175 'presentationTable')
173 176
174 def GetTemplateText(self): 177 def GetTemplateText(self):
175 # Using "toprettyxml()" confuses the Windows Group Policy Editor 178 # Using "toprettyxml()" confuses the Windows Group Policy Editor
176 # (gpedit.msc) because it interprets whitespace characters in text between 179 # (gpedit.msc) because it interprets whitespace characters in text between
177 # the "string" tags. This prevents gpedit.msc from displaying the category 180 # the "string" tags. This prevents gpedit.msc from displaying the category
178 # names correctly. 181 # names correctly.
179 # TODO(markusheintz): Find a better formatting that works with gpedit. 182 # TODO(markusheintz): Find a better formatting that works with gpedit.
180 return self._doc.toxml() 183 return self._doc.toxml()
OLDNEW
« no previous file with comments | « grit/format/policy_templates/writers/adm_writer.py ('k') | grit/format/policy_templates/writers/admx_writer.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698