Index: grit/format/policy_templates/writers/plist_writer.py |
diff --git a/grit/format/policy_templates/writers/plist_writer.py b/grit/format/policy_templates/writers/plist_writer.py |
index 6ca905b9c5dccd81bd2728e7b11852d72774fbbc..6d929d6542687720a1dd3cde095a7886773600e3 100644 |
--- a/grit/format/policy_templates/writers/plist_writer.py |
+++ b/grit/format/policy_templates/writers/plist_writer.py |
@@ -67,7 +67,7 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter): |
self.AddElement(parent, 'key', {}, key_string) |
self.AddElement(parent, 'string', {}, value_string) |
- def _AddTargets(self, parent): |
+ def _AddTargets(self, parent, policy): |
'''Adds the following XML snippet to an XML element: |
<key>pfm_targets</key> |
<array> |
@@ -78,7 +78,10 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter): |
parent: The parent XML element where the snippet will be added. |
''' |
array = self._AddKeyValuePair(parent, 'pfm_targets', 'array') |
- self.AddElement(array, 'string', {}, 'user-managed') |
+ if self.CanBeRecommended(policy): |
+ self.AddElement(array, 'string', {}, 'user') |
+ if self.CanBeMandatory(policy): |
+ self.AddElement(array, 'string', {}, 'user-managed') |
def PreprocessPolicies(self, policy_list): |
return self.FlattenGroupsAndSortPolicies(policy_list) |
@@ -97,7 +100,7 @@ class PListWriter(xml_formatted_writer.XMLFormattedWriter): |
# Those files are generated by plist_strings_writer. |
self._AddStringKeyValuePair(dict, 'pfm_description', '') |
self._AddStringKeyValuePair(dict, 'pfm_title', '') |
- self._AddTargets(dict) |
+ self._AddTargets(dict, policy) |
self._AddStringKeyValuePair(dict, 'pfm_type', |
self.TYPE_TO_INPUT[policy_type]) |
if policy_type in ('int-enum', 'string-enum'): |