diff options
author | Xan Lopez <xan@src.gnome.org> | 2007-12-30 07:39:23 +0800 |
---|---|---|
committer | Xan Lopez <xan@src.gnome.org> | 2007-12-30 07:39:23 +0800 |
commit | 2a776b7f4ea30e814b2703a50633143b5b0ebc95 (patch) | |
tree | 5bbcfc00e1a574c903b56dc4c2bce782bfe28d4a /embed/mozilla/mozilla-embed.cpp | |
parent | 8fdb4086efaad93d0c9349520081a9608853fca0 (diff) | |
download | gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.gz gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.bz2 gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.lz gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.xz gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.tar.zst gsoc2013-epiphany-2a776b7f4ea30e814b2703a50633143b5b0ebc95.zip |
Make MozillaHistoryItem create url and title on demand.
Adapt code to the API change.
svn path=/trunk/; revision=7835
Diffstat (limited to 'embed/mozilla/mozilla-embed.cpp')
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index ad52392fb..b9badb6b2 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -880,37 +880,14 @@ impl_has_modified_forms (EphyEmbed *embed) static EphyHistoryItem* mozilla_get_nth_history_item (MozillaEmbed *embed, gboolean is_relative, - int absolute_nth) + int nth) { - char *url = NULL, *title = NULL; - nsresult rv; - nsCString nsUrl; - PRUnichar *nsTitle; - int nth = absolute_nth; - MozillaEmbedPrivate *mpriv = embed->priv; - if (is_relative) { nth += impl_shistory_get_pos (EPHY_EMBED (embed)); } - rv = mpriv->browser->GetSHUrlAtIndex(nth, nsUrl); - - if (NS_SUCCEEDED (rv) && nsUrl.Length()) - url = g_strdup(nsUrl.get()); - - rv = mpriv->browser->GetSHTitleAtIndex(nth, &nsTitle); - - if (NS_SUCCEEDED (rv) && nsTitle) - { - nsCString cTitle; - NS_UTF16ToCString (nsString(nsTitle), - NS_CSTRING_ENCODING_UTF8, cTitle); - title = g_strdup (cTitle.get()); - nsMemory::Free (nsTitle); - } - - return (EphyHistoryItem*)mozilla_history_item_new (url, title, absolute_nth); + return (EphyHistoryItem*)mozilla_history_item_new (embed, nth); } static GList* @@ -1572,3 +1549,11 @@ _mozilla_embed_new_xul_dialog (void) return GTK_MOZ_EMBED (embed); } + +EphyBrowser* +_mozilla_embed_get_browser (MozillaEmbed *embed) +{ + g_return_val_if_fail (MOZILLA_IS_EMBED (embed), NULL); + + return embed->priv->browser; +} |