michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "mozilla/ModuleUtils.h" michael@0: #include "nscore.h" michael@0: #include "nsIWindowMediator.h" michael@0: michael@0: #include "nsIAppShellService.h" michael@0: #include "nsAppShellService.h" michael@0: #include "nsWindowMediator.h" michael@0: #include "nsChromeTreeOwner.h" michael@0: #include "nsAppShellCID.h" michael@0: michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService) michael@0: NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init) michael@0: michael@0: NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID); michael@0: NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID); michael@0: michael@0: static const mozilla::Module::CIDEntry kAppShellCIDs[] = { michael@0: { &kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor }, michael@0: { &kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static const mozilla::Module::ContractIDEntry kAppShellContracts[] = { michael@0: { NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID }, michael@0: { NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID }, michael@0: { nullptr } michael@0: }; michael@0: michael@0: static nsresult michael@0: nsAppShellModuleConstructor() michael@0: { michael@0: return nsChromeTreeOwner::InitGlobals(); michael@0: } michael@0: michael@0: static void michael@0: nsAppShellModuleDestructor() michael@0: { michael@0: nsChromeTreeOwner::FreeGlobals(); michael@0: } michael@0: michael@0: static const mozilla::Module kAppShellModule = { michael@0: mozilla::Module::kVersion, michael@0: kAppShellCIDs, michael@0: kAppShellContracts, michael@0: nullptr, michael@0: nullptr, michael@0: nsAppShellModuleConstructor, michael@0: nsAppShellModuleDestructor michael@0: }; michael@0: michael@0: NSMODULE_DEFN(appshell) = &kAppShellModule;