diff --git a/mozilla/Makefile.in b/mozilla/Makefile.in index 736b0bc1405..6af7e8b828d 100644 --- a/mozilla/Makefile.in +++ b/mozilla/Makefile.in @@ -147,11 +147,17 @@ tier_9_dirs += \ modules/libutil \ netwerk \ modules/libjar \ + $(NULL) + +ifdef MOZ_XUL +tier_9_dirs += rdf +endif + +tier_9_dirs += \ uriloader \ modules/libpref \ modules/libimg \ caps \ - rdf \ parser/expat \ parser/htmlparser \ gfx \ @@ -201,15 +207,15 @@ endif # tier 50 - xpfe & toolkit # -ifdef MOZ_XUL ifdef MOZ_XUL_APP tier_50_dirs += chrome else +ifdef MOZ_XUL tier_50_dirs += rdf/chrome -endif else tier_50_dirs += embedding/minimo/chromelite endif +endif tier_50_dirs += profile @@ -262,6 +268,14 @@ ifdef MOZ_JAVAXPCOM tier_50_dirs += extensions/java endif +ifndef BUILD_STATIC_LIBS +ifdef MOZ_XUL_APP +ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)) +tier_50_dirs += embedding/browser/gtk +endif +endif +endif + ifdef MOZ_XUL_APP ifndef BUILD_STATIC_LIBS tier_50_dirs += toolkit/library @@ -383,10 +397,6 @@ endif endif endif -ifneq (,$(MOZ_ENABLE_GTK)$(MOZ_ENABLE_GTK2)) -tier_99_dirs += embedding/browser/gtk -endif - # viewer ifneq (,$(ENABLE_TESTS)) ifndef MOZ_ENABLE_LIBXUL @@ -532,7 +542,6 @@ tools_tier_%: $(MAKE) -C $$d tools; \ done -ifdef MOZ_ENABLE_LIBXUL tier_50: @echo "$@: $($@_dirs)" $(MAKE) export_tier_50 @@ -540,7 +549,6 @@ tier_50: $(MAKE) tools_tier_2 $(MAKE) tools_tier_9 $(MAKE) tools_tier_50 -endif tier_%: @echo "$@: $(if $($@_dirs),$($@_dirs),$(error Tier $* not present.))" diff --git a/mozilla/chrome/src/nsChromeFactory.cpp b/mozilla/chrome/src/nsChromeFactory.cpp index 4ab3b74123b..900d4dcc419 100644 --- a/mozilla/chrome/src/nsChromeFactory.cpp +++ b/mozilla/chrome/src/nsChromeFactory.cpp @@ -43,7 +43,6 @@ #include "nsIComponentManager.h" #include "nsIChromeRegistry.h" #include "nscore.h" -#include "rdf.h" #include "nsChromeProtocolHandler.h" #include "nsChromeRegistry.h" diff --git a/mozilla/chrome/src/nsChromeProtocolHandler.cpp b/mozilla/chrome/src/nsChromeProtocolHandler.cpp index 6ad32a04f47..2242568732e 100644 --- a/mozilla/chrome/src/nsChromeProtocolHandler.cpp +++ b/mozilla/chrome/src/nsChromeProtocolHandler.cpp @@ -66,13 +66,16 @@ #include "nsIServiceManager.h" #include "nsIStandardURL.h" #include "nsIStreamListener.h" -#include "nsIXULPrototypeCache.h" -#include "nsIXULPrototypeDocument.h" #include "nsNetUtil.h" #include "nsXPIDLString.h" #include "nsString.h" #include "prlog.h" +#ifdef MOZ_XUL +#include "nsIXULPrototypeCache.h" +#include "nsIXULPrototypeDocument.h" +#endif + //---------------------------------------------------------------------- static NS_DEFINE_CID(kXULPrototypeCacheCID, NS_XULPROTOTYPECACHE_CID); @@ -491,6 +494,8 @@ NS_IMETHODIMP nsChromeProtocolHandler::NewChannel(nsIURI* aURI, nsIChannel* *aResult) { + nsresult rv; + NS_ENSURE_ARG_POINTER(aURI); NS_PRECONDITION(aResult, "Null out param"); @@ -512,9 +517,9 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, } #endif - nsresult rv; nsCOMPtr result; +#ifdef MOZ_XUL // Check the prototype cache to see if we've already got the // document in the cache. nsCOMPtr cache @@ -550,6 +555,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, return NS_ERROR_OUT_OF_MEMORY; } else { +#endif // MOZ_XUL // Miss. Resolve the chrome URL using the registry and do a // normal necko load. //nsXPIDLCString oldSpec; @@ -632,6 +638,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, result->SetOwner(owner); } +#ifdef MOZ_XUL // Track FastLoad file dependencies. // // This is harder than it ought to be! While an nsResChannel "is-a" @@ -675,6 +682,7 @@ nsChromeProtocolHandler::NewChannel(nsIURI* aURI, } } } +#endif *aResult = result; NS_ADDREF(*aResult); diff --git a/mozilla/chrome/src/nsChromeRegistry.cpp b/mozilla/chrome/src/nsChromeRegistry.cpp index 850e3e2c375..e792be418e1 100644 --- a/mozilla/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/chrome/src/nsChromeRegistry.cpp @@ -102,6 +102,7 @@ #include "nsIXULAppInfo.h" #include "nsIXULRuntime.h" +#ifdef MOZ_XUL // keep all the RDF stuff together, in case we can remove it in the far future #include "rdf.h" #include "nsRDFCID.h" @@ -115,6 +116,15 @@ #include "nsIRDFContainer.h" #include "nsIRDFContainerUtils.h" +#define CHROME_URI "http://www.mozilla.org/rdf/chrome#" + +DEFINE_RDF_VOCAB(CHROME_URI, CHROME, packages); +DEFINE_RDF_VOCAB(CHROME_URI, CHROME, package); +DEFINE_RDF_VOCAB(CHROME_URI, CHROME, name); +DEFINE_RDF_VOCAB(CHROME_URI, CHROME, platformPackage); + +#endif + #define UILOCALE_CMD_LINE_ARG "UILocale" #define MATCH_OS_LOCALE_PREF "intl.locale.matchOS" @@ -126,13 +136,6 @@ static NS_DEFINE_CID(kLookAndFeelCID, NS_LOOKANDFEEL_CID); nsChromeRegistry* nsChromeRegistry::gChromeRegistry; -#define CHROME_URI "http://www.mozilla.org/rdf/chrome#" - -DEFINE_RDF_VOCAB(CHROME_URI, CHROME, packages); -DEFINE_RDF_VOCAB(CHROME_URI, CHROME, package); -DEFINE_RDF_VOCAB(CHROME_URI, CHROME, name); -DEFINE_RDF_VOCAB(CHROME_URI, CHROME, platformPackage); - //////////////////////////////////////////////////////////////////////////////// static void @@ -427,13 +430,19 @@ nsChromeRegistry::~nsChromeRegistry() gChromeRegistry = nsnull; } -NS_IMPL_THREADSAFE_ISUPPORTS6(nsChromeRegistry, - nsIChromeRegistry, - nsIXULChromeRegistry, - nsIToolkitChromeRegistry, - nsIXULOverlayProvider, - nsIObserver, - nsISupportsWeakReference) +NS_INTERFACE_MAP_BEGIN(nsChromeRegistry) + NS_INTERFACE_MAP_ENTRY(nsIChromeRegistry) + NS_INTERFACE_MAP_ENTRY(nsIXULChromeRegistry) + NS_INTERFACE_MAP_ENTRY(nsIToolkitChromeRegistry) +#ifdef MOZ_XUL + NS_INTERFACE_MAP_ENTRY(nsIXULOverlayProvider) +#endif + NS_INTERFACE_MAP_ENTRY(nsIObserver) + NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) +NS_INTERFACE_MAP_END + +NS_IMPL_ADDREF(nsChromeRegistry) +NS_IMPL_RELEASE(nsChromeRegistry) //////////////////////////////////////////////////////////////////////////////// // nsIChromeRegistry methods: @@ -778,6 +787,7 @@ nsChromeRegistry::GetLocalesForPackage(const nsACString& aPackage, return rv; } +#ifdef MOZ_XUL NS_IMETHODIMP nsChromeRegistry::GetStyleOverlays(nsIURI *aChromeURL, nsISimpleEnumerator **aResult) @@ -798,6 +808,7 @@ nsChromeRegistry::GetXULOverlays(nsIURI *aChromeURL, nsISimpleEnumerator **aResu return NS_NewArrayEnumerator(aResult, *parray); } +#endif // MOZ_XUL //////////////////////////////////////////////////////////////////////// @@ -1398,6 +1409,7 @@ NS_IMETHODIMP nsChromeRegistry::Observe(nsISupports *aSubject, const char *aTopi return rv; } +#ifdef MOZ_XUL static nsresult GetContainerEnumerator(nsIRDFDataSource* ds, nsIRDFResource* res, nsISimpleEnumerator* *aResult, PRInt32 *aCountResult = nsnull) @@ -1795,6 +1807,18 @@ nsChromeRegistry::ProcessOverlays(PRFileDesc *fd, nsIRDFDataSource* aDS, } } +#else // MOZ_XUL + +NS_IMETHODIMP +nsChromeRegistry::ProcessContentsManifest(nsIURI* aOldManifest, nsIURI* aFile, + nsIURI* aBaseURI, PRBool aAppend, + PRBool aSkinOnly) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +#endif // MOZ_XUL + nsresult nsChromeRegistry::ProcessManifest(nsILocalFile* aManifest, PRBool aSkinOnly) { diff --git a/mozilla/chrome/src/nsChromeRegistry.h b/mozilla/chrome/src/nsChromeRegistry.h index 07013b99702..dd9c6e84577 100644 --- a/mozilla/chrome/src/nsChromeRegistry.h +++ b/mozilla/chrome/src/nsChromeRegistry.h @@ -39,10 +39,13 @@ #include "nsIChromeRegistry.h" #include "nsIToolkitChromeRegistry.h" -#include "nsIXULOverlayProvider.h" #include "nsIObserver.h" #include "nsWeakReference.h" +#ifdef MOZ_XUL +#include "nsIXULOverlayProvider.h" +#endif + #include "pldhash.h" #include "nsCOMArray.h" @@ -61,6 +64,7 @@ class nsILocalFile; class nsIRDFDataSource; class nsIRDFResource; class nsIRDFService; +class nsISimpleEnumerator; class nsIURL; // for component registration @@ -69,7 +73,9 @@ class nsIURL; { 0x47049e42, 0x1d87, 0x482a, { 0x98, 0x4d, 0x56, 0xae, 0x18, 0x5e, 0x36, 0x7a } } class nsChromeRegistry : public nsIToolkitChromeRegistry, +#ifdef MOZ_XUL public nsIXULOverlayProvider, +#endif public nsIObserver, public nsSupportsWeakReference { @@ -80,7 +86,10 @@ public: NS_DECL_NSICHROMEREGISTRY NS_DECL_NSIXULCHROMEREGISTRY NS_DECL_NSITOOLKITCHROMEREGISTRY + +#ifdef MOZ_XUL NS_DECL_NSIXULOVERLAYPROVIDER +#endif NS_DECL_NSIOBSERVER @@ -109,12 +118,14 @@ private: static nsresult GetProviderAndPath(nsIURL* aChromeURL, nsACString& aProvider, nsACString& aPath); +#ifdef MOZ_XUL NS_HIDDEN_(void) ProcessProvider(PRFileDesc *fd, nsIRDFService* aRDFs, nsIRDFDataSource* ds, nsIRDFResource* aRoot, PRBool aIsLocale, const nsACString& aBaseURL); NS_HIDDEN_(void) ProcessOverlays(PRFileDesc *fd, nsIRDFDataSource* ds, nsIRDFResource* aRoot, const nsCSubstring& aType); +#endif NS_HIDDEN_(nsresult) ProcessManifest(nsILocalFile* aManifest, PRBool aSkinOnly); NS_HIDDEN_(nsresult) ProcessManifestBuffer(char *aBuffer, PRInt32 aLength, nsILocalFile* aManifest, PRBool aSkinOnly); diff --git a/mozilla/config/rules.mk b/mozilla/config/rules.mk index 38dab2101b6..12a98d062ed 100644 --- a/mozilla/config/rules.mk +++ b/mozilla/config/rules.mk @@ -696,9 +696,6 @@ ifdef HOST_LIBRARY endif endif # !NO_DIST_INSTALL +$(LOOP_OVER_DIRS) -ifndef MOZ_ENABLE_LIBXUL - +$(LOOP_OVER_TOOL_DIRS) -endif ############################################## install:: $(SUBMAKEFILES) $(MAKE_DIRS) diff --git a/mozilla/embedding/browser/gtk/Makefile.in b/mozilla/embedding/browser/gtk/Makefile.in index af6f8ab889d..60a08e22cb6 100644 --- a/mozilla/embedding/browser/gtk/Makefile.in +++ b/mozilla/embedding/browser/gtk/Makefile.in @@ -44,10 +44,10 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = gtkembedmoz -DIRS=src +TOOL_DIRS=src ifdef ENABLE_TESTS -DIRS += tests +TOOL_DIRS += tests endif PACKAGE_FILE = gtkembed.pkg diff --git a/mozilla/rdf/build/Makefile.in b/mozilla/rdf/build/Makefile.in index 29bac1a4dd2..26cbcfccb6e 100644 --- a/mozilla/rdf/build/Makefile.in +++ b/mozilla/rdf/build/Makefile.in @@ -43,7 +43,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = rdf -ifdef MOZ_XUL LIBRARY_NAME = rdf EXPORT_LIBRARY = 1 @@ -80,7 +79,6 @@ EXTRA_DSO_LDOPTS = \ $(MOZ_UNICHARUTIL_LIBS) \ $(MOZ_COMPONENT_LIBS) \ $(NULL) -endif EXPORTS = nsRDFCID.h diff --git a/mozilla/toolkit/components/Makefile.in b/mozilla/toolkit/components/Makefile.in index 54528b55711..ee70bb36df0 100644 --- a/mozilla/toolkit/components/Makefile.in +++ b/mozilla/toolkit/components/Makefile.in @@ -69,14 +69,19 @@ endif ifndef MOZ_THUNDERBIRD DIRS += \ - autocomplete \ cookie \ - help \ + typeaheadfind \ + $(NULL) + +ifdef MOZ_XUL +DIRS += \ + autocomplete \ history \ passwordmgr \ satchel \ - typeaheadfind \ + help \ $(NULL) +endif # MOZ_XUL endif # MOZ_THUNDERBIRD ifdef MOZ_XPINSTALL diff --git a/mozilla/toolkit/components/build/Makefile.in b/mozilla/toolkit/components/build/Makefile.in index 6aecb883c76..502d889ea30 100644 --- a/mozilla/toolkit/components/build/Makefile.in +++ b/mozilla/toolkit/components/build/Makefile.in @@ -73,8 +73,6 @@ REQUIRES = \ mimetype \ webbrowserpersist \ progressDlg \ - history \ - satchel \ necko \ windowwatcher \ uriloader \ @@ -96,9 +94,6 @@ CPPSRCS = nsToolkitCompsModule.cpp LOCAL_INCLUDES = \ -I$(srcdir)/../downloads/src \ - -I$(srcdir)/../history/src \ - -I$(srcdir)/../satchel/src \ - -I$(srcdir)/../passwordmgr/base \ -I$(srcdir)/../startup/src \ -I$(srcdir)/../typeaheadfind/src \ -I$(srcdir)/../alerts/src \ @@ -117,13 +112,7 @@ SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)alerts_s.$(LIB_SUFFIX) endif ifndef MOZ_THUNDERBIRD -ifndef MOZ_PLACES -SHARED_LIBRARY_LIBS += $(DIST)/lib/$(LIB_PREFIX)history_s.$(LIB_SUFFIX) -endif - SHARED_LIBRARY_LIBS += \ - $(DIST)/lib/$(LIB_PREFIX)satchel_s.$(LIB_SUFFIX) \ - $(DIST)/lib/$(LIB_PREFIX)passwordmgr_s.$(LIB_SUFFIX) \ $(DIST)/lib/$(LIB_PREFIX)fastfind_s.$(LIB_SUFFIX) \ $(NULL) diff --git a/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp b/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp index a4f6cab6034..fb6cc1e5e98 100644 --- a/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp +++ b/mozilla/toolkit/components/build/nsToolkitCompsModule.cpp @@ -45,16 +45,10 @@ #endif #ifndef MOZ_THUNDERBIRD -#include "nsDocShellCID.h" #ifdef MOZ_XPINSTALL #include "nsDownloadManager.h" #include "nsDownloadProxy.h" #endif -#include "nsFormHistory.h" -#include "nsFormFillController.h" -#include "nsGlobalHistory.h" -#include "nsPasswordManager.h" -#include "nsSingleSignonPrompt.h" #include "nsTypeAheadFind.h" #endif @@ -69,30 +63,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsAlertsService) #ifndef MOZ_THUNDERBIRD NS_GENERIC_FACTORY_CONSTRUCTOR(nsTypeAheadFind) -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFormHistory, nsFormHistory::GetInstance) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormFillController) -#ifndef MOZ_PLACES -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGlobalHistory, Init) -#endif -NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPasswordManager, nsPasswordManager::GetInstance) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsSingleSignonPrompt) #ifdef MOZ_XPINSTALL NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDownloadManager, Init) NS_GENERIC_FACTORY_CONSTRUCTOR(nsDownloadProxy) #endif #endif -///////////////////////////////////////////////////////////////////////////// -//// Module Destructor - -static void PR_CALLBACK nsToolkitCompModuleDtor(nsIModule* self) -{ -#ifndef MOZ_THUNDERBIRD - nsFormHistory::ReleaseInstance(); - nsPasswordManager::Shutdown(); -#endif -} - ///////////////////////////////////////////////////////////////////////////// static const nsModuleComponentInfo components[] = @@ -124,55 +100,10 @@ static const nsModuleComponentInfo components[] = nsDownloadProxyConstructor }, #endif - { "HTML Form History", - NS_FORMHISTORY_CID, - NS_FORMHISTORY_CONTRACTID, - nsFormHistoryConstructor }, - - { "HTML Form Fill Controller", - NS_FORMFILLCONTROLLER_CID, - "@mozilla.org/satchel/form-fill-controller;1", - nsFormFillControllerConstructor }, - - { "HTML Form History AutoComplete", - NS_FORMFILLCONTROLLER_CID, - NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID, - nsFormFillControllerConstructor }, - -#ifndef MOZ_PLACES - // "places" replaces global history - { "Global History", - NS_GLOBALHISTORY_CID, - NS_GLOBALHISTORY2_CONTRACTID, - nsGlobalHistoryConstructor }, - - { "Global History", - NS_GLOBALHISTORY_CID, - NS_GLOBALHISTORY_DATASOURCE_CONTRACTID, - nsGlobalHistoryConstructor }, - - { "Global History", - NS_GLOBALHISTORY_CID, - NS_GLOBALHISTORY_AUTOCOMPLETE_CONTRACTID, - nsGlobalHistoryConstructor }, -#endif - - { "Password Manager", - NS_PASSWORDMANAGER_CID, - NS_PASSWORDMANAGER_CONTRACTID, - nsPasswordManagerConstructor, - nsPasswordManager::Register, - nsPasswordManager::Unregister }, - - { "Single Signon Prompt", - NS_SINGLE_SIGNON_PROMPT_CID, - "@mozilla.org/wallet/single-sign-on-prompt;1", - nsSingleSignonPromptConstructor }, - { "TypeAheadFind Component", NS_TYPEAHEADFIND_CID, NS_TYPEAHEADFIND_CONTRACTID, nsTypeAheadFindConstructor }, #endif }; -NS_IMPL_NSGETMODULE_WITH_DTOR(nsToolkitCompsModule, components, nsToolkitCompModuleDtor) +NS_IMPL_NSGETMODULE(nsToolkitCompsModule, components) diff --git a/mozilla/toolkit/components/history/src/Makefile.in b/mozilla/toolkit/components/history/src/Makefile.in index 36be1739bf2..fcb6e0c5c62 100644 --- a/mozilla/toolkit/components/history/src/Makefile.in +++ b/mozilla/toolkit/components/history/src/Makefile.in @@ -44,9 +44,11 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = history -LIBRARY_NAME = history_s -FORCE_STATIC_LIB = 1 +LIBRARY_NAME = tkhstory +IS_COMPONENT = 1 +MODULE_NAME = nsToolkitHistory LIBXUL_LIBRARY = 1 +EXPORT_LIBRARY = 1 REQUIRES = xpcom \ string \ @@ -59,6 +61,7 @@ REQUIRES = xpcom \ unicharutil \ autocomplete \ uconv \ + toolkitcomps \ $(NULL) CPPSRCS = nsGlobalHistory.cpp \ @@ -66,3 +69,7 @@ CPPSRCS = nsGlobalHistory.cpp \ include $(topsrcdir)/config/rules.mk +EXTRA_DSO_LDOPTS += \ + $(MOZ_UNICHARUTIL_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) diff --git a/mozilla/toolkit/components/history/src/nsGlobalHistory.cpp b/mozilla/toolkit/components/history/src/nsGlobalHistory.cpp index 4026a80a512..bec271b0341 100644 --- a/mozilla/toolkit/components/history/src/nsGlobalHistory.cpp +++ b/mozilla/toolkit/components/history/src/nsGlobalHistory.cpp @@ -86,6 +86,10 @@ #include "nsIObserverService.h" #include "nsITextToSubURI.h" +#include "nsIGenericFactory.h" +#include "nsToolkitCompsCID.h" +#include "nsDocShellCID.h" + PRInt32 nsGlobalHistory::gRefCnt; nsIRDFService* nsGlobalHistory::gRDFService; nsIRDFResource* nsGlobalHistory::kNC_Page; @@ -4674,3 +4678,25 @@ nsGlobalHistory::AutoCompleteSortComparison(nsIMdbRow *row1, nsIMdbRow *row2, } return 0; } + +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGlobalHistory, Init) + +static const nsModuleComponentInfo components[] = +{ + { "Global History", + NS_GLOBALHISTORY_CID, + NS_GLOBALHISTORY2_CONTRACTID, + nsGlobalHistoryConstructor }, + + { "Global History", + NS_GLOBALHISTORY_CID, + NS_GLOBALHISTORY_DATASOURCE_CONTRACTID, + nsGlobalHistoryConstructor }, + + { "Global History", + NS_GLOBALHISTORY_CID, + NS_GLOBALHISTORY_AUTOCOMPLETE_CONTRACTID, + nsGlobalHistoryConstructor } +}; + +NS_IMPL_NSGETMODULE(nsToolkitHistory, components) diff --git a/mozilla/toolkit/components/satchel/src/Makefile.in b/mozilla/toolkit/components/satchel/src/Makefile.in index d1e983d562d..2bb836096cc 100644 --- a/mozilla/toolkit/components/satchel/src/Makefile.in +++ b/mozilla/toolkit/components/satchel/src/Makefile.in @@ -44,9 +44,11 @@ VPATH=@srcdir@ include $(DEPTH)/config/autoconf.mk MODULE = satchel -LIBRARY_NAME = satchel_s -FORCE_STATIC_LIB = 1 +LIBRARY_NAME = satchel +MODULE_NAME = satchel +IS_COMPONENT = 1 LIBXUL_LIBRARY = 1 +EXPORT_LIBRARY = 1 REQUIRES = \ xpcom \ @@ -66,6 +68,8 @@ REQUIRES = \ unicharutil \ intl \ pref \ + windowwatcher \ + toolkitcomps \ $(NULL) CPPSRCS = nsFormFillController.cpp \ @@ -74,4 +78,13 @@ CPPSRCS = nsFormFillController.cpp \ LOCAL_INCLUDES = -I$(srcdir)/../../passwordmgr/base +SHARED_LIBRARY_LIBS = \ + $(DIST)/lib/$(LIB_PREFIX)passwordmgr_s.$(LIB_SUFFIX) \ + $(NULL) + include $(topsrcdir)/config/rules.mk + +EXTRA_DSO_LDOPTS += \ + $(MOZ_UNICHARUTIL_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) diff --git a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp index 0d115f0e1e1..d882225fcfb 100644 --- a/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp +++ b/mozilla/toolkit/components/satchel/src/nsFormFillController.cpp @@ -69,7 +69,10 @@ #include "nsIDOMDocumentEvent.h" #include "nsIDOMHTMLFormElement.h" #include "nsPasswordManager.h" +#include "nsSingleSignonPrompt.h" #include "nsIDOMMouseEvent.h" +#include "nsIGenericFactory.h" +#include "nsToolkitCompsCID.h" NS_INTERFACE_MAP_BEGIN(nsFormFillController) NS_INTERFACE_MAP_ENTRY(nsIFormFillController) @@ -1102,3 +1105,47 @@ nsFormFillController::GetIndexOfDocShell(nsIDocShell *aDocShell) return -1; } + +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsFormHistory, nsFormHistory::GetInstance) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsFormFillController) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPasswordManager, nsPasswordManager::GetInstance) +NS_GENERIC_FACTORY_CONSTRUCTOR(nsSingleSignonPrompt) + +static void PR_CALLBACK nsFormHistoryModuleDtor(nsIModule* self) +{ + nsPasswordManager::Shutdown(); + nsFormHistory::ReleaseInstance(); +} + +static const nsModuleComponentInfo components[] = +{ + { "Password Manager", + NS_PASSWORDMANAGER_CID, + NS_PASSWORDMANAGER_CONTRACTID, + nsPasswordManagerConstructor, + nsPasswordManager::Register, + nsPasswordManager::Unregister }, + + { "Single Signon Prompt", + NS_SINGLE_SIGNON_PROMPT_CID, + "@mozilla.org/wallet/single-sign-on-prompt;1", + nsSingleSignonPromptConstructor }, + + { "HTML Form History", + NS_FORMHISTORY_CID, + NS_FORMHISTORY_CONTRACTID, + nsFormHistoryConstructor }, + + { "HTML Form Fill Controller", + NS_FORMFILLCONTROLLER_CID, + "@mozilla.org/satchel/form-fill-controller;1", + nsFormFillControllerConstructor }, + + { "HTML Form History AutoComplete", + NS_FORMFILLCONTROLLER_CID, + NS_FORMHISTORYAUTOCOMPLETE_CONTRACTID, + nsFormFillControllerConstructor } +}; + +NS_IMPL_NSGETMODULE_WITH_DTOR(satchel, components, nsFormHistoryModuleDtor) + diff --git a/mozilla/toolkit/library/libxul-config.mk b/mozilla/toolkit/library/libxul-config.mk index 50aab3ac173..6dfd0f8d66e 100644 --- a/mozilla/toolkit/library/libxul-config.mk +++ b/mozilla/toolkit/library/libxul-config.mk @@ -103,16 +103,23 @@ COMPONENT_LIBS += \ mozfind \ appcomps \ commandlines \ - tkautocomplete \ toolkitcomps \ xpinstall \ jsd \ - pippki \ pipboot \ pipnss \ autoconfig \ $(NULL) +ifdef MOZ_XUL +COMPONENT_LIBS += \ + tkautocomplete \ + tkhstory \ + satchel \ + pippki \ + $(NULL) +endif + ifeq ($(OS_ARCH),WINNT) COMPONENT_LIBS += intlcmpt endif diff --git a/mozilla/toolkit/library/nsStaticXULComponents.cpp b/mozilla/toolkit/library/nsStaticXULComponents.cpp index 197e9d14930..5a698419fac 100644 --- a/mozilla/toolkit/library/nsStaticXULComponents.cpp +++ b/mozilla/toolkit/library/nsStaticXULComponents.cpp @@ -151,6 +151,16 @@ #define SYSTEMPREF_MODULES #endif +#ifdef MOZ_XUL +#define XULENABLED_MODULES \ + MODULE(tkAutoCompleteModule) \ + MODULE(nsToolkitHistory) \ + MODULE(satchel) \ + MODULE(PKI) +#else +#define XULENABLED_MODULES +#endif + #define XUL_MODULES \ MODULE(xpcomObsoleteModule) \ MODULE(xpconnect) \ @@ -191,12 +201,11 @@ MODULE(application) \ MODULE(Apprunner) \ MODULE(CommandLineModule) \ - MODULE(tkAutoCompleteModule) \ + XULENABLED_MODULES \ MODULE(nsToolkitCompsModule) \ XREMOTE_MODULES \ MODULE(nsSoftwareUpdate) \ MODULE(JavaScript_Debugger) \ - MODULE(PKI) \ MODULE(BOOT) \ MODULE(NSS) \ MODULE(nsAutoConfigModule) \