Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1410)

Unified Diff: tools/grit/grit/format/policy_templates/writer_configuration.py

Issue 1410853008: Move grit from DEPS into src. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: webview licenses Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/grit/grit/format/policy_templates/writer_configuration.py
diff --git a/tools/grit/grit/format/policy_templates/writer_configuration.py b/tools/grit/grit/format/policy_templates/writer_configuration.py
new file mode 100755
index 0000000000000000000000000000000000000000..db9613b2eca0d71a9feaad870526b549f2b7f8be
--- /dev/null
+++ b/tools/grit/grit/format/policy_templates/writer_configuration.py
@@ -0,0 +1,61 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+
+def GetConfigurationForBuild(defines):
+ '''Returns a configuration dictionary for the given build that contains
+ build-specific settings and information.
+
+ Args:
+ defines: Definitions coming from the build system.
+
+ Raises:
+ Exception: If 'defines' contains an unknown build-type.
+ '''
+ # The prefix of key names in config determines which writer will use their
+ # corresponding values:
+ # win: Both ADM and ADMX.
+ # mac: Only plist.
+ # admx: Only ADMX.
+ # none/other: Used by all the writers.
+ if '_chromium' in defines:
+ config = {
+ 'build': 'chromium',
+ 'app_name': 'Chromium',
+ 'frame_name': 'Chromium Frame',
+ 'os_name': 'Chromium OS',
+ 'win_reg_mandatory_key_name': 'Software\\Policies\\Chromium',
+ 'win_reg_recommended_key_name':
+ 'Software\\Policies\\Chromium\\Recommended',
+ 'win_mandatory_category_path': ['chromium'],
+ 'win_recommended_category_path': ['chromium_recommended'],
+ 'admx_namespace': 'Chromium.Policies.Chromium',
+ 'admx_prefix': 'chromium',
+ 'linux_policy_path': '/etc/chromium/policies/',
+ }
+ elif '_google_chrome' in defines:
+ config = {
+ 'build': 'chrome',
+ 'app_name': 'Google Chrome',
+ 'frame_name': 'Google Chrome Frame',
+ 'os_name': 'Google Chrome OS',
+ 'win_reg_mandatory_key_name': 'Software\\Policies\\Google\\Chrome',
+ 'win_reg_recommended_key_name':
+ 'Software\\Policies\\Google\\Chrome\\Recommended',
+ 'win_mandatory_category_path': ['google', 'googlechrome'],
+ 'win_recommended_category_path': ['google', 'googlechrome_recommended'],
+ 'admx_namespace': 'Google.Policies.Chrome',
+ 'admx_prefix': 'chrome',
+ 'linux_policy_path': '/etc/opt/chrome/policies/',
+ }
+ else:
+ raise Exception('Unknown build')
+ if 'version' in defines:
+ config['version'] = defines['version']
+ config['win_group_policy_class'] = 'Both'
+ config['win_supported_os'] = 'SUPPORTED_WINXPSP2'
+ if 'mac_bundle_id' in defines:
+ config['mac_bundle_id'] = defines['mac_bundle_id']
+ return config

Powered by Google App Engine
This is Rietveld 408576698