OLD | NEW |
| (Empty) |
1 #!/usr/bin/env python | |
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 | |
4 # found in the LICENSE file. | |
5 | |
6 | |
7 def GetConfigurationForBuild(defines): | |
8 '''Returns a configuration dictionary for the given build that contains | |
9 build-specific settings and information. | |
10 | |
11 Args: | |
12 defines: Definitions coming from the build system. | |
13 | |
14 Raises: | |
15 Exception: If 'defines' contains an unknown build-type. | |
16 ''' | |
17 # The prefix of key names in config determines which writer will use their | |
18 # corresponding values: | |
19 # win: Both ADM and ADMX. | |
20 # mac: Only plist. | |
21 # admx: Only ADMX. | |
22 # none/other: Used by all the writers. | |
23 if '_chromium' in defines: | |
24 config = { | |
25 'build': 'chromium', | |
26 'app_name': 'Chromium', | |
27 'frame_name': 'Chromium Frame', | |
28 'os_name': 'Chromium OS', | |
29 'webview_name': 'Chromium WebView', | |
30 'win_reg_mandatory_key_name': 'Software\\Policies\\Chromium', | |
31 'win_reg_recommended_key_name': | |
32 'Software\\Policies\\Chromium\\Recommended', | |
33 'win_mandatory_category_path': ['chromium'], | |
34 'win_recommended_category_path': ['chromium_recommended'], | |
35 'admx_namespace': 'Chromium.Policies.Chromium', | |
36 'admx_prefix': 'chromium', | |
37 'linux_policy_path': '/etc/chromium/policies/', | |
38 } | |
39 elif '_google_chrome' in defines: | |
40 config = { | |
41 'build': 'chrome', | |
42 'app_name': 'Google Chrome', | |
43 'frame_name': 'Google Chrome Frame', | |
44 'os_name': 'Google Chrome OS', | |
45 'webview_name': 'Android System WebView', | |
46 'win_reg_mandatory_key_name': 'Software\\Policies\\Google\\Chrome', | |
47 'win_reg_recommended_key_name': | |
48 'Software\\Policies\\Google\\Chrome\\Recommended', | |
49 'win_mandatory_category_path': ['google', 'googlechrome'], | |
50 'win_recommended_category_path': ['google', 'googlechrome_recommended'], | |
51 'admx_namespace': 'Google.Policies.Chrome', | |
52 'admx_prefix': 'chrome', | |
53 'linux_policy_path': '/etc/opt/chrome/policies/', | |
54 } | |
55 else: | |
56 raise Exception('Unknown build') | |
57 if 'version' in defines: | |
58 config['version'] = defines['version'] | |
59 config['win_group_policy_class'] = 'Both' | |
60 config['win_supported_os'] = 'SUPPORTED_WINXPSP2' | |
61 if 'mac_bundle_id' in defines: | |
62 config['mac_bundle_id'] = defines['mac_bundle_id'] | |
63 config['android_webview_restriction_prefix'] = 'com.android.browser:' | |
64 return config | |
OLD | NEW |