diff options
author | Xan Lopez <xan@gnome.org> | 2010-05-02 21:54:30 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2010-05-03 19:40:33 +0800 |
commit | fb45861008ad3bc272ef50f11c37be64078ff7bd (patch) | |
tree | a56f7fc40d74c40335970d4770970ebf9978dc94 | |
parent | 769b30d8448f3b87cdc6967d3c0dbae31e44eaf8 (diff) | |
download | gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar.gz gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar.bz2 gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar.lz gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar.xz gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.tar.zst gsoc2013-epiphany-fb45861008ad3bc272ef50f11c37be64078ff7bd.zip |
Move URI handling to EphyWebView
-rw-r--r-- | embed/ephy-embed.c | 21 | ||||
-rw-r--r-- | embed/ephy-web-view.c | 21 |
2 files changed, 21 insertions, 21 deletions
diff --git a/embed/ephy-embed.c b/embed/ephy-embed.c index e9c210eb2..5f1a39177 100644 --- a/embed/ephy-embed.c +++ b/embed/ephy-embed.c @@ -69,26 +69,6 @@ struct EphyEmbedPrivate G_DEFINE_TYPE (EphyEmbed, ephy_embed, GTK_TYPE_VBOX) static void -uri_changed_cb (WebKitWebView *web_view, - GParamSpec *spec, - EphyEmbed *embed) -{ - char *uri; - const char *current_address; - - g_object_get (web_view, "uri", &uri, NULL); - current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view)); - - /* We need to check if we get URI notifications without going - through the usual load process, as this can happen when changing - location within a page */ - if (g_str_equal (uri, current_address) == FALSE) - ephy_web_view_set_address (EPHY_WEB_VIEW (web_view), uri); - - g_free (uri); -} - -static void restore_zoom_level (EphyEmbed *embed, const char *address) { @@ -829,7 +809,6 @@ ephy_embed_constructed (GObject *object) "signal::hovering-over-link", G_CALLBACK (hovering_over_link_cb), embed, "signal::download-requested", G_CALLBACK (download_requested_cb), embed, "signal::notify::zoom-level", G_CALLBACK (zoom_changed_cb), embed, - "signal::notify::uri", G_CALLBACK (uri_changed_cb), embed, NULL); embed->priv->inspector_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 61b973255..21925321b 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1324,12 +1324,33 @@ title_changed_cb (WebKitWebView *web_view, } static void +uri_changed_cb (WebKitWebView *web_view, + GParamSpec *spec, + gpointer data) +{ + char *uri; + const char *current_address; + + g_object_get (web_view, "uri", &uri, NULL); + current_address = ephy_web_view_get_address (EPHY_WEB_VIEW (web_view)); + + /* We need to check if we get URI notifications without going + through the usual load process, as this can happen when changing + location within a page */ + if (g_str_equal (uri, current_address) == FALSE) + ephy_web_view_set_address (EPHY_WEB_VIEW (web_view), uri); + + g_free (uri); +} + +static void ephy_web_view_constructed (GObject *object) { EphyWebView *web_view = EPHY_WEB_VIEW (object); g_object_connect (web_view, "signal::notify::title", G_CALLBACK (title_changed_cb), NULL, + "signal::notify::uri", G_CALLBACK (uri_changed_cb), NULL, NULL); } |