Bug 1419102 - Move nsIEnterprisePolicies to toolkit so that platform code can include it and attempt to get the service. r=Mossop
Platform code should null-check for the service so that other apps that don't implement it (e.g. Android) handle it gracefully
* * *
[mq]: fixtestsvc
MozReview-Commit-ID: 9hHhcD843Qs
--- a/browser/components/enterprisepolicies/moz.build
+++ b/browser/components/enterprisepolicies/moz.build
@@ -11,22 +11,16 @@ DIRS += [
'helpers',
'schemas',
]
TEST_DIRS += [
'tests'
]
-XPIDL_SOURCES += [
- 'nsIEnterprisePolicies.idl',
-]
-
-XPIDL_MODULE = 'enterprisepolicies'
-
EXTRA_COMPONENTS += [
'EnterprisePolicies.js',
'EnterprisePolicies.manifest',
'EnterprisePoliciesContent.js',
]
EXTRA_JS_MODULES.policies += [
'Policies.jsm',
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -170,17 +170,16 @@
#endif
@RESPATH@/components/appshell.xpt
@RESPATH@/components/appstartup.xpt
@RESPATH@/components/autocomplete.xpt
@RESPATH@/components/autoconfig.xpt
@RESPATH@/components/browser-element.xpt
@RESPATH@/browser/components/browsercompsbase.xpt
@RESPATH@/browser/components/browser-feeds.xpt
-@RESPATH@/browser/components/enterprisepolicies.xpt
@RESPATH@/components/caps.xpt
@RESPATH@/components/chrome.xpt
#ifdef MOZ_CODE_COVERAGE
@RESPATH@/components/code-coverage.xpt
#endif
@RESPATH@/components/commandhandler.xpt
@RESPATH@/components/commandlines.xpt
@RESPATH@/components/composer.xpt
@@ -225,16 +224,17 @@
@RESPATH@/components/dom_workers.xpt
@RESPATH@/components/dom_xbl.xpt
@RESPATH@/components/dom_xhr.xpt
@RESPATH@/components/dom_xpath.xpt
@RESPATH@/components/dom_xul.xpt
@RESPATH@/components/dom_presentation.xpt
@RESPATH@/components/downloads.xpt
@RESPATH@/components/editor.xpt
+@RESPATH@/components/enterprisepolicies.xpt
@RESPATH@/components/extensions.xpt
@RESPATH@/components/exthandler.xpt
@RESPATH@/components/fastfind.xpt
@RESPATH@/components/feeds.xpt
@RESPATH@/components/gfx.xpt
@RESPATH@/components/html5.xpt
@RESPATH@/components/htmlparser.xpt
@RESPATH@/components/imglib2.xpt
new file mode 100644
--- /dev/null
+++ b/toolkit/components/enterprisepolicies/moz.build
@@ -0,0 +1,14 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# 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/.
+
+with Files("**"):
+ BUG_COMPONENT = ("Firefox", "Enterprise Policies")
+
+XPIDL_SOURCES += [
+ 'nsIEnterprisePolicies.idl',
+]
+
+XPIDL_MODULE = 'enterprisepolicies'
rename from browser/components/enterprisepolicies/nsIEnterprisePolicies.idl
rename to toolkit/components/enterprisepolicies/nsIEnterprisePolicies.idl
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -25,16 +25,17 @@ DIRS += [
'cloudstorage',
'commandlines',
'contentprefs',
'contextualidentity',
'crashes',
'crashmonitor',
'diskspacewatcher',
'downloads',
+ 'enterprisepolicies',
'extensions',
'filewatcher',
'finalizationwitness',
'find',
'jsdownloads',
'jsoncpp/src/lib_json',
'lz4',
'mediasniffer',
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ b/toolkit/modules/tests/xpcshell/test_Services.js
@@ -65,17 +65,17 @@ function run_test() {
checkService("wm", Ci.nsIWindowMediator);
checkService("ww", Ci.nsIWindowWatcher);
if ("nsIBrowserSearchService" in Ci) {
checkService("search", Ci.nsIBrowserSearchService);
}
if ("nsIAndroidBridge" in Ci) {
checkService("androidBridge", Ci.nsIAndroidBridge);
}
- if ("nsIEnterprisePolicies" in Ci) {
+ if ("@mozilla.org/browser/enterprisepolicies;1" in Cc) {
checkService("policies", Ci.nsIEnterprisePolicies);
}
// In xpcshell tests, the "@mozilla.org/xre/app-info;1" component implements
// only the nsIXULRuntime interface, but not nsIXULAppInfo. To test the
// service getter for the latter interface, load mock app-info.
let tmp = {};