Commit 63b4d45f authored by Lutz Justen's avatar Lutz Justen Committed by Commit Bot

generate_extension_admx.py: Fix value names

Fixes a bug where the wrong registry value names where used, so that
setting policy didn't have effect. It used a hierarchical value name
  cat1_cat2_cat3_policy
This isn't necessary since the corresponding registry key already
contains the categories:
  Software\Policies\Google\Chrome\3rdparty\extensions\<extension_id>\Policy\cat1\cat2\cat3
so that the policy is guaranteed to be unique within the key. What's
worse is that the code isn't looking for 'cat1_cat2_cat3_policy', but
just for 'policy'. Hence, the policy settings were not taken.

Bug: 900517
Test: manual
Change-Id: I2e1b83fe2ff6b0997ab22e47c986a92dcb19559e
Reviewed-on: https://chromium-review.googlesource.com/c/1356699Reviewed-by: default avatarMaksim Ivanov <emaxx@chromium.org>
Commit-Queue: Lutz Justen <ljusten@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613080}
parent 8b1cca92
......@@ -223,7 +223,8 @@ class AdmxGenerator(object):
letters, uppercase letters, digits and the underscore character.
parenty_key: The registry key of the parent.
'''
full_name = parent_category_full_name + '_' + self._ToId(policy_name)
policy_id = self._ToId(policy_name)
full_name = parent_category_full_name + '_' + policy_id
policy_title = policy_schema.get('title', policy_name)
if 'id' in policy_schema:
......@@ -267,7 +268,7 @@ class AdmxGenerator(object):
'presentation')
self._SetAttribute(presentation_elem, 'id', full_name)
if policy_schema['type'] == 'boolean':
self._SetAttribute(policy_elem, 'valueName', full_name)
self._SetAttribute(policy_elem, 'valueName', policy_id)
enabled_value_elem = self._AddElement(policy_elem, 'enabledValue')
decimal_elem = self._AddElement(enabled_value_elem, 'decimal')
......@@ -280,7 +281,7 @@ class AdmxGenerator(object):
elements_elem = self._AddElement(policy_elem, 'elements')
decimal_elem = self._AddElement(elements_elem, 'decimal')
self._SetAttribute(decimal_elem, 'id', desc_id)
self._SetAttribute(decimal_elem, 'valueName', full_name)
self._SetAttribute(decimal_elem, 'valueName', policy_id)
textbox_elem = self._AddElement(presentation_elem, 'decimalTextBox')
self._SetAttribute(textbox_elem, 'refId', desc_id)
......@@ -293,7 +294,7 @@ class AdmxGenerator(object):
elements_elem = self._AddElement(policy_elem, 'elements')
text_elem = self._AddElement(elements_elem, 'text')
self._SetAttribute(text_elem, 'id', desc_id)
self._SetAttribute(text_elem, 'valueName', full_name)
self._SetAttribute(text_elem, 'valueName', policy_id)
textbox_elem = self._AddElement(presentation_elem, 'textBox')
self._SetAttribute(textbox_elem, 'refId', desc_id)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment