aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/mozilla-embed.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-10-28 01:29:36 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-10-28 01:29:36 +0800
commit7b0fe9305597ff7bd10c4dc468ae00eab155ca36 (patch)
tree5b8a213e75b8c49a7246abed3ac9e65393517d9d /embed/mozilla/mozilla-embed.cpp
parent03518bcc5c5aa9a9149315e932f84a0aee2d44ce (diff)
downloadgsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.gz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.bz2
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.lz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.xz
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.tar.zst
gsoc2013-epiphany-7b0fe9305597ff7bd10c4dc468ae00eab155ca36.zip
Solving the wrapper mess THE END
2003-10-27 Marco Pesenti Gritti <marco@gnome.org> * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: * embed/mozilla/mozilla-embed.cpp: Solving the wrapper mess THE END An about:blank document is created syncronously on _init, which means there are no more race conditions ! Mozilla api is CRACK.
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r--embed/mozilla/mozilla-embed.cpp51
1 files changed, 5 insertions, 46 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index 5a6b11945..e240304d2 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -223,17 +223,9 @@ signal_connections[] =
struct MozillaEmbedPrivate
{
- MozillaEmbedPrivate() : browser(NULL), security_state(-1), no_page(1)
- { /* nothing */ }
-
EphyBrowser *browser;
nsCOMPtr<nsIRequest> request;
gint security_state;
-
- /* HACK 1: No page loaded, 0: Loading an empty page, -1: Page loaded */
- gint no_page;
-
- gboolean browser_document_initialized;
};
#define WINDOWWATCHER_CONTRACTID "@mozilla.org/embedcomp/window-watcher;1"
@@ -440,9 +432,8 @@ mozilla_embed_init (MozillaEmbed *embed)
{
embed->priv = MOZILLA_EMBED_GET_PRIVATE (embed);
- embed->priv->no_page = 1;
- embed->priv->browser_document_initialized = FALSE;
embed->priv->browser = new EphyBrowser ();
+ embed->priv->security_state = -1;
mozilla_embed_connect_signals (embed);
}
@@ -1081,19 +1072,11 @@ static void
mozilla_embed_location_changed_cb (GtkMozEmbed *embed,
MozillaEmbed *membed)
{
- /* Do not emit signal if we are loading the
- * fallback about:blank. We dont want the user
- * to know about it. */
- if (membed->priv->no_page != 0)
- {
- char *location;
-
- location = gtk_moz_embed_get_location (embed);
- g_signal_emit_by_name (membed, "ge_location", location);
- g_free (location);
- }
+ char *location;
- membed->priv->no_page = -1;
+ location = gtk_moz_embed_get_location (embed);
+ g_signal_emit_by_name (membed, "ge_location", location);
+ g_free (location);
}
static void
@@ -1131,30 +1114,6 @@ mozilla_embed_net_state_all_cb (GtkMozEmbed *embed, const char *aURI,
{ 0, EMBED_STATE_UNKNOWN }
};
- /* No page loaded, default to about:blank */
- if (membed->priv->no_page > 0 &&
- (state & GTK_MOZ_EMBED_FLAG_STOP) &&
- (state & GTK_MOZ_EMBED_FLAG_IS_DOCUMENT))
- {
- ephy_embed_load_url (EPHY_EMBED(membed), "about:blank");
- membed->priv->no_page = 0;
- }
-
- if (!membed->priv->browser_document_initialized)
- {
- nsresult rv;
-
- rv = membed->priv->browser->InitDocument ();
- if (NS_FAILED (rv))
- {
- g_warning ("Browser document initialization failed");
- }
- else
- {
- membed->priv->browser_document_initialized = TRUE;
- }
- }
-
for (i = 0; conversion_map[i].state != 0; i++)
{
if (state & conversion_map[i].state)