[epiphany/in-tab-overview: 29/56] ephy-web-view: define the special-cased title for the overview



commit de9a7c968204aa317517a27fd0d676c291a2651f
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Mon Aug 27 17:25:51 2012 +0300

    ephy-web-view: define the special-cased title for the overview

 embed/ephy-web-view.c |   27 +++++++++++++++++++--------
 1 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 6a307e4..7805b78 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;
   }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]