From 68c462736befcc1a84929a48b1ccfb09de8655ba Mon Sep 17 00:00:00 2001 From: Claudio Saavedra Date: Mon, 27 Aug 2012 17:25:51 +0300 Subject: ephy-web-view: define the special-cased title for the overview --- embed/ephy-web-view.c | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 6a307e43c..7805b785c 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1100,6 +1100,9 @@ get_title_from_address (const char *address) return g_strdup (address + 7); else if (!strcmp (address, EPHY_ABOUT_SCHEME":plugins")) return g_strdup (_("Plugins")); + else if (!strcmp (address, EPHY_ABOUT_SCHEME":overview") || + !strcmp (address, "about:overview")) + return g_strdup (_("Most visited")); else return ephy_string_get_host_name (address); } @@ -2087,6 +2090,21 @@ ephy_web_view_is_history_frozen (EphyWebView *view) return view->priv->history_frozen; } +static gboolean +web_view_check_snapshot (WebKitWebView *web_view) +{ + EphyOverviewStore *store; + GtkTreeIter iter; + + store = EPHY_OVERVIEW_STORE (ephy_embed_shell_get_frecent_store (embed_shell)); + if (ephy_overview_store_find_url (store, webkit_web_view_get_uri (web_view), &iter) && + ephy_overview_store_needs_snapshot (store, &iter)) + ephy_overview_store_set_snapshot (store, &iter, + webkit_web_view_get_snapshot (web_view)); + + return FALSE; +} + #ifdef HAVE_WEBKIT2 static void load_changed_cb (WebKitWebView *web_view, @@ -2328,8 +2346,6 @@ load_status_cb (WebKitWebView *web_view, } case WEBKIT_LOAD_FINISHED: { SoupURI *uri; - EphyOverviewStore *store; - GtkTreeIter iter; priv->loading_homepage = FALSE; @@ -2379,12 +2395,7 @@ load_status_cb (WebKitWebView *web_view, /* Reset visit type. */ priv->visit_type = EPHY_PAGE_VISIT_NONE; - store = EPHY_OVERVIEW_STORE (ephy_embed_shell_get_frecent_store (embed_shell)); - if (ephy_overview_store_find_url (store, webkit_web_view_get_uri (web_view), &iter) && - ephy_overview_store_needs_snapshot (store, &iter)) - ephy_overview_store_set_snapshot (store, &iter, - webkit_web_view_get_snapshot (web_view)); - + g_idle_add ((GSourceFunc) web_view_check_snapshot, web_view); break; } -- cgit v1.2.3