aboutsummaryrefslogtreecommitdiffstats
path: root/embed/ephy-web-view.c
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-14 01:57:56 +0800
committerXan Lopez <xan@igalia.com>2012-03-14 19:45:03 +0800
commitd42586bb4a2fb45cad1fcc2cf7f6b49a423770cd (patch)
treed20150e82405b42d4a78c9fc44eb42d9f38edca4 /embed/ephy-web-view.c
parentc07e7d034b4cfdaad4fc35ef5e82bee9718a1bd9 (diff)
downloadgsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.gz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.bz2
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.lz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.xz
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.tar.zst
gsoc2013-epiphany-d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd.zip
history: remember visit types
Instead of hardcoding all visits as 'TYPED' properly distinguish between bookmarks, following links and typing URIs in the entry. We'll use this to compute the frecency of history items.
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r--embed/ephy-web-view.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index de26f42d6..3314e4271 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -104,6 +104,8 @@ struct _EphyWebViewPrivate {
GSList *shown_popups;
GtkWidget *password_info_bar;
+
+ EphyHistoryPageVisitType visit_type;
};
typedef struct {
@@ -1949,6 +1951,9 @@ load_status_cb (WebKitWebView *web_view,
if (uri)
soup_uri_free (uri);
+ /* Reset visit type. */
+ priv->visit_type = EPHY_PAGE_VISIT_NONE;
+
break;
}
case WEBKIT_LOAD_FAILED:
@@ -3694,6 +3699,8 @@ ephy_web_view_load_homepage (EphyWebView *view)
{
g_signal_emit_by_name (view, "loading-homepage");
+ ephy_web_view_set_visit_type (view,
+ EPHY_PAGE_VISIT_HOMEPAGE);
ephy_web_view_load_url (view, "about:blank");
}
@@ -3740,3 +3747,33 @@ ephy_web_view_is_loading_homepage (EphyWebView *view)
return view->priv->loading_homepage;
}
+
+/**
+ * ephy_web_view_get_visit_type:
+ * @view: an #EphyWebView
+ *
+ * Returns: the @view #EphyWebViewVisitType
+ **/
+EphyHistoryPageVisitType
+ephy_web_view_get_visit_type (EphyWebView *view)
+{
+ g_return_val_if_fail (EPHY_IS_WEB_VIEW (view), 0);
+
+ return view->priv->visit_type;
+}
+
+/**
+ * ephy_web_view_set_visit_type:
+ * @view: an #EphyWebView
+ * @visit_type: an #EphyHistoryPageVisitType
+ *
+ * Sets the @visit_type for @view, so that the URI can be
+ * properly weighted in the history backend.
+ **/
+void
+ephy_web_view_set_visit_type (EphyWebView *view, EphyHistoryPageVisitType visit_type)
+{
+ g_return_if_fail (EPHY_IS_WEB_VIEW (view));
+
+ view->priv->visit_type = visit_type;
+}