aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2007-12-30 08:24:40 +0800
committerXan Lopez <xan@src.gnome.org>2007-12-30 08:24:40 +0800
commite63a085bb01b783057e0cba91725f3af884d3292 (patch)
tree233f547200605c4001be2972b40ba516f976ce46 /embed/mozilla
parent2a776b7f4ea30e814b2703a50633143b5b0ebc95 (diff)
downloadgsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar.gz
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar.bz2
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar.lz
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar.xz
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.tar.zst
gsoc2013-epiphany-e63a085bb01b783057e0cba91725f3af884d3292.zip
Port ephy-window.c to the new API, remove old API.
Closes bug #506005 svn path=/trunk/; revision=7836
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/mozilla-embed.cpp59
1 files changed, 8 insertions, 51 deletions
diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp
index b9badb6b2..d8ffc136b 100644
--- a/embed/mozilla/mozilla-embed.cpp
+++ b/embed/mozilla/mozilla-embed.cpp
@@ -669,43 +669,6 @@ impl_shistory_n_items (EphyEmbed *embed)
return NS_SUCCEEDED(rv) ? count : 0;
}
-static void
-impl_shistory_get_nth (EphyEmbed *embed,
- int nth,
- gboolean is_relative,
- char **aUrl,
- char **aTitle)
-{
- nsresult rv;
- nsCString url;
- PRUnichar *title;
- MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv;
-
- if (is_relative)
- {
- nth += ephy_embed_shistory_get_pos (embed);
- }
-
- rv = mpriv->browser->GetSHUrlAtIndex(nth, url);
-
- *aUrl = (NS_SUCCEEDED (rv) && url.Length()) ? g_strdup(url.get()) : NULL;
-
- rv = mpriv->browser->GetSHTitleAtIndex(nth, &title);
-
- if (title)
- {
- nsCString cTitle;
- NS_UTF16ToCString (nsString(title),
- NS_CSTRING_ENCODING_UTF8, cTitle);
- *aTitle = g_strdup (cTitle.get());
- nsMemory::Free (title);
- }
- else
- {
- *aTitle = NULL;
- }
-}
-
static int
impl_shistory_get_pos (EphyEmbed *embed)
{
@@ -719,15 +682,6 @@ impl_shistory_get_pos (EphyEmbed *embed)
}
static void
-impl_shistory_go_nth (EphyEmbed *embed,
- int nth)
-{
- MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv;
-
- mpriv->browser->GoToHistoryIndex (nth);
-}
-
-static void
impl_shistory_copy (EphyEmbed *source,
EphyEmbed *dest,
gboolean copy_back,
@@ -882,12 +836,19 @@ mozilla_get_nth_history_item (MozillaEmbed *embed,
gboolean is_relative,
int nth)
{
+ EphyHistoryItem *item = NULL;
+
if (is_relative)
{
nth += impl_shistory_get_pos (EPHY_EMBED (embed));
}
- return (EphyHistoryItem*)mozilla_history_item_new (embed, nth);
+ if (nth >= 0 && nth <= impl_shistory_n_items (EPHY_EMBED (embed)))
+ {
+ item = (EphyHistoryItem*)mozilla_history_item_new (embed, nth);
+ }
+
+ return item;
}
static GList*
@@ -1448,10 +1409,6 @@ ephy_embed_iface_init (EphyEmbedIface *iface)
iface->scroll_lines = impl_scroll_lines;
iface->scroll_pages = impl_scroll_pages;
iface->scroll_pixels = impl_scroll_pixels;
- iface->shistory_n_items = impl_shistory_n_items;
- iface->shistory_get_nth = impl_shistory_get_nth;
- iface->shistory_get_pos = impl_shistory_get_pos;
- iface->shistory_go_nth = impl_shistory_go_nth;
iface->shistory_copy = impl_shistory_copy;
iface->show_page_certificate = impl_show_page_certificate;
iface->close = impl_close;