aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2007-03-03 07:35:44 +0800
committerBenjamin Berg <bberg@src.gnome.org>2007-03-03 07:35:44 +0800
commitf0fbbefd8192d3fce4023ebdbe67ac897d7fde17 (patch)
tree396e5f918f9c1cc5828fd3a4cfe8149b4d45771d /embed/mozilla
parente6f2af1ed2c57cc3cce5df8f234a4c242c4aac82 (diff)
downloadgsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar.gz
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar.bz2
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar.lz
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar.xz
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.tar.zst
gsoc2013-epiphany-f0fbbefd8192d3fce4023ebdbe67ac897d7fde17.zip
Move ephy-adblock.* to embed. Change the API to pass EphyEmbed to
2007-03-03 Benjamin Berg <benjamin@sipsolutions.net> * embed/Makefile.am: * embed/ephy-adblock-manager.c: (ephy_adblock_manager_should_load): * embed/ephy-adblock-manager.h: * embed/ephy-adblock.c: (ephy_adblock_should_load): * embed/ephy-adblock.h: * embed/mozilla/EphyContentPolicy.cpp: * lib/Makefile.am: * lib/ephy-adblock.c: * lib/ephy-adblock.h: Move ephy-adblock.* to embed. Change the API to pass EphyEmbed to should_load. This is needed to fix bug #348331. svn path=/trunk/; revision=6931
Diffstat (limited to 'embed/mozilla')
-rw-r--r--embed/mozilla/EphyContentPolicy.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/embed/mozilla/EphyContentPolicy.cpp b/embed/mozilla/EphyContentPolicy.cpp
index 77a519154..7d55a6971 100644
--- a/embed/mozilla/EphyContentPolicy.cpp
+++ b/embed/mozilla/EphyContentPolicy.cpp
@@ -151,22 +151,23 @@ EphyContentPolicy::ShouldLoad(PRUint32 aContentType,
PR_TRUE /* TYPE_REFRESH */
};
- if (kBlockType[aContentType < G_N_ELEMENTS (kBlockType) ? aContentType : 0] &&
- !ephy_adblock_manager_should_load (adblock_manager,
- contentSpec.get (),
- AdUriCheckType (aContentType)))
+ if (kBlockType[aContentType < G_N_ELEMENTS (kBlockType) ? aContentType : 0])
{
- *aDecision = nsIContentPolicy::REJECT_REQUEST;
-
- GtkWidget *embed = GetEmbedFromContext (aContext);
+ GtkWidget *embed = GetEmbedFromContext (aContext);
- if (embed)
+ if (embed &&
+ !ephy_adblock_manager_should_load (adblock_manager,
+ EPHY_EMBED (embed),
+ contentSpec.get (),
+ AdUriCheckType (aContentType)))
{
+ *aDecision = nsIContentPolicy::REJECT_REQUEST;
+
g_signal_emit_by_name (embed,
"content-blocked",
contentSpec.get ());
+ return NS_OK;
}
- return NS_OK;
}
PRBool isHttp = PR_FALSE;