diff options
author | Xan Lopez <xan@src.gnome.org> | 2007-10-26 04:01:00 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2007-10-26 04:01:00 +0800 |
commit | 6638472fdbeee7c135c822ada01d09f407ca18e6 (patch) | |
tree | 9c9af360bfaaf544fd4ee45133b3eedb1ec7340c /embed/mozilla | |
parent | 2be1a6942311c3f8fd0d9335820919d281b437db (diff) | |
download | gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar.gz gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar.bz2 gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar.lz gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar.xz gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.tar.zst gsoc2013-epiphany-6638472fdbeee7c135c822ada01d09f407ca18e6.zip |
Move title/address update on open-uri signal to EphyEmbed.
Also refactor some common code in ephy-embed-utils.c
svn path=/trunk/; revision=7562
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 4ac762617..16ef8245f 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -105,6 +105,9 @@ static void mozilla_embed_set_icon_address (MozillaEmbed *embed, static void mozilla_embed_favicon_cb (EphyEmbed *embed, const char *address, MozillaEmbed *membed); +static gboolean mozilla_embed_open_uri_cb (EphyEmbed *embed, + const char *uri, + MozillaEmbed *membed); static void impl_set_typed_address (EphyEmbed *embed, const char *address, EphyEmbedAddressExpire expire); @@ -439,6 +442,9 @@ mozilla_embed_init (MozillaEmbed *embed) g_signal_connect_object (embed, "ge_favicon", G_CALLBACK (mozilla_embed_favicon_cb), embed, (GConnectFlags)0); + g_signal_connect_object (embed, "open_uri", + G_CALLBACK (mozilla_embed_open_uri_cb), + embed,(GConnectFlags) 0); cache = EPHY_FAVICON_CACHE (ephy_embed_shell_get_favicon_cache (embed_shell)); @@ -1195,6 +1201,22 @@ impl_get_link_message (EphyEmbed *embed) return priv->link_message; } +static gboolean +impl_get_is_blank (EphyEmbed *embed) +{ + MozillaEmbedPrivate *priv = MOZILLA_EMBED (embed)->priv; + + return priv->is_blank; +} + +static const char* +impl_get_loading_title (EphyEmbed *embed) +{ + MozillaEmbedPrivate *priv = MOZILLA_EMBED (embed)->priv; + + return priv->loading_title; +} + static void mozilla_embed_set_address (MozillaEmbed *embed, char *address) { @@ -2224,6 +2246,26 @@ mozilla_embed_title_change_cb (EphyEmbed *embed, g_object_thaw_notify (object); } +static gboolean +mozilla_embed_open_uri_cb (EphyEmbed *embed, + const char *uri, + MozillaEmbed *membed) +{ + MozillaEmbedPrivate *priv = membed->priv; + + /* Set the address here if we have a blank page. + * See bug #147840. + */ + if (priv->is_blank) + { + mozilla_embed_set_address (membed, g_strdup (uri)); + mozilla_embed_set_loading_title (membed, uri, TRUE); + } + + /* allow load to proceed */ + return FALSE; +} + static EphyEmbedSecurityLevel mozilla_embed_security_level (PRUint32 state) { @@ -2303,6 +2345,8 @@ ephy_embed_iface_init (EphyEmbedIface *iface) iface->set_typed_address = impl_set_typed_address; iface->get_address = impl_get_address; iface->get_status_message = impl_get_status_message; + iface->get_is_blank = impl_get_is_blank; + iface->get_loading_title = impl_get_loading_title; } static void |