diff options
author | Xan Lopez <xan@igalia.com> | 2012-03-14 01:57:56 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-14 19:45:03 +0800 |
commit | d42586bb4a2fb45cad1fcc2cf7f6b49a423770cd (patch) | |
tree | d20150e82405b42d4a78c9fc44eb42d9f38edca4 /src | |
parent | c07e7d034b4cfdaad4fc35ef5e82bee9718a1bd9 (diff) | |
download | gsoc2013-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 'src')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 2 | ||||
-rw-r--r-- | src/ephy-link.h | 4 | ||||
-rw-r--r-- | src/ephy-location-controller.c | 4 | ||||
-rw-r--r-- | src/ephy-private.h | 1 | ||||
-rw-r--r-- | src/ephy-window.c | 10 |
5 files changed, 18 insertions, 3 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 29c568486..814fadd7e 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -183,6 +183,8 @@ ephy_bookmark_action_activate (EphyBookmarkAction *action, } g_return_if_fail (address != NULL); + flags |= EPHY_LINK_BOOKMARK; + ephy_link_open (EPHY_LINK (action), address, NULL, flags); g_free (address); diff --git a/src/ephy-link.h b/src/ephy-link.h index 65bad41b4..58c542fb9 100644 --- a/src/ephy-link.h +++ b/src/ephy-link.h @@ -47,7 +47,9 @@ typedef enum EPHY_LINK_NEW_TAB = 1 << 1, EPHY_LINK_JUMP_TO = 1 << 2, EPHY_LINK_NEW_TAB_APPEND_AFTER = 1 << 3, - EPHY_LINK_HOME_PAGE = 1 << 4 + EPHY_LINK_HOME_PAGE = 1 << 4, + EPHY_LINK_TYPED = 1 << 5, + EPHY_LINK_BOOKMARK = 1 << 6 } EphyLinkFlags; struct _EphyLinkIface diff --git a/src/ephy-location-controller.c b/src/ephy-location-controller.c index 5908967a4..8ebdc74b4 100644 --- a/src/ephy-location-controller.c +++ b/src/ephy-location-controller.c @@ -127,7 +127,7 @@ action_activated_cb (GtkEntryCompletion *completion, if (url == NULL) return; ephy_link_open (EPHY_LINK (controller), url, NULL, - ephy_link_flags_from_current_event ()); + ephy_link_flags_from_current_event () | EPHY_LINK_TYPED); g_free (url); } @@ -159,7 +159,7 @@ entry_activate_cb (GtkEntry *entry, g_return_if_fail (address != NULL); ephy_link_open (EPHY_LINK (controller), g_strstrip (address), NULL, - ephy_link_flags_from_current_event ()); + ephy_link_flags_from_current_event () | EPHY_LINK_TYPED); g_free (address); } diff --git a/src/ephy-private.h b/src/ephy-private.h index ee2514ea1..1f3b0390a 100644 --- a/src/ephy-private.h +++ b/src/ephy-private.h @@ -27,6 +27,7 @@ #include "ephy-embed.h" #include "ephy-embed-event.h" +#include "ephy-embed-private.h" #include "ephy-location-controller.h" #include "ephy-window.h" diff --git a/src/ephy-window.c b/src/ephy-window.c index d3cbfeb91..90d4b95cb 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -544,6 +544,13 @@ ephy_window_open_link (EphyLink *link, embed = window->priv->active_embed; } + if (flags & EPHY_LINK_BOOKMARK) + ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed), + EPHY_PAGE_VISIT_BOOKMARK); + else if (flags & EPHY_LINK_TYPED) + ephy_web_view_set_visit_type (ephy_embed_get_web_view (embed), + EPHY_PAGE_VISIT_TYPED); + if (flags & (EPHY_LINK_JUMP_TO | EPHY_LINK_NEW_TAB | EPHY_LINK_NEW_WINDOW | @@ -2175,6 +2182,9 @@ policy_decision_required_cb (WebKitWebView *web_view, flags = EPHY_NEW_TAB_OPEN_PAGE; + ephy_web_view_set_visit_type (EPHY_WEB_VIEW (web_view), + EPHY_PAGE_VISIT_LINK); + /* New tab in new window for control+shift+click */ if (button == 1 && state == (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) |