| 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 '''python %prog [options] platform chromium_os_flag template | 6 '''python %prog [options] platform chromium_os_flag template |
| 7 | 7 |
| 8 platform specifies which platform source is being generated for | 8 platform specifies which platform source is being generated for |
| 9 and can be one of (win, mac, linux) | 9 and can be one of (win, mac, linux) |
| 10 chromium_os_flag should be 1 if this is a Chromium OS build | 10 chromium_os_flag should be 1 if this is a Chromium OS build |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 policy.enterprise_default | 713 policy.enterprise_default |
| 714 else: | 714 else: |
| 715 raise RuntimeError('Type %s of policy %s is not supported at ' | 715 raise RuntimeError('Type %s of policy %s is not supported at ' |
| 716 'enterprise defaults' % (policy.policy_type, | 716 'enterprise defaults' % (policy.policy_type, |
| 717 policy.name)) | 717 policy.name)) |
| 718 f.write(' if (!policy_map->Get(key::k%s)) {\n' | 718 f.write(' if (!policy_map->Get(key::k%s)) {\n' |
| 719 ' policy_map->Set(key::k%s,\n' | 719 ' policy_map->Set(key::k%s,\n' |
| 720 ' POLICY_LEVEL_MANDATORY,\n' | 720 ' POLICY_LEVEL_MANDATORY,\n' |
| 721 ' POLICY_SCOPE_USER,\n' | 721 ' POLICY_SCOPE_USER,\n' |
| 722 ' %s,\n' | 722 ' %s,\n' |
| 723 ' NULL);\n' | 723 ' NULL,\n' |
| 724 ' POLICY_SOURCE_ENTERPRISE_DEFAULT);\n' |
| 724 ' }\n' % (policy.name, policy.name, creation_expression)) | 725 ' }\n' % (policy.name, policy.name, creation_expression)) |
| 725 | 726 |
| 726 f.write('}\n' | 727 f.write('}\n' |
| 727 '#endif\n\n') | 728 '#endif\n\n') |
| 728 | 729 |
| 729 f.write('const PolicyDetails* GetChromePolicyDetails(' | 730 f.write('const PolicyDetails* GetChromePolicyDetails(' |
| 730 'const std::string& policy) {\n' | 731 'const std::string& policy) {\n' |
| 731 ' // First index in kPropertyNodes of the Chrome policies.\n' | 732 ' // First index in kPropertyNodes of the Chrome policies.\n' |
| 732 ' static const int begin_index = %s;\n' | 733 ' static const int begin_index = %s;\n' |
| 733 ' // One-past-the-end of the Chrome policies in kPropertyNodes.\n' | 734 ' // One-past-the-end of the Chrome policies in kPropertyNodes.\n' |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 # _WriteAppRestrictions body | 1049 # _WriteAppRestrictions body |
| 1049 f.write('<restrictions xmlns:android="' | 1050 f.write('<restrictions xmlns:android="' |
| 1050 'http://schemas.android.com/apk/res/android">\n\n') | 1051 'http://schemas.android.com/apk/res/android">\n\n') |
| 1051 for policy in policies: | 1052 for policy in policies: |
| 1052 if policy.is_supported and policy.restriction_type != 'invalid': | 1053 if policy.is_supported and policy.restriction_type != 'invalid': |
| 1053 WriteAppRestriction(policy) | 1054 WriteAppRestriction(policy) |
| 1054 f.write('</restrictions>') | 1055 f.write('</restrictions>') |
| 1055 | 1056 |
| 1056 if __name__ == '__main__': | 1057 if __name__ == '__main__': |
| 1057 sys.exit(main()) | 1058 sys.exit(main()) |
| OLD | NEW |