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/EphyHeaderSniffer.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/EphyHeaderSniffer.cpp')
-rw-r--r-- | embed/mozilla/EphyHeaderSniffer.cpp | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/embed/mozilla/EphyHeaderSniffer.cpp b/embed/mozilla/EphyHeaderSniffer.cpp index 8eaac238b..de18a5ff4 100644 --- a/embed/mozilla/EphyHeaderSniffer.cpp +++ b/embed/mozilla/EphyHeaderSniffer.cpp @@ -66,6 +66,10 @@ #include <nsIMIMEHeaderParam.h> #include <nsIWindowWatcher.h> +#ifdef HAVE_GECKO_1_8 +#include "EphyBadCertRejector.h" +#endif + EphyHeaderSniffer::EphyHeaderSniffer (nsIWebBrowserPersist* aPersist, MozillaEmbedPersist *aEmbedPersist, nsIFile* aFile, nsIURI* aURL, nsIDOMDocument* aDocument, nsIInputStream* aPostData, EphyEmbedSingle *single) @@ -101,7 +105,16 @@ EphyHeaderSniffer::~EphyHeaderSniffer() } } -NS_IMPL_ISUPPORTS2(EphyHeaderSniffer, nsIWebProgressListener, nsIAuthPrompt) +#ifdef HAVE_GECKO_1_8 +NS_IMPL_ISUPPORTS3 (EphyHeaderSniffer, + nsIWebProgressListener, + nsIInterfaceRequestor, + nsIAuthPrompt) +#else +NS_IMPL_ISUPPORTS2 (EphyHeaderSniffer, + nsIWebProgressListener, + nsIAuthPrompt) +#endif NS_IMETHODIMP EphyHeaderSniffer::HandleContent () @@ -202,6 +215,36 @@ EphyHeaderSniffer::OnSecurityChange (nsIWebProgress *aWebProgress, nsIRequest *a return NS_OK; } +#ifdef HAVE_GECKO_1_8 + +/* void getInterface (in nsIIDRef uuid, [iid_is (uuid), retval] out nsQIResult result); */ +NS_IMETHODIMP +EphyHeaderSniffer::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) + { + EphyBadCertRejector *badCertRejector = new EphyBadCertRejector (); + if (!badCertRejector) return NS_ERROR_OUT_OF_MEMORY; + + *result = NS_STATIC_CAST(nsIBadCertListener*, badCertRejector); + NS_ADDREF (badCertRejector); + + return NS_OK; + } + } + + return NS_ERROR_NO_INTERFACE; +} + +#endif /* HAVE_GECKO_1_8 */ + static void filechooser_response_cb (GtkWidget *dialog, gint response, |