aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorJean-François Rameau <jframeau@cvs.gnome.org>2006-01-16 05:05:31 +0800
committerJean-François Rameau <jframeau@src.gnome.org>2006-01-16 05:05:31 +0800
commit2097f11220e25f83dda2026d07cc66e7a0a31544 (patch)
treed63b242ce65ca7345fe56308f3ba54773d7181fa /embed
parenta5f030995805e069abfe185ffff438e9f28d5ee1 (diff)
downloadgsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar.gz
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar.bz2
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar.lz
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar.xz
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.tar.zst
gsoc2013-epiphany-2097f11220e25f83dda2026d07cc66e7a0a31544.zip
Add a method to EphyAdblock interface, ephy_adblock_manager_edit_rule, so
2006-01-15 Jean-François Rameau <jframeau@cvs.gnome.org> * lib/ephy-adblock.h: * lib/ephy-adblock.c: * embed/ephy-adblock-manager.h: * embed/ephy-adblock-manager.c: Add a method to EphyAdblock interface, ephy_adblock_manager_edit_rule, so one can allow/disallow an url. Add a method to EphyAdblockManager, ephy_adblock_manager_has_blocker, so one can ask it whether a blocker is running.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-adblock-manager.c34
-rw-r--r--embed/ephy-adblock-manager.h6
2 files changed, 40 insertions, 0 deletions
diff --git a/embed/ephy-adblock-manager.c b/embed/ephy-adblock-manager.c
index cb4e6dda5..a4ba57e25 100644
--- a/embed/ephy-adblock-manager.c
+++ b/embed/ephy-adblock-manager.c
@@ -98,4 +98,38 @@ ephy_adblock_manager_class_init (EphyAdBlockManagerClass *klass)
g_type_class_add_private (object_class, sizeof (EphyAdBlockManagerPrivate));
}
+/**
+ * ephy_adblock_manager_edit_rule:
+ * @shell: a #EphyAdBlockManager
+ * @url: the target url on which the rule is based
+ * @allowed: TRUE if the url has to be blocked.
+ *
+ * Ask to the blocker a new rule based on @url.
+ *
+ **/
+void
+ephy_adblock_manager_edit_rule (EphyAdBlockManager *self,
+ const char *url,
+ gboolean allowed)
+{
+ if (self->priv->blocker != NULL)
+ {
+ ephy_adblock_edit_rule (self->priv->blocker,
+ url,
+ allowed);
+ }
+}
+/**
+ * ephy_adblock_manager_has_blocker:
+ * @shell: a #EphyAdBlockManager
+ *
+ * Check if Epiphany has currently an active blocker
+ *
+ * ReturnValue: TRUE if an active blocker is running
+ **/
+gboolean
+ephy_adblock_manager_has_blocker (EphyAdBlockManager *self)
+{
+ return self->priv->blocker != NULL;
+}
diff --git a/embed/ephy-adblock-manager.h b/embed/ephy-adblock-manager.h
index a499ad810..021143a0a 100644
--- a/embed/ephy-adblock-manager.h
+++ b/embed/ephy-adblock-manager.h
@@ -59,6 +59,12 @@ gboolean ephy_adblock_manager_should_load (EphyAdBlockManager *self,
void ephy_adblock_manager_set_blocker (EphyAdBlockManager *self,
EphyAdBlock *blocker);
+void ephy_adblock_manager_edit_rule (EphyAdBlockManager *self,
+ const char *url,
+ gboolean allowed);
+
+gboolean ephy_adblock_manager_has_blocker (EphyAdBlockManager *self);
+
G_END_DECLS
#endif