From f0fbbefd8192d3fce4023ebdbe67ac897d7fde17 Mon Sep 17 00:00:00 2001 From: Benjamin Berg Date: Fri, 2 Mar 2007 23:35:44 +0000 Subject: Move ephy-adblock.* to embed. Change the API to pass EphyEmbed to 2007-03-03 Benjamin Berg * 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 --- embed/mozilla/EphyContentPolicy.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'embed/mozilla') 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; -- cgit v1.2.3