aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyBrowser.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/EphyBrowser.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/EphyBrowser.cpp')
-rw-r--r--embed/mozilla/EphyBrowser.cpp46
1 files changed, 41 insertions, 5 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index 03076ef21..86d6b6073 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -188,15 +188,18 @@ EphyFaviconEventListener::HandleEvent(nsIDOMEvent* aDOMEvent)
/* disallow subframes to set favicon */
if (domWinAsISupports != topDomWinAsISupports) return NS_OK;
- nsCOMPtr<nsIDOM3Document> doc = do_QueryInterface (domDoc);
+ nsCOMPtr<nsIDOM3Document> doc (do_QueryInterface (domDoc));
NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE);
nsEmbedString spec;
rv = doc->GetDocumentURI (spec);
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+ nsEmbedCString encoding;
+ mOwner->GetEncoding (encoding);
+
nsCOMPtr<nsIURI> docUri;
- EphyUtils::NewURI (getter_AddRefs(docUri), spec);
+ EphyUtils::NewURI (getter_AddRefs(docUri), spec, encoding.get());
NS_ENSURE_TRUE (docUri, NS_ERROR_FAILURE);
nsEmbedCString faviconUrl;
@@ -497,9 +500,42 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed)
* but we cannot get to it!
* See https://bugzilla.mozilla.org/show_bug.cgi?id=94974
*/
- mSecurityInfo = do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv);
- NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && mSecurityInfo, NS_ERROR_FAILURE);
- mSecurityInfo->Init (mDOMWindow);
+ /* First try GI */
+ mSecurityInfo = do_GetInterface (mWebBrowser);
+ /* Try to instantiate it under the re-registered contract ID */
+ if (!mSecurityInfo)
+ {
+ /* This will cause all security warning dialogs to be shown
+ * twice (once by this instance, and another time by nsWebBrowser's
+ * instance of nsSecurityBrowserUIImpl), but there appears to be
+ * no other way :-(
+ */
+ mSecurityInfo = do_CreateInstance("@gnome.org/project/epiphany/hacks/secure-browser-ui;1", &rv);
+ if (NS_SUCCEEDED (rv) && mSecurityInfo)
+ {
+ rv = mSecurityInfo->Init (mDOMWindow);
+ NS_ENSURE_SUCCESS (rv, rv);
+ }
+ }
+ /* Try the original contract ID */
+ if (!mSecurityInfo)
+ {
+ /* This will cause all security warning dialogs to be shown
+ * twice (once by this instance, and another time by nsWebBrowser's
+ * instance of nsSecurityBrowserUIImpl), but there appears to be
+ * no other way :-(
+ */
+ mSecurityInfo = do_CreateInstance(NS_SECURE_BROWSER_UI_CONTRACTID, &rv);
+ if (NS_SUCCEEDED (rv) && mSecurityInfo)
+ {
+ rv = mSecurityInfo->Init (mDOMWindow);
+ NS_ENSURE_SUCCESS (rv, rv);
+ }
+ }
+ if (!mSecurityInfo)
+ {
+ g_warning ("Failed to instantiate nsISecureBrowserUI!\n");
+ }
#endif
mInitialized = PR_TRUE;