aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed-single.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-07-04 22:15:49 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-07-04 22:15:49 +0800
commit0774d40cedbde3a4c8751d02e237f7b3b0e25572 (patch)
treed551ee3ee49b76db5ab2b1369bdcece3f1ee0a0e /embed/mozilla/mozilla-embed-single.cpp
parent53e29e3ec1e3d6f72118873a221cdf2bc621091b (diff)
downloadgsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.gz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.bz2
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.lz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.xz
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.tar.zst
gsoc2013-epiphany-0774d40cedbde3a4c8751d02e237f7b3b0e25572.zip
Remove use of acconfig.h.
2003-07-04 Marco Pesenti Gritti <marco@it.gnome.org> * configure.in: Remove use of acconfig.h. * embed/ephy-embed-shell.c: (ephy_embed_shell_get_embed_single): * embed/ephy-embed-single.c: * embed/ephy-embed-single.h: * embed/mozilla/ContentHandler.cpp: * embed/mozilla/EphyWrapper.cpp: * embed/mozilla/Makefile.am: * embed/mozilla/MozRegisterComponents.cpp: * embed/mozilla/MozRegisterComponents.h: * embed/mozilla/mozilla-embed-single.cpp: * embed/mozilla/mozilla-embed-single.h: * src/bookmarks/ephy-bookmarks-import.c: (bookmark_add), (xbel_parse_folder), (ephy_bookmarks_import_mozilla): * src/ephy-shell.c: (ephy_shell_init): Show an alert when mozilla cant start instead of crashing. Do not import bookmarks dups. Cleanup some mozilla code headers inclusion.
Diffstat (limited to 'embed/mozilla/mozilla-embed-single.cpp')
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp43
1 files changed, 29 insertions, 14 deletions
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 437e6edb7..6d03e08d4 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -37,7 +37,6 @@
#include <time.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
-#include "nsBuildID.h"
#include <nsICacheService.h>
#include <nsCOMPtr.h>
#include <nsIPrefService.h>
@@ -45,7 +44,6 @@
#include <nsIServiceManager.h>
#include <nsIIOService.h>
#include <nsIProtocolProxyService.h>
-#include <nsIJVMManager.h>
#include <nsIAtom.h>
#include <nsIFontList.h>
#include <nsISupportsPrimitives.h>
@@ -250,8 +248,6 @@ struct MozillaEmbedSinglePrivate
GtkWidget *theme_window;
};
-static NS_DEFINE_CID(kJVMManagerCID, NS_JVMMANAGER_CID);
-
static GObjectClass *parent_class = NULL;
GType
@@ -306,17 +302,23 @@ mozilla_embed_single_class_init (MozillaEmbedSingleClass *klass)
shell_class->show_file_picker = impl_show_file_picker;
}
-static void
+EphyEmbedSingle *
+mozilla_embed_single_new (void)
+{
+ return EPHY_EMBED_SINGLE (g_object_new (MOZILLA_EMBED_SINGLE_TYPE, NULL));
+}
+
+static gboolean
mozilla_set_default_prefs (MozillaEmbedSingle *mes)
{
nsCOMPtr<nsIPrefService> prefService;
prefService = do_GetService (NS_PREFSERVICE_CONTRACTID);
- g_return_if_fail (prefService != NULL);
+ if (prefService == NULL) return FALSE;
nsCOMPtr<nsIPrefBranch> pref;
prefService->GetBranch ("", getter_AddRefs(pref));
- g_return_if_fail (pref != NULL);
+ if (pref == NULL) return FALSE;
/* Don't allow mozilla to raise window when setting focus (work around bugs) */
pref->SetBoolPref ("mozilla.widget.raise-on-setfocus", PR_FALSE);
@@ -383,6 +385,8 @@ mozilla_set_default_prefs (MozillaEmbedSingle *mes)
sub for embedding apps */
pref->SetCharPref ("general.useragent.vendor", "Epiphany");
pref->SetCharPref ("general.useragent.vendorSub", VERSION);
+
+ return TRUE;
}
static char *
@@ -531,13 +535,18 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes)
{
mes->priv = g_new0 (MozillaEmbedSinglePrivate, 1);
+ mes->priv->theme_window = NULL;
mes->priv->user_prefs =
g_build_filename (ephy_dot_dir (),
MOZILLA_PROFILE_DIR,
MOZILLA_PROFILE_NAME,
MOZILLA_PROFILE_FILE,
NULL);
+}
+gboolean
+mozilla_embed_single_init_services (MozillaEmbedSingle *single)
+{
/* Pre initialization */
mozilla_init_home ();
mozilla_init_profile ();
@@ -545,24 +554,27 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes)
/* Fire up the best */
gtk_moz_embed_push_startup ();
- mozilla_set_default_prefs (mes);
+ mozilla_init_single (single);
+
+ if (!mozilla_set_default_prefs (single))
+ {
+ return FALSE;
+ }
/* FIXME: This should be removed when mozilla
* bugs 207000 and 207001 are fixed.
*/
- mozilla_setup_colors (mes);
+ mozilla_setup_colors (single);
START_PROFILER ("Mozilla prefs notifiers")
- mozilla_notifiers_init (EPHY_EMBED_SINGLE (mes));
+ mozilla_notifiers_init (EPHY_EMBED_SINGLE (single));
STOP_PROFILER ("Mozilla prefs notifiers")
- mozilla_init_single (mes);
-
mozilla_register_components ();
mozilla_register_external_protocols ();
- /* FIXME alert if fails */
+ return TRUE;
}
static void
@@ -632,7 +644,10 @@ mozilla_embed_single_finalize (GObject *object)
g_free (mes->priv->user_prefs);
- gtk_widget_destroy (mes->priv->theme_window);
+ if (mes->priv->theme_window)
+ {
+ gtk_widget_destroy (mes->priv->theme_window);
+ }
g_free (mes->priv);
}