diff options
author | Sergio Villar Senin <svillar@igalia.com> | 2012-03-08 01:28:02 +0800 |
---|---|---|
committer | Xan Lopez <xan@igalia.com> | 2012-03-20 18:55:11 +0800 |
commit | 6119b95ca4c0c2d4d78b27422dfb6ba9203bab56 (patch) | |
tree | 498151645cb0e38ba8854f738d749e04b39bb58c /embed/ephy-web-view.c | |
parent | bc0e3b41f8c21fa0b4bd0cd89e305b0fee049b6a (diff) | |
download | gsoc2013-epiphany-6119b95ca4c0c2d4d78b27422dfb6ba9203bab56.tar.gz gsoc2013-epiphany-6119b95ca4c0c2d4d78b27422dfb6ba9203bab56.tar.zst gsoc2013-epiphany-6119b95ca4c0c2d4d78b27422dfb6ba9203bab56.zip |
Replace EphyFaviconCache by WebKit's icon database cache
https://bugzilla.gnome.org/show_bug.cgi?id=648653
Diffstat (limited to 'embed/ephy-web-view.c')
-rw-r--r-- | embed/ephy-web-view.c | 42 |
1 files changed, 6 insertions, 36 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 2f6579e7e..66c057d0e 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -32,7 +32,6 @@ #include "ephy-embed-type-builtins.h" #include "ephy-embed-utils.h" #include "ephy-embed.h" -#include "ephy-favicon-cache.h" #include "ephy-file-helpers.h" #include "ephy-history.h" #include "ephy-history-service.h" @@ -1593,42 +1592,19 @@ static void _ephy_web_view_load_icon (EphyWebView *view) { EphyWebViewPrivate *priv = view->priv; - EphyEmbedShell *shell; - EphyFaviconCache *cache; - const char *icon_address; - - icon_address = webkit_web_view_get_icon_uri (WEBKIT_WEB_VIEW (view)); + const char* uri; - if (icon_address == NULL || priv->icon != NULL) return; - - shell = ephy_embed_shell_get_default (); - cache = EPHY_FAVICON_CACHE (ephy_embed_shell_get_favicon_cache (shell)); + if (priv->icon != NULL) + return; - /* ephy_favicon_cache_get returns a reference already */ - priv->icon = ephy_favicon_cache_get (cache, icon_address); + uri = webkit_web_view_get_uri (WEBKIT_WEB_VIEW (view)); + priv->icon = webkit_favicon_database_try_get_favicon_pixbuf (webkit_get_favicon_database (), uri, + FAVICON_SIZE, FAVICON_SIZE); g_object_notify (G_OBJECT (view), "icon"); } static void -icon_cache_changed_cb (EphyFaviconCache *cache, - const char *address, - EphyWebView *view) -{ - const char *icon_address; - - g_return_if_fail (address != NULL); - - icon_address = webkit_web_view_get_icon_uri (WEBKIT_WEB_VIEW (view)); - - /* is this for us? */ - if (icon_address != NULL && - strcmp (icon_address, address) == 0) { - _ephy_web_view_load_icon (view); - } -} - -static void _ephy_web_view_set_icon_address (EphyWebView *view, const char *icon_address) { @@ -2337,7 +2313,6 @@ static void ephy_web_view_init (EphyWebView *web_view) { EphyWebViewPrivate *priv; - EphyFaviconCache *cache; priv = web_view->priv = EPHY_WEB_VIEW_GET_PRIVATE (web_view); @@ -2407,11 +2382,6 @@ ephy_web_view_init (EphyWebView *web_view) G_CALLBACK (ge_popup_blocked_cb), NULL); - cache = EPHY_FAVICON_CACHE - (ephy_embed_shell_get_favicon_cache (embed_shell)); - g_signal_connect_object (G_OBJECT (cache), "changed", - G_CALLBACK (icon_cache_changed_cb), - web_view, (GConnectFlags)0); } /** |