xpfe/appshell/src/nsAppShellFactory.cpp

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7ef1b67d9f32
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 #include "mozilla/ModuleUtils.h"
7 #include "nscore.h"
8 #include "nsIWindowMediator.h"
9
10 #include "nsIAppShellService.h"
11 #include "nsAppShellService.h"
12 #include "nsWindowMediator.h"
13 #include "nsChromeTreeOwner.h"
14 #include "nsAppShellCID.h"
15
16 NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService)
17 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init)
18
19 NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID);
20 NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID);
21
22 static const mozilla::Module::CIDEntry kAppShellCIDs[] = {
23 { &kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor },
24 { &kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor },
25 { nullptr }
26 };
27
28 static const mozilla::Module::ContractIDEntry kAppShellContracts[] = {
29 { NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID },
30 { NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID },
31 { nullptr }
32 };
33
34 static nsresult
35 nsAppShellModuleConstructor()
36 {
37 return nsChromeTreeOwner::InitGlobals();
38 }
39
40 static void
41 nsAppShellModuleDestructor()
42 {
43 nsChromeTreeOwner::FreeGlobals();
44 }
45
46 static const mozilla::Module kAppShellModule = {
47 mozilla::Module::kVersion,
48 kAppShellCIDs,
49 kAppShellContracts,
50 nullptr,
51 nullptr,
52 nsAppShellModuleConstructor,
53 nsAppShellModuleDestructor
54 };
55
56 NSMODULE_DEFN(appshell) = &kAppShellModule;

mercurial