aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-03-14 19:48:23 +0800
committerXan Lopez <xan@igalia.com>2012-03-14 19:48:23 +0800
commit1b941be52d0ed9ec90036efe4987740076c501a2 (patch)
treea4dd0fcbf6d55f215df06043641d5218209b873f /embed
parent6f220733c22c7c2f04ba8894a470ba7b7c64d8bd (diff)
downloadgsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar.gz
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar.bz2
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar.lz
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar.xz
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.tar.zst
gsoc2013-epiphany-1b941be52d0ed9ec90036efe4987740076c501a2.zip
ephy-web-view: move history management to EphyWebView
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed.c27
-rw-r--r--embed/ephy-web-view.c20
2 files changed, 21 insertions, 26 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c
index 44a84666c..a0ed87c8c 100644
--- a/embed/ephy-embed.c
+++ b/embed/ephy-embed.c
@@ -277,33 +277,8 @@ load_status_changed_cb (WebKitWebView *web_view,
{
WebKitLoadStatus status = webkit_web_view_get_load_status (web_view);
- if (status == WEBKIT_LOAD_COMMITTED) {
- const gchar* uri;
- char *history_uri;
- EphyHistoryPageVisitType visit_type;
- EphyWebView *view = EPHY_WEB_VIEW (web_view);
-
- uri = webkit_web_view_get_uri (web_view);
-
+ if (status == WEBKIT_LOAD_COMMITTED)
ephy_embed_destroy_top_widgets (embed);
-
- if (ephy_web_view_is_loading_homepage (view))
- return;
-
- /* TODO: move the normalization down to the history service? */
- if (g_str_has_prefix (uri, EPHY_ABOUT_SCHEME))
- history_uri = g_strdup_printf ("about:%s", uri + EPHY_ABOUT_SCHEME_LEN + 1);
- else
- history_uri = g_strdup (uri);
-
- visit_type = ephy_web_view_get_visit_type (view);
-
- ephy_history_service_visit_url (embed->priv->history_service,
- history_uri,
- visit_type);
-
- g_free (history_uri);
- }
}
static void
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 55aa51d44..47f7c0b24 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -1936,12 +1936,14 @@ load_status_cb (WebKitWebView *web_view,
const gchar* uri;
EphyWebViewSecurityLevel security_level;
+ /* Title and location. */
uri = webkit_web_view_get_uri (web_view);
ephy_web_view_location_changed (view,
uri);
ephy_web_view_set_title (view, NULL);
+ /* Security status. */
if (uri && g_str_has_prefix (uri, "https")) {
WebKitWebFrame *frame;
WebKitWebDataSource *source;
@@ -1963,7 +1965,25 @@ load_status_cb (WebKitWebView *web_view,
ephy_web_view_set_security_level (EPHY_WEB_VIEW (web_view), security_level);
+ /* Zoom level. */
restore_zoom_level (view, uri);
+
+ /* History. */
+ if (!ephy_web_view_is_loading_homepage (view)) {
+ char *history_uri = NULL;
+
+ /* TODO: move the normalization down to the history service? */
+ if (g_str_has_prefix (uri, EPHY_ABOUT_SCHEME))
+ history_uri = g_strdup_printf ("about:%s", uri + EPHY_ABOUT_SCHEME_LEN + 1);
+ else
+ history_uri = g_strdup (uri);
+
+ ephy_history_service_visit_url (priv->history_service,
+ history_uri,
+ priv->visit_type);
+
+ g_free (history_uri);
+ }
}
break;
case WEBKIT_LOAD_FINISHED: {