summaryrefslogtreecommitdiffstats
path: root/o3d
diff options
context:
space:
mode:
authortschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 19:00:58 +0000
committertschmelcher@chromium.org <tschmelcher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-16 19:00:58 +0000
commit36978307aa3c9b3dee389a42e2ec1c8b754b4f61 (patch)
treeaf1892b847a5ed7d9a1a63d661188cffce8d2d7b /o3d
parent205b6ad9ccc38f117de06a7e6470e72fc9c7b45d (diff)
downloadchromium_src-36978307aa3c9b3dee389a42e2ec1c8b754b4f61.zip
chromium_src-36978307aa3c9b3dee389a42e2ec1c8b754b4f61.tar.gz
chromium_src-36978307aa3c9b3dee389a42e2ec1c8b754b4f61.tar.bz2
Make plugin name and mimetype into overridable GYP variables, so that third parties can more easily redistribute the O3D NPAPI plugin under a different brand.
Analogous change for the ActiveX plugin will be in a forthcoming CL. TEST=built on Linux with various overridden values and checked that about:plugins showed the right thing; trybots BUG=none Review URL: http://codereview.chromium.org/599012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39109 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-rw-r--r--o3d/plugin/plugin.gyp16
-rw-r--r--o3d/plugin/version_info.py26
2 files changed, 22 insertions, 20 deletions
diff --git a/o3d/plugin/plugin.gyp b/o3d/plugin/plugin.gyp
index 1e18f0b..f2cd0fc 100644
--- a/o3d/plugin/plugin.gyp
+++ b/o3d/plugin/plugin.gyp
@@ -55,6 +55,10 @@
'../../native_client/src/shared/imc/imc.gyp:google_nacl_imc',
'idl/idl.gyp:o3dPluginIdl',
],
+ # Default name and mimetype. Can be overridden to allow making custom
+ # plugins based on O3D, but they will not work with regular O3D apps.
+ 'plugin_name%': 'O3D Plugin',
+ 'plugin_mimetype%': 'application/vnd.o3d.auto',
},
'includes': [
'../build/common.gypi',
@@ -66,9 +70,9 @@
'../../<(gtestdir)',
],
'defines': [
- 'O3D_PLUGIN_DESCRIPTION="<!(python version_info.py --description)"',
- 'O3D_PLUGIN_MIME_TYPE="<!(python version_info.py --mimetype)"',
- 'O3D_PLUGIN_NAME="<!(python version_info.py --name)"',
+ 'O3D_PLUGIN_DESCRIPTION="<!(python version_info.py --set_name="<(plugin_name)" --set_mimetype="<(plugin_mimetype)" --description)"',
+ 'O3D_PLUGIN_MIME_TYPE="<(plugin_mimetype)"',
+ 'O3D_PLUGIN_NAME="<(plugin_name)"',
'O3D_PLUGIN_VERSION="<!(python version_info.py --version)"',
],
},
@@ -186,6 +190,8 @@
'postbuild_name': 'Process Resource File',
'action': ['python',
'version_info.py',
+ '--set_name=<(plugin_name)',
+ '--set_mimetype=<(plugin_mimetype)',
'mac/o3d_plugin.r',
'${BUILT_PRODUCTS_DIR}/O3D.r',
],
@@ -495,6 +501,8 @@
],
'action': ['python',
'version_info.py',
+ '--set_name=<(plugin_name)',
+ '--set_mimetype=<(plugin_mimetype)',
'win/o3dPlugin.rc_template',
'win/o3dPlugin.rc'],
},
@@ -509,6 +517,8 @@
],
'action': ['python',
'version_info.py',
+ '--set_name=<(plugin_name)',
+ '--set_mimetype=<(plugin_mimetype)',
'mac/Info.plist',
'<(SHARED_INTERMEDIATE_DIR)/plugin/Info.plist',
],
diff --git a/o3d/plugin/version_info.py b/o3d/plugin/version_info.py
index cf908ce..0a234dd 100644
--- a/o3d/plugin/version_info.py
+++ b/o3d/plugin/version_info.py
@@ -31,21 +31,21 @@ FLAGS = gflags.FLAGS
gflags.DEFINE_boolean('kill_switch', False,
'Generate version numbers for kill switch binary.')
-gflags.DEFINE_boolean('name', False,
- 'Print out the plugin name and exit.')
-
gflags.DEFINE_boolean('description', False,
'Print out the plugin description and exit.')
-gflags.DEFINE_boolean('mimetype', False,
- 'Print out the plugin mime type and exit.')
-
gflags.DEFINE_boolean('version', False,
'Print out the plugin version and exit.')
gflags.DEFINE_boolean('commaversion', False,
'Print out the plugin version with commas and exit.')
+gflags.DEFINE_string('set_name', None,
+ 'Sets the plugin name to use.')
+
+gflags.DEFINE_string('set_mimetype', None,
+ 'Sets the plugin mimetype to use.')
+
def GetDotVersion(version):
return '%d.%d.%d.%d' % version
@@ -93,27 +93,19 @@ def main(argv):
# not change. If you change this you must change the name in
# samples/o3djs/util.js but be aware, changing the name
# will break all apps that use o3d on the web.
- O3D_PLUGIN_NAME = 'O3D Plugin'
+ O3D_PLUGIN_NAME = FLAGS.set_name
O3D_PLUGIN_VERSION = GetDotVersion(plugin_version)
O3D_PLUGIN_VERSION_COMMAS = GetCommaVersion(plugin_version)
O3D_SDK_VERSION = GetDotVersion(sdk_version)
O3D_SDK_VERSION_COMMAS = GetCommaVersion(sdk_version)
- O3D_PLUGIN_DESCRIPTION = '%s version:%s' % (O3D_PLUGIN_NAME,
+ O3D_PLUGIN_DESCRIPTION = '%s version: %s' % (O3D_PLUGIN_NAME,
O3D_PLUGIN_VERSION)
- O3D_PLUGIN_MIME_TYPE = 'application/vnd.o3d.auto'
-
- if FLAGS.name:
- print '%s' % O3D_PLUGIN_NAME
- sys.exit(0)
+ O3D_PLUGIN_MIME_TYPE = FLAGS.set_mimetype
if FLAGS.description:
print '%s' % O3D_PLUGIN_DESCRIPTION
sys.exit(0)
- if FLAGS.mimetype:
- print '%s' % O3D_PLUGIN_MIME_TYPE
- sys.exit(0)
-
if FLAGS.version:
print '%s' % O3D_PLUGIN_VERSION
sys.exit(0)