xpfe/appshell/src/nsAppShellFactory.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpfe/appshell/src/nsAppShellFactory.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,56 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "mozilla/ModuleUtils.h"
    1.10 +#include "nscore.h"
    1.11 +#include "nsIWindowMediator.h"
    1.12 +
    1.13 +#include "nsIAppShellService.h"
    1.14 +#include "nsAppShellService.h"
    1.15 +#include "nsWindowMediator.h"
    1.16 +#include "nsChromeTreeOwner.h"
    1.17 +#include "nsAppShellCID.h"
    1.18 +
    1.19 +NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppShellService)
    1.20 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWindowMediator, Init)
    1.21 +
    1.22 +NS_DEFINE_NAMED_CID(NS_APPSHELLSERVICE_CID);
    1.23 +NS_DEFINE_NAMED_CID(NS_WINDOWMEDIATOR_CID);
    1.24 +
    1.25 +static const mozilla::Module::CIDEntry kAppShellCIDs[] = {
    1.26 +  { &kNS_APPSHELLSERVICE_CID, false, nullptr, nsAppShellServiceConstructor },
    1.27 +  { &kNS_WINDOWMEDIATOR_CID, false, nullptr, nsWindowMediatorConstructor },
    1.28 +  { nullptr }
    1.29 +};
    1.30 +
    1.31 +static const mozilla::Module::ContractIDEntry kAppShellContracts[] = {
    1.32 +  { NS_APPSHELLSERVICE_CONTRACTID, &kNS_APPSHELLSERVICE_CID },
    1.33 +  { NS_WINDOWMEDIATOR_CONTRACTID, &kNS_WINDOWMEDIATOR_CID },
    1.34 +  { nullptr }
    1.35 +};
    1.36 +
    1.37 +static nsresult
    1.38 +nsAppShellModuleConstructor()
    1.39 +{
    1.40 +  return nsChromeTreeOwner::InitGlobals();
    1.41 +}
    1.42 +
    1.43 +static void
    1.44 +nsAppShellModuleDestructor()
    1.45 +{
    1.46 +  nsChromeTreeOwner::FreeGlobals();
    1.47 +}
    1.48 +
    1.49 +static const mozilla::Module kAppShellModule = {
    1.50 +  mozilla::Module::kVersion,
    1.51 +  kAppShellCIDs,
    1.52 +  kAppShellContracts,
    1.53 +  nullptr,
    1.54 +  nullptr,
    1.55 +  nsAppShellModuleConstructor,
    1.56 +  nsAppShellModuleDestructor
    1.57 +};
    1.58 +
    1.59 +NSMODULE_DEFN(appshell) = &kAppShellModule;

mercurial