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

Side by Side Diff: components/policy/tools/template_writers/writers/doc_writer.py

Issue 2481183002: Generate ADMX template for Chrome OS policies (Closed)
Patch Set: Couple of fixes after testing Created 3 years, 3 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 unified diff | Download patch
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 6
7 import json 7 import json
8 import re 8 import re
9 from xml.dom import minidom 9 from xml.dom import minidom
10 from writers import xml_formatted_writer 10 from writers import xml_formatted_writer
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 example_value = policy['example_value'] 176 example_value = policy['example_value']
177 self.AddElement(parent, 'dt', {}, 'Mac:') 177 self.AddElement(parent, 'dt', {}, 'Mac:')
178 mac = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) 178 mac = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
179 179
180 mac_text = ['<array>'] 180 mac_text = ['<array>']
181 for item in example_value: 181 for item in example_value:
182 mac_text.append(' <string>%s</string>' % item) 182 mac_text.append(' <string>%s</string>' % item)
183 mac_text.append('</array>') 183 mac_text.append('</array>')
184 self.AddText(mac, '\n'.join(mac_text)) 184 self.AddText(mac, '\n'.join(mac_text))
185 185
186 def _AddListExampleWindows(self, parent, policy): 186 def _AddListExampleWindowsChromeOS(self, parent, policy, is_win):
187 '''Adds an example value for Windows of a 'list' policy to a DOM node. 187 '''Adds an example value for Windows or Chromium/Google Chrome OS of a
188 'list' policy to a DOM node.
188 189
189 Args: 190 Args:
190 parent: The DOM node for which the example will be added. 191 parent: The DOM node for which the example will be added.
191 policy: A policy of type 'list', for which the Windows example value 192 policy: A policy of type 'list', for which the Windows example value
192 is generated. 193 is generated.
194 is_win: True for Windows, False for Chromium/Google Chrome OS.
193 ''' 195 '''
194 example_value = policy['example_value'] 196 example_value = policy['example_value']
195 self.AddElement(parent, 'dt', {}, 'Windows:') 197 os_header = self._GetLocalizedMessage('win_example_value') if is_win else \
196 win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) 198 self._GetLocalizedMessage('chrome_os_example_value')
197 win_text = [] 199 self.AddElement(parent, 'dt', {}, os_header)
200 element = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
201 element_text = []
198 cnt = 1 202 cnt = 1
199 if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy): 203 key_name = self._GetRegistryKeyName(policy, is_win)
200 key_name = self.config['win_reg_recommended_key_name']
201 else:
202 key_name = self.config['win_reg_mandatory_key_name']
203 for item in example_value: 204 for item in example_value:
204 win_text.append( 205 element_text.append(
205 '%s\\%s\\%d = "%s"' % 206 '%s\\%s\\%d = "%s"' %
206 (key_name, policy['name'], cnt, item)) 207 (key_name, policy['name'], cnt, item))
207 cnt = cnt + 1 208 cnt = cnt + 1
208 self.AddText(win, '\n'.join(win_text)) 209 self.AddText(element, '\n'.join(element_text))
210
211 def _GetRegistryKeyName(self, policy, is_win):
212 use_recommended_key = self.CanBeRecommended(policy) and not \
213 self.CanBeMandatory(policy)
214 platform = 'win' if is_win else 'chrome_os';
215 key = 'reg_recommended_key_name' if use_recommended_key else \
216 'reg_mandatory_key_name'
217 return self.config['win_config'][platform][key];
209 218
210 def _AddListExampleAndroidLinux(self, parent, policy): 219 def _AddListExampleAndroidLinux(self, parent, policy):
211 '''Adds an example value for Android/Linux of a 'list' policy to a DOM node. 220 '''Adds an example value for Android/Linux of a 'list' policy to a DOM node.
212 221
213 Args: 222 Args:
214 parent: The DOM node for which the example will be added. 223 parent: The DOM node for which the example will be added.
215 policy: A policy of type 'list', for which the Android/Linux example value 224 policy: A policy of type 'list', for which the Android/Linux example value
216 is generated. 225 is generated.
217 ''' 226 '''
218 example_value = policy['example_value'] 227 example_value = policy['example_value']
219 self.AddElement(parent, 'dt', {}, 'Android/Linux:') 228 self.AddElement(parent, 'dt', {}, 'Android/Linux:')
220 element = self._AddStyledElement(parent, 'dd', ['.monospace']) 229 element = self._AddStyledElement(parent, 'dd', ['.monospace'])
221 text = [] 230 text = []
222 for item in example_value: 231 for item in example_value:
223 text.append('"%s"' % item) 232 text.append('"%s"' % item)
224 self.AddText(element, '[%s]' % ', '.join(text)) 233 self.AddText(element, '[%s]' % ', '.join(text))
225 234
226 def _AddListExample(self, parent, policy): 235 def _AddListExample(self, parent, policy):
227 '''Adds the example value of a 'list' policy to a DOM node. Example output: 236 '''Adds the example value of a 'list' policy to a DOM node. Example output:
228 <dl> 237 <dl>
229 <dt>Windows:</dt> 238 <dt>Windows (Windows clients):</dt>
230 <dd> 239 <dd>
231 Software\Policies\Chromium\DisabledPlugins\0 = "Java" 240 Software\Policies\Chromium\DisabledPlugins\0 = "Java"
232 Software\Policies\Chromium\DisabledPlugins\1 = "Shockwave Flash" 241 Software\Policies\Chromium\DisabledPlugins\1 = "Shockwave Flash"
233 </dd> 242 </dd>
243 <dt>Windows (Chromium OS clients):</dt>
244 <dd>
245 Software\Policies\ChromiumOS\DisabledPlugins\0 = "Java"
246 Software\Policies\ChromiumOS\DisabledPlugins\1 = "Shockwave Flash"
247 </dd>
234 <dt>Android/Linux:</dt> 248 <dt>Android/Linux:</dt>
235 <dd>["Java", "Shockwave Flash"]</dd> 249 <dd>["Java", "Shockwave Flash"]</dd>
236 <dt>Mac:</dt> 250 <dt>Mac:</dt>
237 <dd> 251 <dd>
238 <array> 252 <array>
239 <string>Java</string> 253 <string>Java</string>
240 <string>Shockwave Flash</string> 254 <string>Shockwave Flash</string>
241 </array> 255 </array>
242 </dd> 256 </dd>
243 </dl> 257 </dl>
244 258
245 Args: 259 Args:
246 parent: The DOM node for which the example will be added. 260 parent: The DOM node for which the example will be added.
247 policy: The data structure of a policy. 261 policy: The data structure of a policy.
248 ''' 262 '''
249 examples = self._AddStyledElement(parent, 'dl', ['dd dl']) 263 examples = self._AddStyledElement(parent, 'dl', ['dd dl'])
250 if self.IsPolicySupportedOnPlatform(policy, 'win'): 264 if self.IsPolicySupportedOnPlatform(policy, 'win'):
251 self._AddListExampleWindows(examples, policy) 265 self._AddListExampleWindowsChromeOS(examples, policy, True)
266 if self.IsPolicySupportedOnPlatform(policy, 'chrome_os'):
267 self._AddListExampleWindowsChromeOS(examples, policy, False)
252 if (self.IsPolicySupportedOnPlatform(policy, 'android') or 268 if (self.IsPolicySupportedOnPlatform(policy, 'android') or
253 self.IsPolicySupportedOnPlatform(policy, 'linux')): 269 self.IsPolicySupportedOnPlatform(policy, 'linux')):
254 self._AddListExampleAndroidLinux(examples, policy) 270 self._AddListExampleAndroidLinux(examples, policy)
255 if self.IsPolicySupportedOnPlatform(policy, 'mac'): 271 if self.IsPolicySupportedOnPlatform(policy, 'mac'):
256 self._AddListExampleMac(examples, policy) 272 self._AddListExampleMac(examples, policy)
257 273
258 def _PythonObjectToPlist(self, obj, indent=''): 274 def _PythonObjectToPlist(self, obj, indent=''):
259 '''Converts a python object to an equivalent XML plist. 275 '''Converts a python object to an equivalent XML plist.
260 276
261 Returns a list of lines.''' 277 Returns a list of lines.'''
(...skipping 28 matching lines...) Expand all
290 policy: A policy of type 'dict', for which the Mac example value 306 policy: A policy of type 'dict', for which the Mac example value
291 is generated. 307 is generated.
292 ''' 308 '''
293 example_value = policy['example_value'] 309 example_value = policy['example_value']
294 self.AddElement(parent, 'dt', {}, 'Mac:') 310 self.AddElement(parent, 'dt', {}, 'Mac:')
295 mac = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) 311 mac = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
296 mac_text = ['<key>%s</key>' % (policy['name'])] 312 mac_text = ['<key>%s</key>' % (policy['name'])]
297 mac_text += self._PythonObjectToPlist(example_value) 313 mac_text += self._PythonObjectToPlist(example_value)
298 self.AddText(mac, '\n'.join(mac_text)) 314 self.AddText(mac, '\n'.join(mac_text))
299 315
300 def _AddDictionaryExampleWindows(self, parent, policy): 316 def _AddDictionaryExampleWindowsChromeOS(self, parent, policy, is_win):
301 '''Adds an example value for Windows of a 'dict' policy to a DOM node. 317 '''Adds an example value for Windows of a 'dict' policy to a DOM node.
302 318
303 Args: 319 Args:
304 parent: The DOM node for which the example will be added. 320 parent: The DOM node for which the example will be added.
305 policy: A policy of type 'dict', for which the Windows example value 321 policy: A policy of type 'dict', for which the Windows example value
306 is generated. 322 is generated.
307 ''' 323 '''
308 self.AddElement(parent, 'dt', {}, 'Windows:') 324 os_header = self._GetLocalizedMessage('win_example_value') if is_win else \
309 win = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre']) 325 self._GetLocalizedMessage('chrome_os_example_value')
310 if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy): 326 self.AddElement(parent, 'dt', {}, os_header)
311 key_name = self.config['win_reg_recommended_key_name'] 327 element = self._AddStyledElement(parent, 'dd', ['.monospace', '.pre'])
312 else: 328 key_name = self._GetRegistryKeyName(policy, is_win)
313 key_name = self.config['win_reg_mandatory_key_name']
314 example = json.dumps(policy['example_value']) 329 example = json.dumps(policy['example_value'])
315 self.AddText(win, '%s\\%s = %s' % (key_name, policy['name'], example)) 330 self.AddText(element, '%s\\%s = %s' % (key_name, policy['name'], example))
316 331
317 def _AddDictionaryExampleAndroidLinux(self, parent, policy): 332 def _AddDictionaryExampleAndroidLinux(self, parent, policy):
318 '''Adds an example value for Android/Linux of a 'dict' policy to a DOM node. 333 '''Adds an example value for Android/Linux of a 'dict' policy to a DOM node.
319 334
320 Args: 335 Args:
321 parent: The DOM node for which the example will be added. 336 parent: The DOM node for which the example will be added.
322 policy: A policy of type 'dict', for which the Android/Linux example value 337 policy: A policy of type 'dict', for which the Android/Linux example value
323 is generated. 338 is generated.
324 ''' 339 '''
325 self.AddElement(parent, 'dt', {}, 'Android/Linux:') 340 self.AddElement(parent, 'dt', {}, 'Android/Linux:')
326 element = self._AddStyledElement(parent, 'dd', ['.monospace']) 341 element = self._AddStyledElement(parent, 'dd', ['.monospace'])
327 example = json.dumps(policy['example_value']) 342 example = json.dumps(policy['example_value'])
328 self.AddText(element, '%s: %s' % (policy['name'], example)) 343 self.AddText(element, '%s: %s' % (policy['name'], example))
329 344
330 def _AddDictionaryExample(self, parent, policy): 345 def _AddDictionaryExample(self, parent, policy):
331 '''Adds the example value of a 'dict' policy to a DOM node. Example output: 346 '''Adds the example value of a 'dict' policy to a DOM node. Example output:
332 <dl> 347 <dl>
333 <dt>Windows:</dt> 348 <dt>Windows (Windows clients):</dt>
334 <dd> 349 <dd>
335 Software\Policies\Chromium\ProxySettings = "{ 'ProxyMode': 'direct' }" 350 Software\Policies\Chromium\ProxySettings = "{ 'ProxyMode': 'direct' }"
336 </dd> 351 </dd>
352 <dt>Windows (Chromium OS clients):</dt>
353 <dd>
354 Software\Policies\ChromiumOS\ProxySettings = "{ 'ProxyMode': 'direct' }"
355 </dd>
337 <dt>Android/Linux:</dt> 356 <dt>Android/Linux:</dt>
338 <dd>"ProxySettings": { 357 <dd>"ProxySettings": {
339 "ProxyMode": "direct" 358 "ProxyMode": "direct"
340 } 359 }
341 </dd> 360 </dd>
342 <dt>Mac:</dt> 361 <dt>Mac:</dt>
343 <dd> 362 <dd>
344 <key>ProxySettings</key> 363 <key>ProxySettings</key>
345 <dict> 364 <dict>
346 <key>ProxyMode</key> 365 <key>ProxyMode</key>
347 <string>direct</string> 366 <string>direct</string>
348 </dict> 367 </dict>
349 </dd> 368 </dd>
350 </dl> 369 </dl>
351 370
352 Args: 371 Args:
353 parent: The DOM node for which the example will be added. 372 parent: The DOM node for which the example will be added.
354 policy: The data structure of a policy. 373 policy: The data structure of a policy.
355 ''' 374 '''
356 examples = self._AddStyledElement(parent, 'dl', ['dd dl']) 375 examples = self._AddStyledElement(parent, 'dl', ['dd dl'])
357 if self.IsPolicySupportedOnPlatform(policy, 'win'): 376 if self.IsPolicySupportedOnPlatform(policy, 'win'):
358 self._AddDictionaryExampleWindows(examples, policy) 377 self._AddDictionaryExampleWindowsChromeOS(examples, policy, True)
378 if self.IsPolicySupportedOnPlatform(policy, 'chrome_os'):
379 self._AddDictionaryExampleWindowsChromeOS(examples, policy, False)
359 if (self.IsPolicySupportedOnPlatform(policy, 'android') or 380 if (self.IsPolicySupportedOnPlatform(policy, 'android') or
360 self.IsPolicySupportedOnPlatform(policy, 'linux')): 381 self.IsPolicySupportedOnPlatform(policy, 'linux')):
361 self._AddDictionaryExampleAndroidLinux(examples, policy) 382 self._AddDictionaryExampleAndroidLinux(examples, policy)
362 if self.IsPolicySupportedOnPlatform(policy, 'mac'): 383 if self.IsPolicySupportedOnPlatform(policy, 'mac'):
363 self._AddDictionaryExampleMac(examples, policy) 384 self._AddDictionaryExampleMac(examples, policy)
364 385
365 def _AddExample(self, parent, policy): 386 def _AddExample(self, parent, policy):
366 '''Adds the HTML DOM representation of the example value of a policy to 387 '''Adds the HTML DOM representation of the example value of a policy to
367 a DOM node. It is simple text for boolean policies, like 388 a DOM node. It is simple text for boolean policies, like
368 '0x00000001 (Windows), true (Linux), true (Android), <true /> (Mac)' 389 '0x00000001 (Windows), true (Linux), true (Android), <true /> (Mac)'
369 in case of boolean policies, but it may also contain other HTML elements. 390 in case of boolean policies, but it may also contain other HTML elements.
370 (See method _AddListExample.) 391 (See method _AddListExample.)
371 392
372 Args: 393 Args:
373 parent: The DOM node for which the example will be added. 394 parent: The DOM node for which the example will be added.
374 policy: The data structure of a policy. 395 policy: The data structure of a policy.
375 396
376 Raises: 397 Raises:
377 Exception: If the type of the policy is unknown or the example value 398 Exception: If the type of the policy is unknown or the example value
378 of the policy is out of its expected range. 399 of the policy is out of its expected range.
379 ''' 400 '''
380 example_value = policy['example_value'] 401 example_value = policy['example_value']
381 policy_type = policy['type'] 402 policy_type = policy['type']
382 if policy_type == 'main': 403 if policy_type == 'main':
383 pieces = [] 404 pieces = []
384 if self.IsPolicySupportedOnPlatform(policy, 'win'): 405 if self.IsPolicySupportedOnPlatform(policy, 'win') or \
406 self.IsPolicySupportedOnPlatform(policy, 'chrome_os'):
385 value = '0x00000001' if example_value else '0x00000000' 407 value = '0x00000001' if example_value else '0x00000000'
386 pieces.append(value + ' (Windows)') 408 pieces.append(value + ' (Windows)')
387 if self.IsPolicySupportedOnPlatform(policy, 'linux'): 409 if self.IsPolicySupportedOnPlatform(policy, 'linux'):
388 value = 'true' if example_value else 'false' 410 value = 'true' if example_value else 'false'
389 pieces.append(value + ' (Linux)') 411 pieces.append(value + ' (Linux)')
390 if self.IsPolicySupportedOnPlatform(policy, 'android'): 412 if self.IsPolicySupportedOnPlatform(policy, 'android'):
391 value = 'true' if example_value else 'false' 413 value = 'true' if example_value else 'false'
392 pieces.append(value + ' (Android)') 414 pieces.append(value + ' (Android)')
393 if self.IsPolicySupportedOnPlatform(policy, 'mac'): 415 if self.IsPolicySupportedOnPlatform(policy, 'mac'):
394 value = '<true />' if example_value else '<false />' 416 value = '<true />' if example_value else '<false />'
395 pieces.append(value + ' (Mac)') 417 pieces.append(value + ' (Mac)')
396 self.AddText(parent, ', '.join(pieces)) 418 self.AddText(parent, ', '.join(pieces))
397 elif policy_type == 'string': 419 elif policy_type == 'string':
398 self.AddText(parent, '"%s"' % example_value) 420 self.AddText(parent, '"%s"' % example_value)
399 elif policy_type in ('int', 'int-enum'): 421 elif policy_type in ('int', 'int-enum'):
400 pieces = [] 422 pieces = []
401 if self.IsPolicySupportedOnPlatform(policy, 'win'): 423 if self.IsPolicySupportedOnPlatform(policy, 'win') or \
424 self.IsPolicySupportedOnPlatform(policy, 'chrome_os'):
402 pieces.append('0x%08x (Windows)' % example_value) 425 pieces.append('0x%08x (Windows)' % example_value)
403 if self.IsPolicySupportedOnPlatform(policy, 'linux'): 426 if self.IsPolicySupportedOnPlatform(policy, 'linux'):
404 pieces.append('%d (Linux)' % example_value) 427 pieces.append('%d (Linux)' % example_value)
405 if self.IsPolicySupportedOnPlatform(policy, 'android'): 428 if self.IsPolicySupportedOnPlatform(policy, 'android'):
406 pieces.append('%d (Android)' % example_value) 429 pieces.append('%d (Android)' % example_value)
407 if self.IsPolicySupportedOnPlatform(policy, 'mac'): 430 if self.IsPolicySupportedOnPlatform(policy, 'mac'):
408 pieces.append('%d (Mac)' % example_value) 431 pieces.append('%d (Mac)' % example_value)
409 self.AddText(parent, ', '.join(pieces)) 432 self.AddText(parent, ', '.join(pieces))
410 elif policy_type == 'string-enum': 433 elif policy_type == 'string-enum':
411 self.AddText(parent, '"%s"' % (example_value)) 434 self.AddText(parent, '"%s"' % (example_value))
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 dl = self.AddElement(parent, 'dl') 505 dl = self.AddElement(parent, 'dl')
483 data_type = [self._TYPE_MAP[policy['type']]] 506 data_type = [self._TYPE_MAP[policy['type']]]
484 qualified_types = [] 507 qualified_types = []
485 is_complex_policy = False 508 is_complex_policy = False
486 if (self.IsPolicySupportedOnPlatform(policy, 'android') and 509 if (self.IsPolicySupportedOnPlatform(policy, 'android') and
487 self._RESTRICTION_TYPE_MAP.get(policy['type'], None)): 510 self._RESTRICTION_TYPE_MAP.get(policy['type'], None)):
488 qualified_types.append('Android:%s' % 511 qualified_types.append('Android:%s' %
489 self._RESTRICTION_TYPE_MAP[policy['type']]) 512 self._RESTRICTION_TYPE_MAP[policy['type']])
490 if policy['type'] in ('dict', 'list'): 513 if policy['type'] in ('dict', 'list'):
491 is_complex_policy = True 514 is_complex_policy = True
492 if (self.IsPolicySupportedOnPlatform(policy, 'win') and 515 if ((self.IsPolicySupportedOnPlatform(policy, 'win') or
516 self.IsPolicySupportedOnPlatform(policy, 'chrome_os')) and
493 self._REG_TYPE_MAP.get(policy['type'], None)): 517 self._REG_TYPE_MAP.get(policy['type'], None)):
494 qualified_types.append('Windows:%s' % self._REG_TYPE_MAP[policy['type']]) 518 qualified_types.append('Windows:%s' % self._REG_TYPE_MAP[policy['type']])
495 if policy['type'] == 'dict': 519 if policy['type'] == 'dict':
496 is_complex_policy = True 520 is_complex_policy = True
497 if qualified_types: 521 if qualified_types:
498 data_type.append('[%s]' % ', '.join(qualified_types)) 522 data_type.append('[%s]' % ', '.join(qualified_types))
499 if is_complex_policy: 523 if is_complex_policy:
500 data_type.append('(%s)' % 524 data_type.append('(%s)' %
501 self._GetLocalizedMessage('complex_policies_on_windows')) 525 self._GetLocalizedMessage('complex_policies_on_windows'))
502 self._AddPolicyAttribute(dl, 'data_type', ' '.join(data_type)) 526 self._AddPolicyAttribute(dl, 'data_type', ' '.join(data_type))
503 if policy['type'] != 'external': 527 if policy['type'] != 'external':
504 # All types except 'external' can be set through platform policy. 528 # All types except 'external' can be set through platform policy.
505 if self.IsPolicySupportedOnPlatform(policy, 'win'): 529 if self.IsPolicySupportedOnPlatform(policy, 'win'):
506 if self.CanBeRecommended(policy) and not self.CanBeMandatory(policy): 530 key_name = self._GetRegistryKeyName(policy, True)
507 key_name = self.config['win_reg_recommended_key_name']
508 else:
509 key_name = self.config['win_reg_mandatory_key_name']
510 self._AddPolicyAttribute( 531 self._AddPolicyAttribute(
511 dl, 532 dl,
512 'win_reg_loc', 533 'win_reg_loc',
513 key_name + '\\' + policy['name'], 534 key_name + '\\' + policy['name'],
514 ['.monospace']) 535 ['.monospace'])
536 if self.IsPolicySupportedOnPlatform(policy, 'chrome_os'):
537 key_name = self._GetRegistryKeyName(policy, False)
538 self._AddPolicyAttribute(
539 dl,
540 'chrome_os_reg_loc',
541 key_name + '\\' + policy['name'],
542 ['.monospace'])
515 if (self.IsPolicySupportedOnPlatform(policy, 'linux') or 543 if (self.IsPolicySupportedOnPlatform(policy, 'linux') or
516 self.IsPolicySupportedOnPlatform(policy, 'mac')): 544 self.IsPolicySupportedOnPlatform(policy, 'mac')):
517 self._AddPolicyAttribute( 545 self._AddPolicyAttribute(
518 dl, 546 dl,
519 'mac_linux_pref_name', 547 'mac_linux_pref_name',
520 policy['name'], 548 policy['name'],
521 ['.monospace']) 549 ['.monospace'])
522 if self.IsPolicySupportedOnPlatform(policy, 'android', 'chrome'): 550 if self.IsPolicySupportedOnPlatform(policy, 'android', 'chrome'):
523 self._AddPolicyAttribute( 551 self._AddPolicyAttribute(
524 dl, 552 dl,
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 'div.group_desc': 'margin-top: 20px; margin-bottom: 20px;', 777 'div.group_desc': 'margin-top: 20px; margin-bottom: 20px;',
750 'ul': 'padding-left: 0px; margin-left: 0px;' 778 'ul': 'padding-left: 0px; margin-left: 0px;'
751 } 779 }
752 780
753 781
754 def GetTemplateText(self): 782 def GetTemplateText(self):
755 # Return the text representation of the main <div> tag. 783 # Return the text representation of the main <div> tag.
756 return self._main_div.toxml() 784 return self._main_div.toxml()
757 # To get a complete HTML file, use the following. 785 # To get a complete HTML file, use the following.
758 # return self._doc.toxml() 786 # return self._doc.toxml()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698