#include <nsICharsetConverterManager.h>
#include <nsIComponentManager.h>
#include <nsIFactory.h>
-#include <nsIServiceManagerUtils.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsIComponentRegistrar.h>
+# include <nsServiceManagerUtils.h>
+#else
+# include <nsIServiceManagerUtils.h>
+#endif
#include <nsIUnicodeEncoder.h>
#include "null_prompt_service.hpp"
}
}
- NS_IMETHODIMP null_prompt_service_factory::LockFactory(PRBool lock)
+ NS_IMETHODIMP null_prompt_service_factory::LockFactory(PRBool /*lock*/)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
{0xb4, 0x6a, 0x25, 0xc0, 0xb3, 0x8, 0xcb, 0xd0}
};
nsCOMPtr<nsIFactory> prompt_factory(new null_prompt_service_factory);
- check(nsComponentManager::RegisterFactory(
- prompt_service_cid,
- "Prompt Service",
- "@mozilla.org/embedcomp/prompt-service;1",
- prompt_factory,
- PR_TRUE)); // replace existing
+# if MOZ_VERSION_MAJOR > 1 \
+ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+ nsCOMPtr<nsIComponentRegistrar> comp_registrar;
+ check(NS_GetComponentRegistrar(getter_AddRefs(comp_registrar)));
+ check(comp_registrar->RegisterFactory(
+ prompt_service_cid,
+ "Prompt Service",
+ "@mozilla.org/embedcomp/prompt-service;1",
+ prompt_factory));
+# else
+ check(nsComponentManager::RegisterFactory(
+ prompt_service_cid,
+ "Prompt Service",
+ "@mozilla.org/embedcomp/prompt-service;1",
+ prompt_factory,
+ PR_TRUE)); // replace existing
+# endif
}