aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyBrowser.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-11-18 03:39:38 +0800
committerChristian Persch <chpe@src.gnome.org>2004-11-18 03:39:38 +0800
commit0b0f98a2a486cfa4257b017446bbe93f7e352d1e (patch)
tree63a8ded1cb955b4280041fed263acf29d5f55d4f /embed/mozilla/EphyBrowser.cpp
parent24619e355a9632293107bda10768b4b5bbc07e49 (diff)
downloadgsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar.gz
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar.bz2
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar.lz
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar.xz
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.tar.zst
gsoc2013-epiphany-0b0f98a2a486cfa4257b017446bbe93f7e352d1e.zip
Fix wrong certificate shown; Epiphany equivalent of galeon bug #158453.
2004-11-17 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Fix wrong certificate shown; Epiphany equivalent of galeon bug #158453.
Diffstat (limited to 'embed/mozilla/EphyBrowser.cpp')
-rw-r--r--embed/mozilla/EphyBrowser.cpp49
1 files changed, 20 insertions, 29 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp
index de5def194..bcda45c9e 100644
--- a/embed/mozilla/EphyBrowser.cpp
+++ b/embed/mozilla/EphyBrowser.cpp
@@ -362,6 +362,16 @@ nsresult EphyBrowser::Init (GtkMozEmbed *mozembed)
rv = GetListener();
NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+#ifdef HAVE_MOZILLA_PSM
+ /* FIXME: mozilla sucks! nsWebBrowser already has an instance of this,
+ * 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);
+#endif
+
mInitialized = PR_TRUE;
return AttachListeners();
@@ -1049,40 +1059,21 @@ nsresult EphyBrowser::GetHasModifiedForms (PRBool *modified)
}
nsresult
-EphyBrowser::SetSecurityInfo (nsIRequest *aRequest)
+EphyBrowser::GetSecurityInfo (PRUint32 *aState, nsACString &aDescription)
{
#ifdef HAVE_MOZILLA_PSM
- /* clear previous security info */
- mSecurityInfo = nsnull;
-
- nsCOMPtr<nsIChannel> channel (do_QueryInterface (aRequest));
- NS_ENSURE_TRUE (channel, NS_ERROR_FAILURE);
-
- channel->GetSecurityInfo (getter_AddRefs (mSecurityInfo));
-
- return NS_OK;
-#else
- return NS_ERROR_NOT_IMPLEMENTED;
-#endif
-}
-
-nsresult
-EphyBrowser::GetSecurityDescription (nsACString &aDescription)
-{
-#ifdef HAVE_MOZILLA_PSM
- if (!mSecurityInfo) return NS_ERROR_FAILURE;
-
- nsCOMPtr<nsITransportSecurityInfo> tsInfo (do_QueryInterface (mSecurityInfo));
- NS_ENSURE_TRUE (tsInfo, NS_ERROR_FAILURE);
+ NS_ENSURE_TRUE (mSecurityInfo, NS_ERROR_FAILURE);
nsresult rv;
- PRUnichar *tooltip = nsnull;
- rv = tsInfo->GetShortSecurityDescription (&tooltip);
- NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && tooltip, NS_ERROR_FAILURE);
+ rv = mSecurityInfo->GetState (aState);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
+
+ nsEmbedString tooltip;
+ rv = mSecurityInfo->GetTooltipText (tooltip);
+ NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE);
- NS_UTF16ToCString (nsEmbedString (tooltip),
+ NS_UTF16ToCString (tooltip,
NS_CSTRING_ENCODING_UTF8, aDescription);
- if (tooltip) nsMemory::Free (tooltip);
return NS_OK;
#else
@@ -1094,7 +1085,7 @@ nsresult
EphyBrowser::ShowCertificate ()
{
#ifdef HAVE_MOZILLA_PSM
- if (!mSecurityInfo) return NS_ERROR_FAILURE;
+ NS_ENSURE_TRUE (mSecurityInfo, NS_ERROR_FAILURE);
nsCOMPtr<nsISSLStatusProvider> statusProvider (do_QueryInterface (mSecurityInfo));
NS_ENSURE_TRUE (statusProvider, NS_ERROR_FAILURE);