diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-10-15 18:02:04 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-10-15 18:02:04 +0800 |
commit | 6c9506d12f519b416ab8d7b04b7f16799abe595c (patch) | |
tree | 5ef65a22eeb904d214feb7e8b21b40601ce05740 /embed/mozilla/MozDownload.cpp | |
parent | 0beb9543055b4149b0fee9bf2418ef2048eae4f9 (diff) | |
download | gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar.gz gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar.bz2 gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar.lz gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar.xz gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.tar.zst gsoc2013-epiphany-6c9506d12f519b416ab8d7b04b7f16799abe595c.zip |
Add EPHY_EMBED_PERSIST_NO_CERTDIALOGS flag.
2005-10-15 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-embed-persist.h:
Add EPHY_EMBED_PERSIST_NO_CERTDIALOGS flag.
* embed/mozilla/Makefile.am:
A embed/mozilla/EphyBadCertRejector.cpp:
A embed/mozilla/EphyBadCertRejector.h:
A class implementing nsIBadCertListener which always rejects.
* embed/mozilla/EphyHeaderSniffer.cpp:
* embed/mozilla/EphyHeaderSniffer.h:
* embed/mozilla/MozDownload.cpp:
* embed/mozilla/MozDownload.h:
For gecko 1.8, implement nsIInterfaceRequestor for EphyHeaderSniffer
and MozDownload, and make GetInterface hand out a EphyBadCertRejector
if the EPHY_EMBED_PERSIST_NO_CERTDIALOGS flag is set.
Diffstat (limited to 'embed/mozilla/MozDownload.cpp')
-rw-r--r-- | embed/mozilla/MozDownload.cpp | 45 |
1 files changed, 43 insertions, 2 deletions
diff --git a/embed/mozilla/MozDownload.cpp b/embed/mozilla/MozDownload.cpp index 787cc7c5c..3219dc9c5 100644 --- a/embed/mozilla/MozDownload.cpp +++ b/embed/mozilla/MozDownload.cpp @@ -72,6 +72,10 @@ #include <stdlib.h> +#ifdef HAVE_GECKO_1_8 +#include "EphyBadCertRejector.h" +#endif + const char* const persistContractID = "@mozilla.org/embedding/browser/nsWebBrowserPersist;1"; MozDownload::MozDownload() : @@ -93,9 +97,16 @@ MozDownload::~MozDownload() } #ifdef HAVE_GECKO_1_8 -NS_IMPL_ISUPPORTS3(MozDownload, nsIWebProgressListener, nsIWebProgressListener2, nsITransfer) +NS_IMPL_ISUPPORTS4 (MozDownload, + nsIWebProgressListener, + nsIWebProgressListener2, + nsITransfer, + nsIInterfaceRequestor) #else -NS_IMPL_ISUPPORTS3(MozDownload, nsIWebProgressListener, nsIDownload, nsITransfer) +NS_IMPL_ISUPPORTS3 (MozDownload, + nsIWebProgressListener, + nsIDownload, + nsITransfer) #endif #ifdef HAVE_GECKO_1_8 @@ -583,6 +594,36 @@ MozDownload::OnSecurityChange (nsIWebProgress *aWebProgress, nsIRequest *aReques return NS_OK; } +#ifdef HAVE_GECKO_1_8 + +/* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */ +NS_IMETHODIMP +MozDownload::GetInterface(const nsIID & uuid, void * *result) +{ + if (uuid.Equals (NS_GET_IID (nsIBadCertListener)) && + mEmbedPersist) + { + EphyEmbedPersistFlags flags; + + g_object_get (mEmbedPersist, "flags", &flags, NULL); + + if (flags & EPHY_EMBED_PERSIST_NO_CERTDIALOGS) + { + nsIBadCertListener *badCertRejector = new EphyBadCertRejector (); + if (!badCertRejector) return NS_ERROR_OUT_OF_MEMORY; + + *result = badCertRejector; + NS_ADDREF (badCertRejector); + + return NS_OK; + } + } + + return NS_ERROR_NO_INTERFACE; +} + +#endif /* HAVE_GECKO_1_8 */ + void MozDownload::Cancel() { |