Bug 573101: Should not build PluginProvider.jsm when plugins are disabled. r=robstrong

This commit is contained in:
Dave Townsend 2010-07-12 14:20:49 -07:00
Родитель e74fa582ee
Коммит 297b9c4ba1
3 изменённых файлов: 30 добавлений и 5 удалений

Просмотреть файл

@ -47,10 +47,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ];
const CATEGORY_PROVIDER_MODULE = "addon-provider-module";
// A list of providers to load by default
const PROVIDERS = [
const DEFAULT_PROVIDERS = [
"resource://gre/modules/XPIProvider.jsm",
"resource://gre/modules/PluginProvider.jsm",
"resource://gre/modules/LightweightThemeManager.jsm"
];
@ -191,15 +192,32 @@ var AddonManagerInternal = {
}
// Ensure all default providers have had a chance to register themselves
PROVIDERS.forEach(function(url) {
DEFAULT_PROVIDERS.forEach(function(url) {
try {
Components.utils.import(url, {});
}
catch (e) {
ERROR("Exception loading provider \"" + url + "\": " + e);
ERROR("Exception loading default provider \"" + url + "\": " + e);
}
});
// Load any providers registered in the category manager
let catman = Cc["@mozilla.org/categorymanager;1"].
getService(Ci.nsICategoryManager);
let entries = catman.enumerateCategory(CATEGORY_PROVIDER_MODULE);
while (entries.hasMoreElements()) {
let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
let url = catman.getCategoryEntry(CATEGORY_PROVIDER_MODULE, entry);
try {
Components.utils.import(url, {});
}
catch (e) {
ERROR("Exception loading provider " + entry + " from category \"" +
url + "\": " + e);
}
}
let needsRestart = false;
this.providers.forEach(function(provider) {
callProvider(provider, "startup");

Просмотреть файл

@ -72,11 +72,15 @@ EXTRA_PP_JS_MODULES = \
AddonManager.jsm \
AddonRepository.jsm \
XPIProvider.jsm \
PluginProvider.jsm \
AddonUpdateChecker.jsm \
AddonLogging.jsm \
$(NULL)
ifdef MOZ_PLUGINS
EXTRA_PP_JS_MODULES += PluginProvider.jsm
DEFINES += -DMOZ_PLUGINS
endif
EXTRA_JS_MODULES = \
LightweightThemeManager.jsm \
$(NULL)

Просмотреть файл

@ -8,3 +8,6 @@ component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a}
#ifdef MOZ_PLUGINS
category addon-provider-module PluginProvider resource://gre/modules/PluginProvider.jsm
#endif