summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 18:46:52 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-16 18:46:52 +0000
commit47d209421f46bfe6910ac8f87a28f684c3768987 (patch)
tree663ea1787d11294ac0d141dad93a70fdbc5d0008
parent9f043377e0fa22c46a45054bfcead621afe27af5 (diff)
downloadchromium_src-47d209421f46bfe6910ac8f87a28f684c3768987.zip
chromium_src-47d209421f46bfe6910ac8f87a28f684c3768987.tar.gz
chromium_src-47d209421f46bfe6910ac8f87a28f684c3768987.tar.bz2
Stuff the MCX policy file into the app bundle where it belongs.
BUG=http://crbug.com/45334 TEST=build chromium, open the package, look in the resources folder, see either "org.chromium.Chromium.manifest" or "com.google.Chrome.manifest" (depending on the build). Open the file, see either "Chromium" or "Google Chrome" at the top (again, depending on the build). Review URL: http://codereview.chromium.org/2809057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52710 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/policy/mac/app-Manifest.plist8
-rw-r--r--chrome/browser/configuration_policy_provider.cc2
-rw-r--r--chrome/chrome_exe.gypi27
-rwxr-xr-xchrome/tools/build/mac/copy_mcx_manifest.sh22
4 files changed, 53 insertions, 6 deletions
diff --git a/chrome/app/policy/mac/app-Manifest.plist b/chrome/app/policy/mac/app-Manifest.plist
index a6bc820..2b4e553 100644
--- a/chrome/app/policy/mac/app-Manifest.plist
+++ b/chrome/app/policy/mac/app-Manifest.plist
@@ -3,15 +3,15 @@
<plist version="1.0">
<dict>
<key>pfm_name</key>
- <string>${EXECUTABLE_NAME}</string>
+ <string>@APP_NAME@</string>
<key>pfm_title</key>
- <string>${EXECUTABLE_NAME}</string>
+ <string>@APP_NAME@</string>
<key>pfm_description</key>
- <string>${EXECUTABLE_NAME} preferences</string>
+ <string>@APP_NAME@ preferences</string>
<key>pfm_version</key>
<real>1</real>
<key>pfm_domain</key>
- <string>${CHROMIUM_BUNDLE_ID}</string>
+ <string>@CHROMIUM_BUNDLE_ID@</string>
<key>pfm_subkeys</key>
<array>
<dict>
diff --git a/chrome/browser/configuration_policy_provider.cc b/chrome/browser/configuration_policy_provider.cc
index 8b28c04..9a800d6 100644
--- a/chrome/browser/configuration_policy_provider.cc
+++ b/chrome/browser/configuration_policy_provider.cc
@@ -9,7 +9,7 @@
namespace {
// TODO(avi): Use this mapping to auto-generate MCX manifests and Windows
-// ADM/ADMX files. http://crbug.com/45334
+// ADM/ADMX files. http://crbug.com/49316
struct InternalPolicyValueMapEntry {
ConfigurationPolicyStore::PolicyType policy_type;
diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi
index 16547a4..116e9d5 100644
--- a/chrome/chrome_exe.gypi
+++ b/chrome/chrome_exe.gypi
@@ -284,7 +284,7 @@
'actions': [
{
# Generate the InfoPlist.strings file
- 'action_name': 'Generating InfoPlist.strings files',
+ 'action_name': 'Generate InfoPlist.strings files',
'variables': {
'tool_path': '<(PRODUCT_DIR)/infoplist_strings_tool',
# Unique dir to write to so the [lang].lproj/InfoPlist.strings
@@ -324,6 +324,31 @@
'message': 'Generating the language InfoPlist.strings files',
'process_outputs_as_mac_bundle_resources': 1,
},
+ {
+ # Massage the manifest and add it as a resource
+ 'action_name': 'Generate MCX manifest file',
+ 'variables': {
+ 'tool_path': 'tools/build/mac/copy_mcx_manifest.sh',
+ 'input_path': 'app/policy/mac/app-Manifest.plist',
+ 'output_path': '<(INTERMEDIATE_DIR)/<(mac_bundle_id).manifest',
+ },
+ 'inputs': [
+ '<(tool_path)',
+ '<(input_path)',
+ ],
+ 'outputs': [
+ '<(output_path)',
+ ],
+ 'action': [
+ '<(tool_path)',
+ '<(mac_product_name)',
+ '<(mac_bundle_id)',
+ '<(input_path)',
+ '<(output_path)',
+ ],
+ 'message': 'Generating the MCX policy manifest file',
+ 'process_outputs_as_mac_bundle_resources': 1,
+ },
],
'copies': [
{
diff --git a/chrome/tools/build/mac/copy_mcx_manifest.sh b/chrome/tools/build/mac/copy_mcx_manifest.sh
new file mode 100755
index 0000000..fc4cbfc
--- /dev/null
+++ b/chrome/tools/build/mac/copy_mcx_manifest.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# Copyright (c) 2010 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.
+
+set -e
+
+if [[ ${#} -ne 4 ]]; then
+ echo "usage: ${0} APP_NAME IDENTIFIER SOURCE DESTINATION" >&2
+ exit 1
+fi
+
+APP_NAME="${1}"
+IDENTIFIER=${2}
+SOURCE=${3}
+DESTINATION=${4}
+
+# All hail sed.
+exec sed -e "s/@APP_NAME@/${APP_NAME}/g" \
+ -e "s/@CHROMIUM_BUNDLE_ID@/${IDENTIFIER}/g" \
+ "${SOURCE}" > "${DESTINATION}"