aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozRegisterComponents.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2005-01-24 21:43:58 +0800
committerChristian Persch <chpe@src.gnome.org>2005-01-24 21:43:58 +0800
commit9242cd362e394f3923d1b9bef45ab1bd86095c9d (patch)
tree8ee0044d9e634f3133791a499ac46d3facc38a4a /embed/mozilla/MozRegisterComponents.cpp
parent9c4ac97f11db1000557af51a4be1a875561c3fe2 (diff)
downloadgsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar.gz
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar.bz2
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar.lz
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar.xz
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.tar.zst
gsoc2013-epiphany-9242cd362e394f3923d1b9bef45ab1bd86095c9d.zip
Work around a mozilla bug by diverting the contract ID of
2005-01-24 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/MozRegisterComponents.cpp: Work around a mozilla bug by diverting the contract ID of
Diffstat (limited to 'embed/mozilla/MozRegisterComponents.cpp')
-rw-r--r--embed/mozilla/MozRegisterComponents.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/embed/mozilla/MozRegisterComponents.cpp b/embed/mozilla/MozRegisterComponents.cpp
index 8dd86b6ee..9dba24c9b 100644
--- a/embed/mozilla/MozRegisterComponents.cpp
+++ b/embed/mozilla/MozRegisterComponents.cpp
@@ -39,6 +39,7 @@
#include "GtkNSSDialogs.h"
#include "GtkNSSKeyPairDialogs.h"
#include "GtkNSSSecurityWarningDialogs.h"
+#include <nsISecureBrowserUI.h>
#endif
#include <nsMemory.h>
@@ -185,6 +186,42 @@ static const nsModuleComponentInfo sAppComps[] = {
},
};
+#ifdef HAVE_MOZILLA_PSM
+/* 5999dfd3-571f-4fcf-964b-386879f5cded */
+#define NEW_CID { 0x5999dfd3, 0x571f, 0x4fcf, { 0x96, 0x4b, 0x38, 0x68, 0x79, 0xf5, 0xcd, 0xed } }
+
+static nsresult
+reregister_secure_browser_ui (nsIComponentManager *cm,
+ nsIComponentRegistrar *cr)
+{
+ NS_ENSURE_ARG (cm);
+ NS_ENSURE_ARG (cr);
+
+ /* Workaround as a result of:
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=94974
+ * see
+ * http://bugzilla.gnome.org/show_bug.cgi?id=164670
+ */
+
+ nsresult rv;
+ nsCOMPtr<nsIFactory> factory;
+ rv = cm->GetClassObjectByContractID (NS_SECURE_BROWSER_UI_CONTRACTID, NS_GET_IID(nsIFactory), getter_AddRefs (factory));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ nsCID *cidPtr = nsnull;
+ rv = cr->ContractIDToCID(NS_SECURE_BROWSER_UI_CONTRACTID, &cidPtr);
+ NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && cidPtr, rv);
+
+ rv = cr->UnregisterFactory (*cidPtr, factory);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ const nsCID new_cid = NEW_CID;
+ rv = cr->RegisterFactory (new_cid, "Epiphany Secure Browser Class", "@gnome.org/project/epiphany/hacks/secure-browser-ui;1", factory);
+ nsMemory::Free (cidPtr);
+
+ return rv;
+}
+#endif /* HAVE_MOZILLA_PSM */
gboolean
mozilla_register_components (void)
@@ -236,5 +273,14 @@ mozilla_register_components (void)
}
}
+#ifdef HAVE_MOZILLA_PSM
+ /* Workaround for http://bugzilla.gnome.org/show_bug.cgi?id=164670 */
+ rv = reregister_secure_browser_ui (cm, cr);
+ if (NS_FAILED (rv))
+ {
+ g_warning ("Failed to divert the nsISecureBrowserUI implementation!\n");
+ }
+#endif /* HAVE_MOZILLA_PSM */
+
return ret;
}