diff options
author | Jean-François Rameau <jframeau@cvs.gnome.org> | 2005-12-20 05:33:41 +0800 |
---|---|---|
committer | Jean-François Rameau <jframeau@src.gnome.org> | 2005-12-20 05:33:41 +0800 |
commit | 75b2ce17335253696b6e064e093af57902a7d39c (patch) | |
tree | 154e37415e375ecd7a83aa266fad30fd04c68733 /embed/ephy-embed-shell.c | |
parent | 44f5c62d3fa80ae1db96104c51a3af7b44540354 (diff) | |
download | gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar.gz gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar.bz2 gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar.lz gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar.xz gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.tar.zst gsoc2013-epiphany-75b2ce17335253696b6e064e093af57902a7d39c.zip |
Add some code so ad blocking should be more easy. Based on the fact that
2005-12-19 Jean-François Rameau <jframeau@cvs.gnome.org>
* embed/Makefile.am:
* embed/ephy-adblock-manager.c:
* embed/ephy-adblock-manager.h:
* embed/ephy-embed-shell.c: (ephy_embed_shell_finalize):
* embed/ephy-embed-shell.h:
* embed/mozilla/EphyContentPolicy.cpp: (EphyContentPolicy::ShouldLoad):
* lib/Makefile.am:
* lib/ephy-adblock.h:
* lib/ephy-adblock.c:
* src/ephy-shell.c: (ephy_shell_get_extensions_manager):
Add some code so ad blocking should be more easy. Based on the fact
that Epiphany already has its own content policy component (EphyContentPolicy).
The new design adds:
- an interface, EphyAdBlock
- a manager, EphyAdBlockManager, pointing to a blocker (possibly no one).
Diffstat (limited to 'embed/ephy-embed-shell.c')
-rw-r--r-- | embed/ephy-embed-shell.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c index acee03562..9e50c59fc 100644 --- a/embed/ephy-embed-shell.c +++ b/embed/ephy-embed-shell.c @@ -31,6 +31,7 @@ #include "downloader-view.h" #include "ephy-encodings.h" #include "ephy-debug.h" +#include "ephy-adblock-manager.h" #define EPHY_EMBED_SHELL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_EMBED_SHELL, EphyEmbedShellPrivate)) @@ -41,6 +42,7 @@ struct _EphyEmbedShellPrivate EphyFaviconCache *favicon_cache; EphyEmbedSingle *embed_single; EphyEncodings *encodings; + EphyAdBlockManager *adblock_manager; }; enum @@ -136,6 +138,13 @@ ephy_embed_shell_finalize (GObject *object) g_object_unref (G_OBJECT (shell->priv->embed_single)); } + if (shell->priv->adblock_manager != NULL) + { + LOG ("Unref adblock manager"); + g_object_unref (shell->priv->adblock_manager); + shell->priv->adblock_manager = NULL; + } + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -284,3 +293,25 @@ ephy_embed_shell_get_default (void) { return embed_shell; } + +/** + * ephy_embed_shell_get_adblock_manager: + * @shell: the #EphyEmbedShell + * + * Returns the adblock manager. + * + * Return value: the adblock manager + **/ +GObject * +ephy_embed_shell_get_adblock_manager (EphyEmbedShell *shell) +{ + g_return_val_if_fail (EPHY_IS_EMBED_SHELL (shell), NULL); + + if (shell->priv->adblock_manager == NULL) + { + shell->priv->adblock_manager = g_object_new (EPHY_TYPE_ADBLOCK_MANAGER, NULL); + } + + return G_OBJECT (shell->priv->adblock_manager); +} + |