aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozRegisterComponents.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-11-24 22:56:17 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-11-24 22:56:17 +0800
commit68870c943201f590683544421c28965e69a27272 (patch)
treeaa9676868dbffff51bce2b9d343cadf32ee99e53 /embed/mozilla/MozRegisterComponents.cpp
parent81beafafc8dbf0e5babdf6a204fea8314f8db0e3 (diff)
downloadgsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar.gz
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar.bz2
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar.lz
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar.xz
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.tar.zst
gsoc2013-epiphany-68870c943201f590683544421c28965e69a27272.zip
No need to handle mailto registration separately.
2003-11-24 Marco Pesenti Gritti <marco@gnome.org> * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/mozilla-embed-single.cpp: No need to handle mailto registration separately.
Diffstat (limited to 'embed/mozilla/MozRegisterComponents.cpp')
-rw-r--r--embed/mozilla/MozRegisterComponents.cpp64
1 files changed, 8 insertions, 56 deletions
diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp
index 1b81702a6..1ddc46978 100644
--- a/embed/mozilla/MozRegisterComponents.cpp
+++ b/embed/mozilla/MozRegisterComponents.cpp
@@ -52,6 +52,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(GPrintingPromptService)
NS_GENERIC_FACTORY_CONSTRUCTOR(GIRCProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(GFtpProtocolHandler)
NS_GENERIC_FACTORY_CONSTRUCTOR(GNewsProtocolHandler)
+NS_GENERIC_FACTORY_CONSTRUCTOR(GMailtoProtocolHandler)
#if MOZILLA_SNAPSHOT < 12
NS_GENERIC_FACTORY_CONSTRUCTOR(GExternalProtocolService)
@@ -181,21 +182,7 @@ static const nsModuleComponentInfo sAppComps[] = {
EPHY_ABOUT_REDIRECTOR_CID,
EPHY_ABOUT_REDIRECTOR_MARCO_CONTRACTID,
EphyAboutRedirectorConstructor
- }
-};
-
-static const int sNumAppComps = sizeof(sAppComps) / sizeof(nsModuleComponentInfo);
-
-static const nsModuleComponentInfo sFtpComps = {
- G_FTP_PROTOCOL_CLASSNAME,
- G_FTP_PROTOCOL_CID,
- G_FTP_PROTOCOL_CONTRACTID,
- GFtpProtocolHandlerConstructor
-};
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(GMailtoProtocolHandler)
-
-static const nsModuleComponentInfo sMailtoComps[] = {
+ },
{
G_MAILTO_PROTOCOL_CLASSNAME,
G_MAILTO_PROTOCOL_CID,
@@ -210,14 +197,13 @@ static const nsModuleComponentInfo sMailtoComps[] = {
}
};
-static const int sNumMailtoComps = sizeof(sMailtoComps) / sizeof(nsModuleComponentInfo);
+static const int sNumAppComps = sizeof(sAppComps) / sizeof(nsModuleComponentInfo);
-static const nsModuleComponentInfo sModuleComps[] = {
- {
- G_EXTERNALPROTOCOLSERVICE_CLASSNAME,
- G_EXTERNALPROTOCOLSERVICE_CID,
- NS_EXTERNALPROTOCOLSERVICE_CONTRACTID
- }
+static const nsModuleComponentInfo sFtpComps = {
+ G_FTP_PROTOCOL_CLASSNAME,
+ G_FTP_PROTOCOL_CID,
+ G_FTP_PROTOCOL_CONTRACTID,
+ GFtpProtocolHandlerConstructor
};
static NS_DEFINE_CID(knsFtpProtocolHandlerCID, NS_FTPPROTOCOLHANDLER_CID);
@@ -318,37 +304,3 @@ mozilla_unregister_FtpProtocolHandler (void)
ftpRegistered = PR_FALSE;
return NS_SUCCEEDED (rv) ? TRUE : FALSE;
}
-
-/**
- * mozilla_register_MailtoProtocolHandler: Register Mailto Protocol Handler
- */
-gboolean
-mozilla_register_MailtoProtocolHandler (void)
-{
- gboolean retVal = TRUE;
- nsresult rv;
-
- nsCOMPtr<nsIComponentRegistrar> cr;
- rv = NS_GetComponentRegistrar(getter_AddRefs(cr));
- if (NS_FAILED(rv) || !cr) return FALSE;
-
- for (int i = 0; i < sNumMailtoComps; i++)
- {
- nsCOMPtr<nsIGenericFactory> componentFactory;
- rv = NS_NewGenericFactory(getter_AddRefs(componentFactory),
- &(sMailtoComps[i]));
- if (NS_FAILED(rv))
- {
- retVal = FALSE;
- continue; // don't abort registering other components
- }
-
- rv = cr->RegisterFactory(sMailtoComps[i].mCID,
- sMailtoComps[i].mDescription,
- sMailtoComps[i].mContractID,
- componentFactory);
- if (NS_FAILED(rv))
- retVal = FALSE;
- }
- return retVal;
-}