• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
7def 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      'win_reg_mandatory_key_name': 'Software\\Policies\\Chromium',
30      'win_reg_recommended_key_name':
31          'Software\\Policies\\Chromium\\Recommended',
32      'win_mandatory_category_path': ['chromium'],
33      'win_recommended_category_path': ['chromium_recommended'],
34      'admx_namespace': 'Chromium.Policies.Chromium',
35      'admx_prefix': 'chromium',
36      'linux_policy_path': '/etc/chromium/policies/',
37    }
38  elif '_google_chrome' in defines:
39    config = {
40      'build': 'chrome',
41      'app_name': 'Google Chrome',
42      'frame_name': 'Google Chrome Frame',
43      'os_name': 'Google Chrome OS',
44      'win_reg_mandatory_key_name': 'Software\\Policies\\Google\\Chrome',
45      'win_reg_recommended_key_name':
46          'Software\\Policies\\Google\\Chrome\\Recommended',
47      'win_mandatory_category_path': ['google', 'googlechrome'],
48      'win_recommended_category_path': ['google', 'googlechrome_recommended'],
49      'admx_namespace': 'Google.Policies.Chrome',
50      'admx_prefix': 'chrome',
51      'linux_policy_path': '/etc/opt/chrome/policies/',
52    }
53  else:
54    raise Exception('Unknown build')
55  config['win_group_policy_class'] = 'Both'
56  config['win_supported_os'] = 'SUPPORTED_WINXPSP2'
57  if 'mac_bundle_id' in defines:
58    config['mac_bundle_id'] = defines['mac_bundle_id']
59  return config
60