From 32e7f698ede6d453c563743198ddca5a270a03fd Mon Sep 17 00:00:00 2001 From: Christian Biesinger Date: Wed, 7 Apr 2004 15:51:31 +0000 Subject: Eliminate ExternalProtocolHandlers in favor of setting prefs to make * embed/mozilla/ExternalProtocolHandlers.cpp: * embed/mozilla/ExternalProtocolHandlers.h: * embed/mozilla/FilePicker.cpp: * embed/mozilla/Makefile.am: * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/MozRegisterComponents.h: * embed/mozilla/mozilla-embed-single.cpp: Eliminate ExternalProtocolHandlers in favor of setting prefs to make Mozilla not handle the protocols internally. --- embed/mozilla/mozilla-embed-single.cpp | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) (limited to 'embed/mozilla/mozilla-embed-single.cpp') diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index 221523df8..9435a7203 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -1,4 +1,4 @@ -/* +/* vim:set ts=8 noet sw=8: * Copyright (C) 2000-2003 Marco Pesenti Gritti * Copyright (C) 2003 Christian Persch * @@ -96,6 +96,7 @@ static void ephy_cookie_manager_iface_init (EphyCookieManagerIface *iface); static void ephy_password_manager_iface_init (EphyPasswordManagerIface *iface); static void ephy_permission_manager_iface_init (EphyPermissionManagerIface *iface); static void mozilla_embed_single_init (MozillaEmbedSingle *ges); +static gboolean have_gnome_url_handler (const gchar *protocol); static GObjectClass *parent_class = NULL; @@ -212,6 +213,19 @@ mozilla_set_default_prefs (MozillaEmbedSingle *mes) pref->SetCharPref ("general.useragent.vendor", "Epiphany"); pref->SetCharPref ("general.useragent.vendorSub", VERSION); + /* Make sure that Mozilla does not handle these protocols internally */ + pref->SetBoolPref("network.protocol-handler.external.news", TRUE); + pref->SetBoolPref("network.protocol-handler.external.mailto", TRUE); + pref->SetBoolPref("network.protocol-handler.external.irc", TRUE); + if (have_gnome_url_handler ("ftp")) + { + pref->SetBoolPref("network.protocol-handler.external.ftp", TRUE); + } + else + { + pref->SetBoolPref("network.protocol-handler.external.ftp", FALSE); + } + return TRUE; } @@ -351,20 +365,6 @@ have_gnome_url_handler (const gchar *protocol) return rv; } -static void -mozilla_register_external_protocols (void) -{ - /* FIXME register only when needed */ - if (have_gnome_url_handler ("ftp")) - { - mozilla_register_FtpProtocolHandler (); - } - else - { - mozilla_unregister_FtpProtocolHandler (); - } -} - static nsresult getUILang (nsAString& aUILang) { @@ -453,8 +453,6 @@ init_services (MozillaEmbedSingle *single) mozilla_register_components (); - mozilla_register_external_protocols (); - mozilla_init_observer (single); return TRUE; -- cgit v1.2.3