diff --git a/extensions/pref/autoconfig/src/Makefile.in b/extensions/pref/autoconfig/src/Makefile.in index 830f5ae62ab..4f6b6673204 100644 --- a/extensions/pref/autoconfig/src/Makefile.in +++ b/extensions/pref/autoconfig/src/Makefile.in @@ -5,3 +5,17 @@ AUTOCFG_JS_EXPORTS = \ $(srcdir)/prefcalls.js \ $(NULL) + +ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) +AUTOCFG_JS_EXPORTS += $(srcdir)/mac/platform.js +else +ifeq ($(MOZ_WIDGET_TOOLKIT), windows) +AUTOCFG_JS_EXPORTS += $(srcdir)/win/platform.js +else +ifeq ($(MOZ_WIDGET_TOOLKIT), beos) +AUTOCFG_JS_EXPORTS += $(srcdir)/beos/platform.js +else +AUTOCFG_JS_EXPORTS += $(srcdir)/unix/platform.js +endif +endif +endif diff --git a/extensions/pref/autoconfig/src/beos/platform.js b/extensions/pref/autoconfig/src/beos/platform.js new file mode 100644 index 00000000000..1292a963f9b --- /dev/null +++ b/extensions/pref/autoconfig/src/beos/platform.js @@ -0,0 +1,6 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// BeOS specific auto configuration preference defaults +platform.value = "beos"; diff --git a/extensions/pref/autoconfig/src/mac/platform.js b/extensions/pref/autoconfig/src/mac/platform.js new file mode 100644 index 00000000000..1852f4c33aa --- /dev/null +++ b/extensions/pref/autoconfig/src/mac/platform.js @@ -0,0 +1,6 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Mac specific auto configuration preference defaults +platform.value = "macintosh"; diff --git a/extensions/pref/autoconfig/src/nsReadConfig.cpp b/extensions/pref/autoconfig/src/nsReadConfig.cpp index d995baf1b3f..85a0c148ad7 100644 --- a/extensions/pref/autoconfig/src/nsReadConfig.cpp +++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp @@ -158,6 +158,11 @@ nsresult nsReadConfig::readConfigFile() if (NS_FAILED(rv)) return rv; + // Evaluate platform specific directives + rv = openAndEvaluateJSFile("platform.js", 0, false, false); + if (NS_FAILED(rv)) + return rv; + mRead = true; } // If the lockFileName is nullptr return ok, because no lockFile will be used diff --git a/extensions/pref/autoconfig/src/prefcalls.js b/extensions/pref/autoconfig/src/prefcalls.js index 723f771b0fc..751584bcb7c 100644 --- a/extensions/pref/autoconfig/src/prefcalls.js +++ b/extensions/pref/autoconfig/src/prefcalls.js @@ -10,6 +10,9 @@ const LDAPSyncQueryContractID = "@mozilla.org/ldapsyncquery;1"; const nsIPrefService = Components.interfaces.nsIPrefService; const PrefServiceContractID = "@mozilla.org/preferences-service;1"; +// set on a platform specific basis in platform.js +platform = { value: "" }; + var gVersion; function getPrefBranch() { diff --git a/extensions/pref/autoconfig/src/unix/platform.js b/extensions/pref/autoconfig/src/unix/platform.js new file mode 100644 index 00000000000..2489346b740 --- /dev/null +++ b/extensions/pref/autoconfig/src/unix/platform.js @@ -0,0 +1,6 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Unix specific auto configuration preference defaults +platform.value = "unix"; diff --git a/extensions/pref/autoconfig/src/win/platform.js b/extensions/pref/autoconfig/src/win/platform.js new file mode 100644 index 00000000000..e7077f73f6e --- /dev/null +++ b/extensions/pref/autoconfig/src/win/platform.js @@ -0,0 +1,6 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Windows specific auto configuration preference defaults +platform.value = "windows";