aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
Diffstat (limited to 'embed')
-rw-r--r--embed/mozilla/EphyBrowser.cpp3
-rw-r--r--embed/mozilla/MozRegisterComponents.cpp41
2 files changed, 39 insertions, 5 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 4baee2fb2..c04183247 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -26,6 +26,7 @@
#include "GlobalHistory.h"
#include "ephy-embed.h"
#include "ephy-string.h"
+#include "ephy-debug.h"
#include <gtkmozembed_internal.h>
#include <unistd.h>
@@ -85,11 +86,13 @@
EphyEventListener::EphyEventListener(void)
{
+ LOG ("EphyEventListener ctor (%p)", this)
mOwner = nsnull;
}
EphyEventListener::~EphyEventListener()
{
+ LOG ("EphyEventListener dtor (%p)", this)
}
NS_IMPL_ISUPPORTS1(EphyEventListener, nsIDOMEventListener)
diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp
index 595bc71c1..d85af15ba 100644
--- a/embed/mozilla/MozRegisterComponents.cpp
+++ b/embed/mozilla/MozRegisterComponents.cpp
@@ -43,6 +43,7 @@
#endif
#include <nsIGenericFactory.h>
#include <nsIComponentRegistrar.h>
+#include <nsICategoryManager.h>
#include <nsCOMPtr.h>
#include <nsILocalFile.h>
#include <nsNetCID.h>
@@ -69,6 +70,22 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSClientAuthDialogs)
NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSDialogs)
NS_GENERIC_FACTORY_CONSTRUCTOR(GtkNSSKeyPairDialogs)
#endif
+
+static NS_METHOD
+RegisterContentPolicy(nsIComponentManager *aCompMgr, nsIFile *aPath,
+ const char *registryLocation, const char *componentType,
+ const nsModuleComponentInfo *info)
+{
+ nsCOMPtr<nsICategoryManager> cm =
+ do_GetService(NS_CATEGORYMANAGER_CONTRACTID);
+ NS_ENSURE_TRUE (cm, NS_ERROR_FAILURE);
+
+ nsXPIDLCString oldval;
+ return cm->AddCategoryEntry("content-policy",
+ EPHY_CONTENT_POLICY_CONTRACTID,
+ EPHY_CONTENT_POLICY_CONTRACTID,
+ PR_TRUE, PR_TRUE, getter_Copies (oldval));
+}
static const nsModuleComponentInfo sAppComps[] = {
{
@@ -195,12 +212,11 @@ static const nsModuleComponentInfo sAppComps[] = {
EPHY_CONTENT_POLICY_CLASSNAME,
EPHY_CONTENT_POLICY_CID,
EPHY_CONTENT_POLICY_CONTRACTID,
- EphyContentPolicyConstructor
- }
+ EphyContentPolicyConstructor,
+ RegisterContentPolicy
+ },
};
-static const int sNumAppComps = sizeof(sAppComps) / sizeof(nsModuleComponentInfo);
-
static const nsModuleComponentInfo sFtpComps = {
G_FTP_PROTOCOL_CLASSNAME,
G_FTP_PROTOCOL_CID,
@@ -224,7 +240,11 @@ mozilla_register_components (void)
NS_GetComponentRegistrar(getter_AddRefs(cr));
NS_ENSURE_TRUE (cr, FALSE);
- for (int i = 0; i < sNumAppComps; i++)
+ nsCOMPtr<nsIComponentManager> cm;
+ NS_GetComponentManager (getter_AddRefs (cm));
+ NS_ENSURE_TRUE (cm, FALSE);
+
+ for (int i = 0; i < G_N_ELEMENTS (sAppComps); i++)
{
nsCOMPtr<nsIGenericFactory> componentFactory;
rv = NS_NewGenericFactory(getter_AddRefs(componentFactory),
@@ -247,6 +267,17 @@ mozilla_register_components (void)
ret = FALSE;
}
+
+ if (sAppComps[i].mRegisterSelfProc)
+ {
+ rv = sAppComps[i].mRegisterSelfProc (cm, nsnull, nsnull, nsnull, &sAppComps[i]);
+
+ if (NS_FAILED (rv))
+ {
+ g_warning ("Failed to register-self for %s\n", sAppComps[i].mDescription);
+ ret = FALSE;
+ }
+ }
}
return ret;