aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-embed-find.cpp3
-rw-r--r--embed/mozilla/mozilla-embed-single.cpp19
-rw-r--r--embed/mozilla/mozilla-embed.cpp13
-rw-r--r--embed/mozilla/mozilla-notifiers.cpp6
-rw-r--r--embed/mozilla/mozilla-notifiers.h3
5 files changed, 34 insertions, 10 deletions
diff --git a/embed/mozilla/mozilla-embed-find.cpp b/embed/mozilla/mozilla-embed-find.cpp
index 92e755e2b..d039b4d69 100644
--- a/embed/mozilla/mozilla-embed-find.cpp
+++ b/embed/mozilla/mozilla-embed-find.cpp
@@ -28,7 +28,6 @@
#include "mozilla-embed-find.h"
#include "ephy-embed-find.h"
#include "ephy-embed-shell.h"
-#include "ephy-object-helpers.h"
#include "ephy-debug.h"
#define MOZILLA_EMBED_FIND_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), MOZILLA_TYPE_EMBED_FIND, MozillaEmbedFindPrivate))
@@ -122,7 +121,7 @@ mozilla_embed_find_finalize (GObject *object)
parent_class->finalize (object);
- ephy_object_idle_unref (embed_shell);
+ g_object_unref (embed_shell);
}
static void
diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp
index 2053914e9..00d06875a 100644
--- a/embed/mozilla/mozilla-embed-single.cpp
+++ b/embed/mozilla/mozilla-embed-single.cpp
@@ -28,6 +28,7 @@
#include "ephy-cookie-manager.h"
#include "ephy-password-manager.h"
#include "ephy-permission-manager.h"
+#include "ephy-embed-shell.h"
#include "glib.h"
#include "ephy-debug.h"
@@ -545,6 +546,20 @@ init_services (MozillaEmbedSingle *single)
}
static void
+prepare_close_cb (EphyEmbedShell *shell)
+{
+ GValue value = { 0, };
+
+ /* To avoid evil web sites posing an alert and thus inhibiting
+ * shutdown, we just turn off javascript! :)
+ */
+ g_value_init (&value, G_TYPE_BOOLEAN);
+ g_value_set_boolean (&value, FALSE);
+ mozilla_pref_set ("javascript.enabled", &value);
+ g_value_unset (&value);
+}
+
+static void
mozilla_embed_single_init (MozillaEmbedSingle *mes)
{
mes->priv = MOZILLA_EMBED_SINGLE_GET_PRIVATE (mes);
@@ -571,6 +586,10 @@ mozilla_embed_single_init (MozillaEmbedSingle *mes)
exit (0);
}
+
+ g_signal_connect_object (embed_shell, "prepare-close",
+ G_CALLBACK (prepare_close_cb), mes,
+ (GConnectFlags) 0);
}
static void
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 1b7733e0d..1a8e31b55 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -29,7 +29,6 @@
#include "ephy-embed-shell.h"
#include "ephy-command-manager.h"
#include "ephy-string.h"
-#include "ephy-object-helpers.h"
#include "ephy-debug.h"
#include "EphyBrowser.h"
@@ -293,7 +292,7 @@ mozilla_embed_finalize (GObject *object)
G_OBJECT_CLASS (parent_class)->finalize (object);
- ephy_object_idle_unref (embed_shell);
+ g_object_unref (embed_shell);
}
static void
@@ -1135,6 +1134,13 @@ _mozilla_embed_new_xul_dialog (void)
g_object_ref (embed_shell);
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ g_object_set_data_full (G_OBJECT (window), "EmbedShellRef",
+ embed_shell,
+ (GDestroyNotify) g_object_unref);
+ g_signal_connect_object (embed_shell, "prepare_close",
+ G_CALLBACK (gtk_widget_destroy), window,
+ (GConnectFlags) G_CONNECT_SWAPPED);
+
embed = gtk_moz_embed_new ();
gtk_widget_show (embed);
gtk_container_add (GTK_CONTAINER (window), embed);
@@ -1155,8 +1161,5 @@ _mozilla_embed_new_xul_dialog (void)
G_CALLBACK (xul_title_cb),
window, (GConnectFlags) 0);
- g_object_weak_ref (G_OBJECT (window),
- (GWeakNotify) ephy_object_idle_unref, embed_shell);
-
return GTK_MOZ_EMBED (embed);
}
diff --git a/embed/mozilla/mozilla-notifiers.cpp b/embed/mozilla/mozilla-notifiers.cpp
index 717a4fcbc..db227962b 100644
--- a/embed/mozilla/mozilla-notifiers.cpp
+++ b/embed/mozilla/mozilla-notifiers.cpp
@@ -412,8 +412,8 @@ static const PrefData notifier_entries[] =
transform_cookies_accept_mode },
};
-static gboolean
-mozilla_set_pref (const char *pref,
+gboolean
+mozilla_pref_set (const char *pref,
const GValue *value)
{
g_return_val_if_fail (pref != NULL, FALSE);
@@ -466,7 +466,7 @@ notify_cb (GConfClient *client,
if (data->func (gcvalue, &value, data->user_data))
{
- mozilla_set_pref (data->mozilla_pref, &value);
+ mozilla_pref_set (data->mozilla_pref, &value);
g_value_unset (&value);
}
}
diff --git a/embed/mozilla/mozilla-notifiers.h b/embed/mozilla/mozilla-notifiers.h
index 72d5d1cf4..642361c29 100644
--- a/embed/mozilla/mozilla-notifiers.h
+++ b/embed/mozilla/mozilla-notifiers.h
@@ -45,6 +45,9 @@ guint mozilla_notifier_add (const char *gconf_key,
void mozilla_notifier_remove (guint id);
+gboolean mozilla_pref_set (const char *pref,
+ const GValue *value);
+
void mozilla_notifiers_init (void);
void mozilla_notifiers_shutdown (void);