aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/EphyContentPolicy.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-09-17 05:20:36 +0800
committerChristian Persch <chpe@src.gnome.org>2006-09-17 05:20:36 +0800
commitba8b944c562fc183de39bdec84f05e90f98df6e2 (patch)
tree5f8682559a663b14711bfb090b9ee3fb60768ae8 /embed/mozilla/EphyContentPolicy.cpp
parente278c85d5790580a97946d3551d99b6636fef992 (diff)
downloadgsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar.gz
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar.bz2
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar.lz
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar.xz
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.tar.zst
gsoc2013-epiphany-ba8b944c562fc183de39bdec84f05e90f98df6e2.zip
Remove ill-conceived attempt at uninstalling the XPInstall handler, and
2006-09-16 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/EphyContentPolicy.cpp: * embed/mozilla/EphyContentPolicy.h: * embed/mozilla/EphySidebar.cpp: * embed/mozilla/EphySidebar.h: * embed/mozilla/MozRegisterComponents.cpp: Remove ill-conceived attempt at uninstalling the XPInstall handler, and move category registration to the classes that are being registered.
Diffstat (limited to 'embed/mozilla/EphyContentPolicy.cpp')
-rw-r--r--embed/mozilla/EphyContentPolicy.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/embed/mozilla/EphyContentPolicy.cpp b/embed/mozilla/EphyContentPolicy.cpp
index 56be892fd..77a519154 100644
--- a/embed/mozilla/EphyContentPolicy.cpp
+++ b/embed/mozilla/EphyContentPolicy.cpp
@@ -25,12 +25,15 @@
#include <nsStringAPI.h>
#include <nsCOMPtr.h>
+#include <nsICategoryManager.h>
#include <nsIDOMAbstractView.h>
#include <nsIDOMDocument.h>
#include <nsIDOMDocumentView.h>
#include <nsIDOMNode.h>
#include <nsIDOMWindow.h>
#include <nsIURI.h>
+#include <nsServiceManagerUtils.h>
+#include <nsXPCOMCID.h>
#include "eel-gconf-extensions.h"
#include "ephy-adblock-manager.h"
@@ -197,3 +200,44 @@ EphyContentPolicy::ShouldProcess(PRUint32 aContentType,
*aDecision = nsIContentPolicy::ACCEPT;
return NS_OK;
}
+
+
+/* static */ NS_METHOD
+EphyContentPolicy::Register (nsIComponentManager* aComponentManager,
+ nsIFile* aPath,
+ const char* aRegistryLocation,
+ const char* aComponentType,
+ const nsModuleComponentInfo* aInfo)
+{
+ nsresult rv;
+ nsCOMPtr<nsICategoryManager> catMan (do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ rv = catMan->AddCategoryEntry ("content-policy",
+ EPHY_CONTENT_POLICY_CONTRACTID,
+ EPHY_CONTENT_POLICY_CONTRACTID,
+ PR_FALSE /* don't persist */,
+ PR_TRUE /* replace */,
+ nsnull);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ return rv;
+}
+
+/* static */ NS_METHOD
+EphyContentPolicy::Unregister (nsIComponentManager* aComponentManager,
+ nsIFile* aPath,
+ const char* aRegistryLocation,
+ const nsModuleComponentInfo* aInfo)
+{
+ nsresult rv;
+ nsCOMPtr<nsICategoryManager> catMan (do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv));
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ rv = catMan->DeleteCategoryEntry ("content-policy",
+ EPHY_CONTENT_POLICY_CONTRACTID,
+ PR_FALSE /* don't persist */);
+ NS_ENSURE_SUCCESS (rv, rv);
+
+ return rv;
+}