From e75afc16ed5bb461f2e1a49e052f23e70e47db82 Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Tue, 30 Dec 2003 18:10:21 +0000 Subject: Add API to EphyEmbedSingle to clear the HTTP authentication cache. 2003-12-30 Christian Persch * embed/ephy-embed-single.c: (ephy_embed_single_clear_auth_cache): * embed/ephy-embed-single.h: * embed/mozilla/mozilla-embed-single.cpp: Add API to EphyEmbedSingle to clear the HTTP authentication cache. --- embed/ephy-embed-single.c | 13 +++++++++++++ embed/ephy-embed-single.h | 3 +++ embed/mozilla/mozilla-embed-single.cpp | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'embed') diff --git a/embed/ephy-embed-single.c b/embed/ephy-embed-single.c index 5c3466a21..c9da4cd32 100644 --- a/embed/ephy-embed-single.c +++ b/embed/ephy-embed-single.c @@ -96,6 +96,19 @@ ephy_embed_single_clear_cache (EphyEmbedSingle *single) klass->clear_cache (single); } +/** + * ephy_embed_single_clear_auth_cache: + * @single: the #EphyEmbedSingle + * + * Clears the mozilla http authentication cache. + **/ +void +ephy_embed_single_clear_auth_cache (EphyEmbedSingle *single) +{ + EphyEmbedSingleClass *klass = EPHY_EMBED_SINGLE_GET_CLASS (single); + klass->clear_auth_cache (single); +} + /** * ephy_embed_single_set_offline_mode: * @single: the #EphyEmbedSingle diff --git a/embed/ephy-embed-single.h b/embed/ephy-embed-single.h index dac415cc1..89c80f3bb 100644 --- a/embed/ephy-embed-single.h +++ b/embed/ephy-embed-single.h @@ -49,6 +49,7 @@ struct EphyEmbedSingleClass /* Methods */ void (* clear_cache) (EphyEmbedSingle *shell); + void (* clear_auth_cache) (EphyEmbedSingle *shell); void (* set_offline_mode) (EphyEmbedSingle *shell, gboolean offline); void (* load_proxy_autoconf) (EphyEmbedSingle *shell, @@ -61,6 +62,8 @@ GType ephy_embed_single_get_type (void); void ephy_embed_single_clear_cache (EphyEmbedSingle *shell); +void ephy_embed_single_clear_auth_cache (EphyEmbedSingle *shell); + void ephy_embed_single_set_offline_mode (EphyEmbedSingle *shell, gboolean offline); diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index f60c60bee..84ace349d 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -75,6 +75,7 @@ #include #include #include +#include // FIXME: For setting the locale. hopefully gtkmozembed will do itself soon #include @@ -538,7 +539,6 @@ static void impl_clear_cache (EphyEmbedSingle *shell) { nsresult rv; - nsCOMPtr CacheService = do_GetService (NS_CACHESERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED (rv)) @@ -547,6 +547,18 @@ impl_clear_cache (EphyEmbedSingle *shell) } } +static void +impl_clear_auth_cache (EphyEmbedSingle *shell) +{ + nsresult rv; + nsCOMPtr AuthManager = + do_GetService (NS_HTTPAUTHMANAGER_CONTRACTID, &rv); + if (NS_SUCCEEDED (rv)) + { + AuthManager->ClearAll(); + } +} + static void impl_set_offline_mode (EphyEmbedSingle *shell, gboolean offline) @@ -892,6 +904,7 @@ static void ephy_embed_single_iface_init (EphyEmbedSingleClass *iface) { iface->clear_cache = impl_clear_cache; + iface->clear_auth_cache = impl_clear_auth_cache; iface->set_offline_mode = impl_set_offline_mode; iface->load_proxy_autoconf = impl_load_proxy_autoconf; iface->get_font_list = impl_get_font_list; -- cgit v1.2.3