Remove nsIPluginManager/nsIPluginManager2. Fold their functionality into nsIPluginHost. b=499431 r/sr=jst
authorJosh Aas <joshmoz@gmail.com>
Thu, 25 Jun 2009 17:06:54 -0400
changeset 29574 f5f2c8fe6387cd49effbfbc37f16157f7a461559
parent 29573 868bcf93bce0402a1825b5c6b22e553ec6591a72
child 29575 7b9ea30c88a05998a8fc3da01344d6cd68f74da1
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs499431
milestone1.9.2a1pre
Remove nsIPluginManager/nsIPluginManager2. Fold their functionality into nsIPluginHost. b=499431 r/sr=jst
content/base/src/nsObjectLoadingContent.cpp
docshell/base/nsWebNavigationInfo.cpp
dom/base/nsDOMClassInfo.cpp
dom/base/nsPluginArray.cpp
layout/build/nsContentDLF.cpp
layout/generic/nsObjectFrame.cpp
modules/plugin/base/public/Makefile.in
modules/plugin/base/public/nsIHTTPHeaderListener.idl
modules/plugin/base/public/nsIPluginHost.idl
modules/plugin/base/public/nsIPluginInstance.idl
modules/plugin/base/public/nsIPluginManager.idl
modules/plugin/base/public/nsIPluginManager2.idl
modules/plugin/base/public/nsPluginsCID.h
modules/plugin/base/public/nsplugin.h
modules/plugin/base/public/nsplugindefs.h
modules/plugin/base/public/nspluginroot.idl
modules/plugin/base/src/nsNPAPIPlugin.cpp
modules/plugin/base/src/nsNPAPIPluginInstance.cpp
modules/plugin/base/src/nsPluginHostImpl.cpp
modules/plugin/base/src/nsPluginHostImpl.h
modules/plugin/base/src/nsPluginModule.cpp
toolkit/mozapps/plugins/content/pluginInstallerWizard.js
uriloader/exthandler/nsExternalHelperAppService.cpp
--- a/content/base/src/nsObjectLoadingContent.cpp
+++ b/content/base/src/nsObjectLoadingContent.cpp
@@ -80,18 +80,16 @@
 #include "nsStyleUtil.h"
 
 // Concrete classes
 #include "nsFrameLoader.h"
 
 #include "nsObjectLoadingContent.h"
 #include "mozAutoDocUpdate.h"
 
-static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
-
 #ifdef PR_LOGGING
 static PRLogModuleInfo* gObjectLog = PR_NewLogModule("objlc");
 #endif
 
 #define LOG(args) PR_LOG(gObjectLog, PR_LOG_DEBUG, args)
 #define LOG_ENABLED() PR_LOG_TEST(gObjectLog, PR_LOG_DEBUG)
 
 class nsAsyncInstantiateEvent : public nsRunnable {
@@ -296,17 +294,17 @@ IsSupportedImage(const nsCString& aMimeT
   PRBool supported;
   nsresult rv = loader->SupportImageWithMimeType(aMimeType.get(), &supported);
   return NS_SUCCEEDED(rv) && supported;
 }
 
 static PRBool
 IsSupportedPlugin(const nsCString& aMIMEType)
 {
-  nsCOMPtr<nsIPluginHost> host(do_GetService("@mozilla.org/plugin/host;1"));
+  nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
   if (!host) {
     return PR_FALSE;
   }
   nsresult rv = host->IsPluginEnabledForType(aMIMEType.get());
   return NS_SUCCEEDED(rv);
 }
 
 static void
@@ -334,17 +332,17 @@ static PRBool
 IsPluginEnabledByExtension(nsIURI* uri, nsCString& mimeType)
 {
   nsCAutoString ext;
   GetExtensionFromURI(uri, ext);
 
   if (ext.IsEmpty())
     return PR_FALSE;
 
-  nsCOMPtr<nsIPluginHost> host(do_GetService("@mozilla.org/plugin/host;1"));
+  nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
   const char* typeFromExt;
   if (host &&
       NS_SUCCEEDED(host->IsPluginEnabledForExtension(ext.get(), typeFromExt))) {
     mimeType = typeFromExt;
     return PR_TRUE;
   }
   return PR_FALSE;
 }
@@ -1579,17 +1577,17 @@ nsObjectLoadingContent::GetTypeOfContent
   return eType_Null;
 }
 
 nsresult
 nsObjectLoadingContent::TypeForClassID(const nsAString& aClassID,
                                        nsACString& aType)
 {
   // Need a plugin host for any class id support
-  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(kCPluginManagerCID));
+  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
   if (!pluginHost) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   if (StringBeginsWith(aClassID, NS_LITERAL_STRING("java:"))) {
     // Supported if we have a java plugin
     aType.AssignLiteral("application/x-java-vm");
     nsresult rv = pluginHost->IsPluginEnabledForType("application/x-java-vm");
@@ -1829,17 +1827,17 @@ nsObjectLoadingContent::GetPluginSupport
 
   return hasAlternateContent ? ePluginOtherState :
     GetPluginDisabledState(aContentType);
 }
 
 /* static */ PluginSupportState
 nsObjectLoadingContent::GetPluginDisabledState(const nsCString& aContentType)
 {
-  nsCOMPtr<nsIPluginHost> host(do_GetService("@mozilla.org/plugin/host;1"));
+  nsCOMPtr<nsIPluginHost> host(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
   if (!host) {
     return ePluginUnsupported;
   }
   nsresult rv = host->IsPluginEnabledForType(aContentType.get());
   if (rv == NS_ERROR_PLUGIN_DISABLED)
     return ePluginDisabled;
   if (rv == NS_ERROR_PLUGIN_BLOCKLISTED)
     return ePluginBlocklisted;
--- a/docshell/base/nsWebNavigationInfo.cpp
+++ b/docshell/base/nsWebNavigationInfo.cpp
@@ -35,17 +35,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsWebNavigationInfo.h"
 #include "nsIWebNavigation.h"
 #include "nsString.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIDocumentLoaderFactory.h"
-#include "nsIPluginManager.h"
+#include "nsIPluginHost.h"
 
 NS_IMPL_ISUPPORTS1(nsWebNavigationInfo, nsIWebNavigationInfo)
 
 #define CONTENT_DLF_CONTRACT "@mozilla.org/content/document-loader-factory;1"
 #define PLUGIN_DLF_CONTRACT \
     "@mozilla.org/content/plugin/document-loader-factory;1"
 
 nsresult
@@ -79,22 +79,22 @@ nsWebNavigationInfo::IsTypeSupported(con
   nsresult rv = IsTypeSupportedInternal(flatType, aIsTypeSupported);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (*aIsTypeSupported) {
     return rv;
   }
   
   // Try reloading plugins in case they've changed.
-  nsCOMPtr<nsIPluginManager> pluginManager =
-    do_GetService("@mozilla.org/plugin/manager;1");
-  if (pluginManager) {
+  nsCOMPtr<nsIPluginHost> pluginHost =
+    do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
+  if (pluginHost) {
     // PR_FALSE will ensure that currently running plugins will not
     // be shut down
-    rv = pluginManager->ReloadPlugins(PR_FALSE);
+    rv = pluginHost->ReloadPlugins(PR_FALSE);
     if (NS_SUCCEEDED(rv)) {
       // OK, we reloaded plugins and there were new ones
       // (otherwise NS_ERROR_PLUGINS_PLUGINSNOTCHANGED would have
       // been returned).  Try checking whether we can handle the
       // content now.
       return IsTypeSupportedInternal(flatType, aIsTypeSupported);
     }
   }
--- a/dom/base/nsDOMClassInfo.cpp
+++ b/dom/base/nsDOMClassInfo.cpp
@@ -455,17 +455,16 @@
 #include "nsDOMFile.h"
 #include "nsIDOMFileException.h"
 
 // Simple gestures include
 #include "nsIDOMSimpleGestureEvent.h"
 
 #include "nsIDOMNSMouseEvent.h"
 
-static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
 static NS_DEFINE_CID(kDOMSOF_CID, NS_DOM_SCRIPT_OBJECT_FACTORY_CID);
 
 static const char kDOMStringBundleURL[] =
   "chrome://global/locale/dom/dom.properties";
 
 // NOTE: DEFAULT_SCRIPTABLE_FLAGS and DOM_DEFAULT_SCRIPTABLE_FLAGS
 //       are defined in nsIDOMClassInfo.h.
 
@@ -9705,27 +9704,23 @@ nsHTMLPluginObjElementSH::NewResolve(nsI
       iim(do_GetService(NS_INTERFACEINFOMANAGER_SERVICE_CONTRACTID));
     NS_ENSURE_TRUE(iim, NS_ERROR_UNEXPECTED);
 
     nsIID* iid = nsnull;
 
     nsresult rv = iim->GetIIDForName(cstring, &iid);
 
     if (NS_SUCCEEDED(rv) && iid) {
-      // Notify the PluginManager that this one is scriptable -- it
+      // Notify the PluginHost that this one is scriptable -- it
       // will need some special treatment later
 
-      nsCOMPtr<nsIPluginHost> pluginManager =
-        do_GetService(kCPluginManagerCID);
-
-      nsCOMPtr<nsPIPluginHost> pluginHost(do_QueryInterface(pluginManager));
-
-      if (pluginHost) {
-        pluginHost->SetIsScriptableInstance(pi, PR_TRUE);
-      }
+      nsCOMPtr<nsIPluginHost> pluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
+      nsCOMPtr<nsPIPluginHost> piPluginHost(do_QueryInterface(pluginHost));
+      if (piPluginHost)
+        piPluginHost->SetIsScriptableInstance(pi, PR_TRUE);
 
       nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
       rv = sXPConnect->WrapNative(cx, obj, pi, *iid, getter_AddRefs(holder));
 
       if (NS_SUCCEEDED(rv)) {
         JSObject* ifaceObj;
 
         rv = holder->GetJSObject(&ifaceObj);
--- a/dom/base/nsPluginArray.cpp
+++ b/dom/base/nsPluginArray.cpp
@@ -44,24 +44,22 @@
 #include "nsIDOMMimeType.h"
 #include "nsIPluginHost.h"
 #include "nsIDocShell.h"
 #include "nsIWebNavigation.h"
 #include "nsDOMClassInfo.h"
 #include "nsPluginError.h"
 #include "nsContentUtils.h"
 
-static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
-
 nsPluginArray::nsPluginArray(nsNavigator* navigator,
                              nsIDocShell *aDocShell)
 {
   nsresult rv;
   mNavigator = navigator; // don't ADDREF here, needed for parent of script object.
-  mPluginHost = do_GetService(kPluginManagerCID, &rv);
+  mPluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv);
   mPluginCount = 0;
   mPluginArray = nsnull;
   mDocShell = aDocShell;
 }
 
 nsPluginArray::~nsPluginArray()
 {
   if (mPluginArray != nsnull) {
@@ -170,17 +168,17 @@ nsPluginArray::NamedItem(const nsAString
 nsresult
 nsPluginArray::GetPluginHost(nsIPluginHost** aPluginHost)
 {
   NS_ENSURE_ARG_POINTER(aPluginHost);
 
   nsresult rv = NS_OK;
 
   if (!mPluginHost) {
-    mPluginHost = do_GetService(kPluginManagerCID, &rv);
+    mPluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv);
 
     if (NS_FAILED(rv)) {
       return rv;
     }
   }
 
   *aPluginHost = mPluginHost;
   NS_IF_ADDREF(*aPluginHost);
@@ -197,30 +195,28 @@ nsPluginArray::SetDocShell(nsIDocShell* 
 NS_IMETHODIMP
 nsPluginArray::Refresh(PRBool aReloadDocuments)
 {
   nsresult res = NS_OK;
   if (!AllowPlugins())
     return NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA;
 
   if (!mPluginHost) {
-    mPluginHost = do_GetService(kPluginManagerCID, &res);
+    mPluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &res);
   }
 
   if(NS_FAILED(res)) {
     return res;
   }
 
-  nsCOMPtr<nsIPluginManager> pm(do_QueryInterface(mPluginHost));
-
   // NS_ERROR_PLUGINS_PLUGINSNOTCHANGED on reloading plugins indicates
   // that plugins did not change and was not reloaded
   PRBool pluginsNotChanged = PR_FALSE;
-  if(pm)
-    pluginsNotChanged = (NS_ERROR_PLUGINS_PLUGINSNOTCHANGED == pm->ReloadPlugins(aReloadDocuments));
+  if(mPluginHost)
+    pluginsNotChanged = (NS_ERROR_PLUGINS_PLUGINSNOTCHANGED == mPluginHost->ReloadPlugins(aReloadDocuments));
 
   // no need to reload the page if plugins have not been changed
   // in fact, if we do reload we can hit recursive load problem, see bug 93351
   if(pluginsNotChanged)
     return res;
 
   nsCOMPtr<nsIWebNavigation> webNav = do_QueryInterface(mDocShell);
 
--- a/layout/build/nsContentDLF.cpp
+++ b/layout/build/nsContentDLF.cpp
@@ -59,19 +59,17 @@
 #ifdef MOZ_MEDIA
 #include "nsHTMLMediaElement.h"
 #endif
 
 #include "imgILoader.h"
 #include "nsIParser.h"
 
 // plugins
-#include "nsIPluginManager.h"
 #include "nsIPluginHost.h"
-static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
 static NS_DEFINE_CID(kPluginDocumentCID, NS_PLUGINDOCUMENT_CID);
 
 // Factory code for creating variations on html documents
 
 #undef NOISY_REGISTRY
 
 static NS_DEFINE_IID(kHTMLDocumentCID, NS_HTMLDOCUMENT_CID);
 static NS_DEFINE_IID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
@@ -286,17 +284,17 @@ nsContentDLF::CreateInstance(const char*
   // Try image types
   if (IsImageContentType(aContentType)) {
     return CreateDocument(aCommand, 
                           aChannel, aLoadGroup,
                           aContainer, kImageDocumentCID,
                           aDocListener, aDocViewer);
   }
 
-  nsCOMPtr<nsIPluginHost> ph (do_GetService(kPluginManagerCID));
+  nsCOMPtr<nsIPluginHost> ph (do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
   if(ph && NS_SUCCEEDED(ph->IsPluginEnabledForType(aContentType))) {
     return CreateDocument(aCommand,
                           aChannel, aLoadGroup,
                           aContainer, kPluginDocumentCID,
                           aDocListener, aDocViewer);
   }
 
   // If we get here, then we weren't able to create anything. Sorry!
@@ -610,9 +608,8 @@ nsContentDLF::UnregisterDocumentFactorie
 }
 
 PRBool nsContentDLF::IsImageContentType(const char* aContentType) {
   nsCOMPtr<imgILoader> loader(do_GetService("@mozilla.org/image/loader;1"));
   PRBool isDecoderAvailable = PR_FALSE;
   loader->SupportImageWithMimeType(aContentType, &isDecoderAvailable);
   return isDecoderAvailable;
 }
-
--- a/layout/generic/nsObjectFrame.cpp
+++ b/layout/generic/nsObjectFrame.cpp
@@ -580,17 +580,16 @@ NS_IMETHODIMP nsObjectFrame::GetPluginPo
   *aPort = (HWND) mInstanceOwner->GetPluginPort();
   return NS_OK;
 }
 #endif
 #endif
 
 
 static NS_DEFINE_CID(kWidgetCID, NS_CHILD_CID);
-static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
 
 // #define DO_DIRTY_INTERSECT 1   // enable dirty rect intersection during paint
 
 NS_IMETHODIMP 
 nsObjectFrame::Init(nsIContent*      aContent,
                     nsIFrame*        aParent,
                     nsIFrame*        aPrevInFlow)
 {
@@ -1722,17 +1721,17 @@ nsObjectFrame::Instantiate(nsIChannel* a
     return NS_OK;
   }
   
   // Note: If PrepareInstanceOwner() returns an error, |this| may very
   // well be deleted already.
   nsresult rv = PrepareInstanceOwner();
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(kCPluginManagerCID, &rv));
+  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
   mInstanceOwner->SetPluginHost(pluginHost);
 
   // This must be done before instantiating the plugin
   FixupWindow(mRect.Size());
 
   nsWeakFrame weakFrame(this);
@@ -1771,17 +1770,17 @@ nsObjectFrame::Instantiate(const char* a
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsWeakFrame weakFrame(this);
 
   // This must be done before instantiating the plugin
   FixupWindow(mRect.Size());
 
   // get the nsIPluginHost service
-  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(kCPluginManagerCID, &rv));
+  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
   mInstanceOwner->SetPluginHost(pluginHost);
 
   NS_ASSERTION(!mPreventInstantiation, "Say what?");
   mPreventInstantiation = PR_TRUE;
 
   rv = InstantiatePlugin(pluginHost, aMimeType, aURI);
@@ -1934,17 +1933,17 @@ DoStopPlugin(nsPluginInstanceOwner *aIns
         inst->SetWindow(nsnull);
 
       if (DoDelayedStop(aInstanceOwner, aDelayedStop))
         return;
 
       inst->Stop();
     }
 
-    nsCOMPtr<nsIPluginHost> pluginHost = do_GetService(kCPluginManagerCID);
+    nsCOMPtr<nsIPluginHost> pluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
     if (pluginHost)
       pluginHost->StopPluginInstance(inst);
 
     // the frame is going away along with its widget so tell the
     // window to forget its widget too
     if (window)
       window->SetPluginWidget(nsnull);
   }
@@ -2180,17 +2179,17 @@ nsresult nsPluginDOMContextMenuListener:
 }
 
 //plugin instance owner
 
 nsPluginInstanceOwner::nsPluginInstanceOwner()
 {
   // create nsPluginNativeWindow object, it is derived from nsPluginWindow
   // struct and allows to manipulate native window procedure
-  nsCOMPtr<nsIPluginHost> ph = do_GetService(kCPluginManagerCID);
+  nsCOMPtr<nsIPluginHost> ph = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
   nsCOMPtr<nsPIPluginHost> pph(do_QueryInterface(ph));
   if (pph)
     pph->NewPluginNativeWindow(&mPluginWindow);
   else
     mPluginWindow = nsnull;
 
   mOwner = nsnull;
   mTagText = nsnull;
@@ -2251,17 +2250,17 @@ nsPluginInstanceOwner::~nsPluginInstance
   }
 
   if (mTagText) {
     NS_Free(mTagText);
     mTagText = nsnull;
   }
 
   // clean up plugin native window object
-  nsCOMPtr<nsIPluginHost> ph = do_GetService(kCPluginManagerCID);
+  nsCOMPtr<nsIPluginHost> ph = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
   nsCOMPtr<nsPIPluginHost> pph(do_QueryInterface(ph));
   if (pph) {
     pph->DeletePluginNativeWindow(mPluginWindow);
     mPluginWindow = nsnull;
   }
 
   if (mInstance) {
     nsCOMPtr<nsIPluginInstancePeer> peer;
--- a/modules/plugin/base/public/Makefile.in
+++ b/modules/plugin/base/public/Makefile.in
@@ -61,18 +61,16 @@ SDK_HEADERS	 = \
 		npfunctions.h \
 		nptypes.h \
 		npruntime.h \
 		$(NULL)
 
 XPIDLSRCS 	= \
 		nspluginroot.idl \
 		nsIPluginStreamInfo.idl \
-		nsIPluginManager.idl \
-		nsIPluginManager2.idl \
 		nsIPluginInstancePeer.idl \
 		nsIPluginInstancePeer2.idl \
 		nsIPluginInstanceOwner.idl \
 		nsIPlugin.idl \
 		nsIHTTPHeaderListener.idl \
 		nsIWindowlessPlugInstPeer.idl \
 		nsIPluginTag.idl \
 		nsIPluginTagInfo.idl \
--- a/modules/plugin/base/public/nsIHTTPHeaderListener.idl
+++ b/modules/plugin/base/public/nsIHTTPHeaderListener.idl
@@ -36,17 +36,17 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsISupports.idl"
 
 /**
  * The nsIHTTPHeaderListener interface allows plugin authors to
  * access HTTP Response headers after issuing an
- * nsIPluginManager::{GetURL,PostURL}() call. <P>
+ * nsIPluginHost::{GetURL,PostURL}() call. <P>
 
  * IMPORTANT NOTE: The plugin author must provide an instance to
  * {GetURL,PostURL}() that implements both nsIPluginStreamListener and
  * nsIHTTPHeaderListener.  This instance is passed in through
  * {GetURL,PostURL}()'s streamListener parameter.  The browser will then
  * QI thi streamListener to see if it implements
  * nsIHTTPHeaderListener.
  */
--- a/modules/plugin/base/public/nsIPluginHost.idl
+++ b/modules/plugin/base/public/nsIPluginHost.idl
@@ -44,35 +44,47 @@
 
 %{C++
 #include "nsplugindefs.h"
 #ifdef MOZILLA_INTERNAL_API
 #include "nsString.h"
 #include "nsNetUtil.h"
 #endif
 #include "prlink.h"  // for PRLibrary
+
+#define MOZ_PLUGIN_HOST_CONTRACTID \
+  "@mozilla.org/plugin/host;1"
 %}
 
 interface nsIPlugin;
 interface nsIURI;
 interface nsIDOMPlugin;
 interface nsIChannel;
 
 [ptr] native PRLibraryPtr(PRLibrary);
 [ref] native nsIStreamListenerRef(nsIStreamListener *);
 
-[scriptable, uuid(2af1c32d-38dd-4f72-b0ab-24697d836e61)]
+[scriptable, uuid(A2D6DC70-7456-4422-A9F6-D96F46868C0B)]
 interface nsIPluginHost : nsIFactory
 {
   [noscript] void init();
 
   [noscript] void destroy();
 
   [noscript] void loadPlugins();
-  
+
+  /**
+   * Causes the plugins directory to be searched again for new plugin 
+   * libraries.
+   *
+   * @param reloadPages - indicates whether currently visible pages should 
+   * also be reloaded
+   */
+  void reloadPlugins(in boolean reloadPages);
+
   [noscript] nsIPlugin getPluginFactory(in string aMimeType);
 
   [noscript] void instantiateEmbeddedPlugin(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner);
 
   [noscript] void instantiateFullPagePlugin(in string aMimeType, in nsIURI aURI, in nsIStreamListenerRef aStreamListener, in nsIPluginInstanceOwner aOwner);
 
   /**
    * Instantiate an embedded plugin for an existing channel. The caller is
@@ -97,16 +109,112 @@ interface nsIPluginHost : nsIFactory
   [noscript] void getPlugins(in unsigned long aPluginCount, out /*array*/ nsIDOMPlugin aPluginArray);
 
   void getPluginTags(out unsigned long aPluginCount,
     [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults);
 
   [noscript] void stopPluginInstance(in nsIPluginInstance aInstance);
 
   [noscript] void handleBadPlugin(in PRLibraryPtr aLibrary, in nsIPluginInstance instance);
+  
+  /**
+   * Fetches a URL.
+   *
+   * (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
+   *
+   * @param pluginInst - the plugin making the request. If NULL, the URL
+   *  is fetched in the background.
+   * @param url - the URL to fetch
+   * @param target - the target window into which to load the URL, or NULL if
+   *  the data should be returned to the plugin via streamListener.
+   * @param streamListener - a stream listener to be used to return data to
+   *  the plugin. May be NULL if target is not NULL.
+   * @param altHost - an IP-address string that will be used instead of the 
+   *  host specified in the URL. This is used to prevent DNS-spoofing 
+   *  attacks. Can be defaulted to NULL meaning use the host in the URL.
+   * @param referrer - the referring URL (may be NULL)
+   * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
+   *  URLs, even if the user currently has JavaScript disabled (usually 
+   *  specify PR_FALSE) 
+   * @result - NS_OK if this operation was successful
+   */
+%{C++
+  NS_IMETHOD
+  GetURL(nsISupports* pluginInst,
+     const char* url,
+     const char* target = NULL,
+     nsIPluginStreamListener* streamListener = NULL,
+     const char* altHost = NULL,
+     const char* referrer = NULL,
+     PRBool forceJSEnabled = PR_FALSE) = 0;
+%}
+
+  /**
+   * Posts to a URL with post data and/or post headers.
+   *
+   * (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
+   *
+   * @param pluginInst - the plugin making the request. If NULL, the URL
+   *  is fetched in the background.
+   * @param url - the URL to fetch
+   * @param postDataLength - the length of postData (if non-NULL)
+   * @param postData - the data to POST. NULL specifies that there is not post
+   *  data
+   * @param isFile - whether the postData specifies the name of a file to 
+   *  post instead of data. The file will be deleted afterwards.
+   * @param target - the target window into which to load the URL, or NULL if
+   *  the data should be returned to the plugin via streamListener.
+   * @param streamListener - a stream listener to be used to return data to
+   *  the plugin. May be NULL if target is not NULL.
+   * @param altHost - an IP-address string that will be used instead of the 
+   *  host specified in the URL. This is used to prevent DNS-spoofing 
+   *  attacks. Can be defaulted to NULL meaning use the host in the URL.
+   * @param referrer - the referring URL (may be NULL)
+   * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
+   *  URLs, even if the user currently has JavaScript disabled (usually 
+   *  specify PR_FALSE) 
+   * @param postHeadersLength - the length of postHeaders (if non-NULL)
+   * @param postHeaders - the headers to POST. Must be in the form of
+   * "HeaderName: HeaderValue\r\n".  Each header, including the last,
+   * must be followed by "\r\n".  NULL specifies that there are no
+   * post headers
+   * @result - NS_OK if this operation was successful
+   */
+%{C++
+  NS_IMETHOD
+  PostURL(nsISupports* pluginInst,
+    const char* url,
+    PRUint32 postDataLen,
+    const char* postData,
+    PRBool isFile = PR_FALSE,
+    const char* target = NULL,
+    nsIPluginStreamListener* streamListener = NULL,
+    const char* altHost = NULL,
+    const char* referrer = NULL,
+    PRBool forceJSEnabled = PR_FALSE,
+    PRUint32 postHeadersLength = 0,
+    const char* postHeaders = NULL) = 0;
+%}
+
+  /**
+   * Returns the proxy info for a given URL. The caller is required to
+   * free the resulting memory with nsIMalloc::Free. The result will be in the
+   * following format
+   * 
+   *   i)   "DIRECT"  -- no proxy
+   *   ii)  "PROXY xxx.xxx.xxx.xxx"   -- use proxy
+   *   iii) "SOCKS xxx.xxx.xxx.xxx"  -- use SOCKS
+   *   iv)  Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112",
+   *                    "PROXY 111.111.111.111;SOCKS 112.112.112.112"....
+   *
+   * Which proxy/SOCKS to use is determined by the plugin.
+   */
+  void findProxyForURL(in string aURL, out string aResult);
+   
+  [noscript] void UserAgent(in nativeChar resultingAgentString);
 };
 
 %{C++
 #ifdef MOZILLA_INTERNAL_API
 /**
  * Used for creating the correct input stream for plugins
  * We can either have raw data (with or without \r\n\r\n) or a path to a file (but it must be native!)
  * When making an nsIInputStream stream for the plugins POST data, be sure to take into 
@@ -138,30 +246,29 @@ NS_NewPluginPostDataStream(nsIInputStrea
         return NS_ERROR_OUT_OF_MEMORY;
       memcpy(buf, data, contentLength);
     }
     nsCOMPtr<nsIStringInputStream> sis = do_CreateInstance("@mozilla.org/io/string-input-stream;1",&rv);
     if (NS_SUCCEEDED(rv)) {
       sis->AdoptData(buf, contentLength);  // let the string stream manage our data
       rv = CallQueryInterface(sis, result);
     }
-    else if (headers)
+    else if (headers) {
       nsMemory::Free(buf); // Cleanup the memory if the data was copied.
+    }
   } else {
     nsCOMPtr<nsILocalFile> file; // tmp file will be deleted on release of stream
     nsCOMPtr<nsIInputStream> fileStream;
     if (NS_SUCCEEDED(rv = NS_NewNativeLocalFile(nsDependentCString(data), PR_FALSE, getter_AddRefs(file))) &&
         NS_SUCCEEDED(rv = NS_NewLocalFileInputStream(getter_AddRefs(fileStream),
-                                     file,
-                                     PR_RDONLY,
-                                     0600,
-                                     nsIFileInputStream::DELETE_ON_CLOSE |
-                                     nsIFileInputStream::CLOSE_ON_EOF))
-                                     ) 
-    {
+                                                     file,
+                                                     PR_RDONLY,
+                                                     0600,
+                                                     nsIFileInputStream::DELETE_ON_CLOSE |
+                                                     nsIFileInputStream::CLOSE_ON_EOF))) {
       // wrap the file stream with a buffered input stream
       return NS_NewBufferedInputStream(result, fileStream, 8192);
     }
   }
   return rv;
 }
 #endif
 %}
--- a/modules/plugin/base/public/nsIPluginInstance.idl
+++ b/modules/plugin/base/public/nsIPluginInstance.idl
@@ -153,19 +153,17 @@ interface nsIPluginInstance : nsISupport
      *
      * @param aVariable - the plugin instance variable to get
      * @param aValue    - the address of where to store the resulting value
      * @result          - NS_OK if this operation was successful
      */
     void getValue(in nsPluginInstanceVariable aVariable, in voidPtr aValue);
 
     /**
-     * Handles an event. An nsIEventHandler can also get registered with with
-     * nsIPluginManager2::RegisterWindow and will be called whenever an event
-     * comes in for that window.
+     * Handles an event.
      *
      * Note that for Unix and Mac the nsPluginEvent structure is different
      * from the old NPEvent structure -- it's no longer the native event
      * record, but is instead a struct. This was done for future extensibility,
      * and so that the Mac could receive the window argument too. For Windows
      * and OS2, it's always been a struct, so there's no change for them.
      *
      * (Corresponds to NPP_HandleEvent.)
deleted file mode 100644
--- a/modules/plugin/base/public/nsIPluginManager.idl
+++ /dev/null
@@ -1,247 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * nsIPluginManager
- *
- * @status DEPRECATED
- *
- * Originally published XPCOM Plugin API is now deprecated
- * Developers are welcome to use NPAPI, please refer to:
- * http://mozilla.org/projects/plugins/
- */
-
-#include "nsISupports.idl"
-#include "nspluginroot.idl"
-
-%{C++
-#include "nsplugindefs.h"
-%}
-
-// CLSID for the browser's global plugin manager object.
-%{C++
-#define NS_PLUGINMANAGER_CID                         \
-{ /* ce768990-5a4e-11d2-8164-006008119d7a */         \
-    0xce768990,                                      \
-    0x5a4e,                                          \
-    0x11d2,                                          \
-    {0x81, 0x64, 0x00, 0x60, 0x08, 0x11, 0x9d, 0x7a} \
-}
-%}
-
-interface nsIPluginStreamListener;
-
-[scriptable, uuid(da58ad80-4eb6-11d2-8164-006008119d7a)]
-
-/*
- * The nsIPluginManager interface defines the minimum set of functionality that
- * the browser will support if it allows plugins. Plugins can call QueryInterface
- * to determine if a plugin manager implements more specific APIs or other 
- * browser interfaces for the plugin to use (e.g. nsINetworkManager).
- */
-
-interface nsIPluginManager : nsISupports
-{
-    /**
-     * Returns the value of a variable associated with the plugin manager.
-     *
-     * (Corresponds to NPN_GetValue.)
-     *
-     * @param variable - the plugin manager variable to get
-     * @param value - the address of where to store the resulting value
-     * @result - NS_OK if this operation was successful
-     */
-   [noscript] void GetValue(in nsPluginManagerVariable variable, in nativeVoid value);
-
-    /**
-     * Causes the plugins directory to be searched again for new plugin 
-     * libraries.
-     *
-     * (Corresponds to NPN_ReloadPlugins.)
-     *
-     * @param reloadPages - indicates whether currently visible pages should 
-     * also be reloaded
-     */
-    void reloadPlugins(in boolean reloadPages);
-
-    /**
-     * Returns the user agent string for the browser. 
-     *
-     * (Corresponds to NPN_UserAgent.)
-     *
-     * @param resultingAgentString - the resulting user agent string
-     */
-     [noscript] void UserAgent(in nativeChar resultingAgentString);
-
-    /**
-     * Fetches a URL.
-     *
-     * (Corresponds to NPN_GetURL and NPN_GetURLNotify.)
-     *
-     * @param pluginInst - the plugin making the request. If NULL, the URL
-     *   is fetched in the background.
-     * @param url - the URL to fetch
-     * @param target - the target window into which to load the URL, or NULL if
-     *   the data should be returned to the plugin via streamListener.
-     * @param streamListener - a stream listener to be used to return data to
-     *   the plugin. May be NULL if target is not NULL.
-     * @param altHost - an IP-address string that will be used instead of the 
-     *   host specified in the URL. This is used to prevent DNS-spoofing 
-     *   attacks. Can be defaulted to NULL meaning use the host in the URL.
-     * @param referrer - the referring URL (may be NULL)
-     * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
-     *   URLs, even if the user currently has JavaScript disabled (usually 
-     *   specify PR_FALSE) 
-     * @result - NS_OK if this operation was successful
-     */
-%{C++
-    NS_IMETHOD
-    GetURL(nsISupports* pluginInst,
-           const char* url,
-           const char* target = NULL,
-           nsIPluginStreamListener* streamListener = NULL,
-           const char* altHost = NULL,
-           const char* referrer = NULL,
-           PRBool forceJSEnabled = PR_FALSE) = 0;
-%}
-
-    /**
-     * Posts to a URL with post data and/or post headers.
-     *
-     * (Corresponds to NPN_PostURL and NPN_PostURLNotify.)
-     *
-     * @param pluginInst - the plugin making the request. If NULL, the URL
-     *   is fetched in the background.
-     * @param url - the URL to fetch
-     * @param postDataLength - the length of postData (if non-NULL)
-     * @param postData - the data to POST. NULL specifies that there is not post
-     *   data
-     * @param isFile - whether the postData specifies the name of a file to 
-     *   post instead of data. The file will be deleted afterwards.
-     * @param target - the target window into which to load the URL, or NULL if
-     *   the data should be returned to the plugin via streamListener.
-     * @param streamListener - a stream listener to be used to return data to
-     *   the plugin. May be NULL if target is not NULL.
-     * @param altHost - an IP-address string that will be used instead of the 
-     *   host specified in the URL. This is used to prevent DNS-spoofing 
-     *   attacks. Can be defaulted to NULL meaning use the host in the URL.
-     * @param referrer - the referring URL (may be NULL)
-     * @param forceJSEnabled - forces JavaScript to be enabled for 'javascript:'
-     *   URLs, even if the user currently has JavaScript disabled (usually 
-     *   specify PR_FALSE) 
-     * @param postHeadersLength - the length of postHeaders (if non-NULL)
-     * @param postHeaders - the headers to POST. Must be in the form of
-     * "HeaderName: HeaderValue\r\n".  Each header, including the last,
-     * must be followed by "\r\n".  NULL specifies that there are no
-     * post headers
-     * @result - NS_OK if this operation was successful
-     */
-%{C++
-    NS_IMETHOD
-    PostURL(nsISupports* pluginInst,
-            const char* url,
-            PRUint32 postDataLen,
-            const char* postData,
-            PRBool isFile = PR_FALSE,
-            const char* target = NULL,
-            nsIPluginStreamListener* streamListener = NULL,
-            const char* altHost = NULL,
-            const char* referrer = NULL,
-            PRBool forceJSEnabled = PR_FALSE,
-            PRUint32 postHeadersLength = 0,
-            const char* postHeaders = NULL) = 0;
-%}
-
-    /**
-     * Persistently register a plugin with the plugin
-     * manager. aMimeTypes, aMimeDescriptions, and aFileExtensions are
-     * parallel arrays that contain information about the MIME types
-     * that the plugin supports.
-     *
-     * @param aCID - the plugin's CID
-     * @param aPluginName - the plugin's name
-     * @param aDescription - a description of the plugin
-     * @param aMimeTypes - an array of MIME types that the plugin
-     *   is prepared to handle
-     * @param aMimeDescriptions - an array of descriptions for the
-     *   MIME types that the plugin can handle.
-     * @param aFileExtensions - an array of file extensions for
-     *   the MIME types that the plugin can handle.
-     * @param aCount - the number of elements in the aMimeTypes,
-     *   aMimeDescriptions, and aFileExtensions arrays.
-     * @result - NS_OK if the operation was successful.
-     */
-     [noscript] void RegisterPlugin(in REFNSIID    aCID,
-			            in string      aPluginName,
-			            in string      aDescription,
-			            in nativeChar  aMimeTypes,
-			            in nativeChar  aMimeDescriptions, 
-			            in nativeChar  aFileExtensions,
-			            in  long       aCount);
-
-    /**
-     * Unregister a plugin from the plugin manager
-     *
-     * @param aCID the CID of the plugin to unregister.
-     * @result - NS_OK if the operation was successful.
-     */
-     [noscript] void UnregisterPlugin(in REFNSIID aCID);
-
-%{C++
-    /**
-     * Fetches a URL, with Headers
-     * @see GetURL.  Identical except for additional params headers and
-     * headersLen
-     * @param getHeadersLength - the length of getHeaders (if non-NULL)
-     * @param getHeaders - the headers to GET. Must be in the form of
-     * "HeaderName: HeaderValue\r\n".  Each header, including the last,
-     * must be followed by "\r\n".  NULL specifies that there are no
-     * get headers
-     * @result - NS_OK if this operation was successful
-     */
-    NS_IMETHOD
-    GetURLWithHeaders(nsISupports* pluginInst,
-                      const char* url,
-                      const char* target = NULL,
-                      nsIPluginStreamListener* streamListener = NULL,
-                      const char* altHost = NULL,
-                      const char* referrer = NULL,
-                      PRBool forceJSEnabled = PR_FALSE,
-                      PRUint32 getHeadersLength = 0,
-                      const char* getHeaders = NULL) = 0;
-%}
-};
deleted file mode 100644
--- a/modules/plugin/base/public/nsIPluginManager2.idl
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is mozilla.org code.
- *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsIPluginManager.idl"
-
-interface nsIPlugin;
-
-native nsPluginPlatformWindowRef(nsPluginPlatformWindowRef);
-
-/**
- * Plugin Manager 2 Interface
- * These extensions to nsIPluginManager are only available in Communicator 5.0.
- */
-[uuid(C7706E95-2FD6-4701-992D-FA9D7787667B)]
-interface nsIPluginManager2 : nsIPluginManager
-{
-  /**
-   * Puts up a wait cursor.
-   *
-   * @result - NS_OK if this operation was successful
-   */
-  void beginWaitCursor();
-
-  /**
-   * Restores the previous (non-wait) cursor.
-   *
-   * @result - NS_OK if this operation was successful
-   */
-  void endWaitCursor();
-
-  /**
-   * Returns true if a URL protocol (e.g. "http") is supported.
-   *
-   * @param aProtocol - the protocol name
-   * @param aResult   - true if the protocol is supported
-   * @result          - NS_OK if this operation was successful
-   */
-  void supportsURLProtocol(in string aProtocol, out boolean aResult);
-
-  /**
-   * This method may be called by the plugin to indicate that an error 
-   * has occurred, e.g. that the plugin has failed or is shutting down 
-   * spontaneously. This allows the browser to clean up any plugin-specific 
-   * state.
-   *
-   * @param aPlugin - the plugin whose status is changing
-   * @param aStatus - the error status value
-   * @result        - NS_OK if this operation was successful
-   */
-  void notifyStatusChange(in nsIPlugin aPlugin, in nsresult aStatus);
-  
-  /**
-   * Returns the proxy info for a given URL. The caller is required to
-   * free the resulting memory with nsIMalloc::Free. The result will be in the
-   * following format
-   * 
-   *   i)   "DIRECT"  -- no proxy
-   *   ii)  "PROXY xxx.xxx.xxx.xxx"   -- use proxy
-   *   iii) "SOCKS xxx.xxx.xxx.xxx"  -- use SOCKS
-   *   iv)  Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112",
-   *                    "PROXY 111.111.111.111;SOCKS 112.112.112.112"....
-   *
-   * Which proxy/SOCKS to use is determined by the plugin.
-   */
-   void findProxyForURL(in string aURL, out string aResult);
-};
--- a/modules/plugin/base/public/nsPluginsCID.h
+++ b/modules/plugin/base/public/nsPluginsCID.h
@@ -30,20 +30,16 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef nsPluginsCID_h__
-#define nsPluginsCID_h__
-
-#include "nsISupports.h"
-#include "nsIFactory.h"
-#include "nsIComponentManager.h"
+#ifndef nsPluginsCID_h_
+#define nsPluginsCID_h_
 
 #define NS_PLUGIN_HOST_CID \
-{ 0xadea1880, 0x1a8e, 0x11d2, \
-{ 0xa8, 0x2e, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } }
+{ 0xA2D6DC70, 0x7456, 0x4422, \
+{ 0xA9, 0xF6, 0xD9, 0x6F, 0x46, 0x86, 0x8C, 0x0B } }
 
-#endif // nsPluginsCID_h__
+#endif // nsPluginsCID_h_
--- a/modules/plugin/base/public/nsplugin.h
+++ b/modules/plugin/base/public/nsplugin.h
@@ -109,22 +109,16 @@
 ////////////////////////////////////////////////////////////////////////////////
 /**
  * <B>Interfaces implemented by the browser:
  * These interfaces have NPN equivalents in pre-5.0 browsers (see npapi.h).
  */
 ////////////////////////////////////////////////////////////////////////////////
 
 /**
- * The plugin manager which is the main point of interaction with the browser 
- * and provides general operations needed by a plugin.
- */
-#include "nsIPluginManager.h"
-
-/**
  * A plugin instance peer gets created by the browser and associated with each
  * plugin instance to represent tag information and other callbacks needed by
  * the plugin instance.
  */
 #include "nsIPluginInstancePeer.h"
 
 /**
  * The nsIPluginTagInfo interface provides information about the html tag
@@ -144,24 +138,16 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 /**
  * <B>Interfaces implemented by the browser (new for 5.0):
  */
 ////////////////////////////////////////////////////////////////////////////////
 
 /**
- * The nsIPluginManager2 interface provides additional plugin manager features
- * only available in Communicator 5.0. 
- *
- * To obtain: QueryInterface on nsIPluginManager
- */
-#include "nsIPluginManager2.h"
-
-/**
  * The nsIPluginTagInfo2 interface provides additional html tag information
  * only available in Communicator 5.0. 
  *
  * To obtain: QueryInterface on nsIPluginTagInfo
  */
 #include "nsIPluginTagInfo2.h"
 
 #include "nsIOutputStream.h"
--- a/modules/plugin/base/public/nsplugindefs.h
+++ b/modules/plugin/base/public/nsplugindefs.h
@@ -393,17 +393,16 @@ enum nsPluginReason {
 // Classes
 ////////////////////////////////////////////////////////////////////////////////
 
 // Classes that must be implemented by the plugin DLL:
 class nsIPlugin;                        // plugin class (MIME-type handler)
 class nsIPluginInstance;                // plugin instance
 
 // Classes that are implemented by the browser:
-class nsIPluginManager;                 // minimum browser requirements
 class nsIPluginInstancePeer;            // parts of nsIPluginInstance implemented by the browser
 class nsIWindowlessPluginInstancePeer;  // subclass of nsIPluginInstancePeer for windowless plugins
 class nsIPluginTagInfo;                 // describes html tag (accessible from nsIPluginInstancePeer)
 ////////////////////////////////////////////////////////////////////////////////
 
 #endif /* RC_INVOKED */
 #ifdef __OS2__
 #pragma pack()
--- a/modules/plugin/base/public/nspluginroot.idl
+++ b/modules/plugin/base/public/nspluginroot.idl
@@ -50,17 +50,16 @@ native nsPluginStreamType(nsPluginStream
 native nsMIMEType(nsMIMEType);
 native nsPluginWindow(nsPluginWindow);
 [ptr] native nsPluginWindowPtr(nsPluginWindow);
 [ref] native nsPluginWindowStarRef(nsPluginWindow *);
 [ptr] native nsPluginPrintPtr(nsPluginPrint);
 native nsByteRange(nsByteRange);
 [ptr] native nsByteRangePtr(nsByteRange);
 [ptr] native nsPluginEventPtr(nsPluginEvent);
-native nsPluginManagerVariable(nsPluginManagerVariable);
 native nsPluginVariable(nsPluginVariable);
 native nsPluginInstanceVariable(nsPluginInstanceVariable);
 native nsPluginInstancePeerVariable(nsPluginInstancePeerVariable);
 [ptr] native nsPluginRectPtr(nsPluginRect);
 native nsPluginRegion(nsPluginRegion);
 
 [ptr] native JRIEnvPtr(JRIEnv);
 native jref(jref);
--- a/modules/plugin/base/src/nsNPAPIPlugin.cpp
+++ b/modules/plugin/base/src/nsNPAPIPlugin.cpp
@@ -93,18 +93,16 @@ static PRLock *sPluginThreadAsyncCallLoc
 static PRCList sPendingAsyncCalls = PR_INIT_STATIC_CLIST(&sPendingAsyncCalls);
 
 // POST/GET stream type
 enum eNPPStreamTypeInternal {
   eNPPStreamTypeInternal_Get,
   eNPPStreamTypeInternal_Post
 };
 
-static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
-static NS_DEFINE_IID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
 static NS_DEFINE_IID(kMemoryCID, NS_MEMORY_CID);
 
 // Static stub functions that are exported to the 4.x plugin as entry
 // points via the CALLBACKS variable.
 PR_BEGIN_EXTERN_C
 
   static NPError NP_CALLBACK
   _requestread(NPStream *pstream, NPByteRange *rangeList);
@@ -688,36 +686,36 @@ MakeNewNPAPIStreamInternal(NPP npp, cons
   PluginDestructionGuard guard(npp);
 
   nsIPluginInstance *inst = (nsIPluginInstance *) npp->ndata;
 
   NS_ASSERTION(inst, "null instance");
   if (!inst)
     return NPERR_INVALID_INSTANCE_ERROR;
 
-  nsCOMPtr<nsIPluginManager> pm = do_GetService(kPluginManagerCID);
-  NS_ASSERTION(pm, "failed to get plugin manager");
-  if (!pm) return NPERR_GENERIC_ERROR;
+  nsCOMPtr<nsIPluginHost> pluginHost = do_GetService(MOZ_PLUGIN_HOST_CONTRACTID);
+  NS_ASSERTION(pluginHost, "failed to get plugin host");
+  if (!pluginHost) return NPERR_GENERIC_ERROR;
 
   nsCOMPtr<nsIPluginStreamListener> listener;
   if (!target)
     ((nsNPAPIPluginInstance*)inst)->NewNotifyStream(getter_AddRefs(listener),
                                                     notifyData,
                                                     bDoNotify, relativeURL);
 
   switch (type) {
   case eNPPStreamTypeInternal_Get:
     {
-      if (NS_FAILED(pm->GetURL(inst, relativeURL, target, listener)))
+      if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   case eNPPStreamTypeInternal_Post:
     {
-      if (NS_FAILED(pm->PostURL(inst, relativeURL, len, buf, file, target,
+      if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target,
                                 listener)))
         return NPERR_GENERIC_ERROR;
       break;
     }
   default:
     NS_ASSERTION(0, "how'd I get here");
   }
 
@@ -1039,21 +1037,21 @@ void NP_CALLBACK
 {
   if (!NS_IsMainThread()) {
     NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_reloadplugins called from the wrong thread\n"));
     return;
   }
   NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL,
                  ("NPN_ReloadPlugins: reloadPages=%d\n", reloadPages));
 
-  nsCOMPtr<nsIPluginManager> pm(do_GetService(kPluginManagerCID));
-  if (!pm)
+  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
+  if (!pluginHost)
     return;
 
-  pm->ReloadPlugins(reloadPages);
+  pluginHost->ReloadPlugins(reloadPages);
 }
 
 void NP_CALLBACK
 _invalidaterect(NPP npp, NPRect *invalidRect)
 {
   if (!NS_IsMainThread()) {
     NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_invalidaterect called from the wrong thread\n"));
     return;
@@ -2245,22 +2243,22 @@ const char * NP_CALLBACK
 _useragent(NPP npp)
 {
   if (!NS_IsMainThread()) {
     NPN_PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("NPN_useragent called from the wrong thread\n"));
     return nsnull;
   }
   NPN_PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("NPN_UserAgent: npp=%p\n", (void*)npp));
 
-  nsCOMPtr<nsIPluginManager> pm(do_GetService(kPluginManagerCID));
-  if (!pm)
+  nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
+  if (!pluginHost)
     return nsnull;
 
   const char *retstr;
-  nsresult rv = pm->UserAgent(&retstr);
+  nsresult rv = pluginHost->UserAgent(&retstr);
   if (NS_FAILED(rv))
     return nsnull;
 
   return retstr;
 }
 
 void * NP_CALLBACK
 _memalloc (uint32_t size)
@@ -2421,19 +2419,19 @@ NPError NP_CALLBACK
     return NPERR_INVALID_URL;
   }
 
   *len = 0;
 
   switch (variable) {
   case NPNURLVProxy:
     {
-      nsCOMPtr<nsIPluginManager2> pm(do_GetService(kPluginManagerCID));
-
-      if (pm && NS_SUCCEEDED(pm->FindProxyForURL(url, value))) {
+      nsCOMPtr<nsIPluginHost> pluginHost(do_GetService(MOZ_PLUGIN_HOST_CONTRACTID));
+
+      if (pluginHost && NS_SUCCEEDED(pluginHost->FindProxyForURL(url, value))) {
         *len = *value ? PL_strlen(*value) : 0;
         return NPERR_NO_ERROR;
       }
       break;
     }
   case NPNURLVCookie:
     {
       nsCOMPtr<nsICookieService> cookieService =
--- a/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
+++ b/modules/plugin/base/src/nsNPAPIPluginInstance.cpp
@@ -50,17 +50,16 @@
 #include "nsPluginLogging.h"
 #include "nsIPrivateBrowsingService.h"
 
 #include "nsPIPluginInstancePeer.h"
 #include "nsIDocument.h"
 
 #include "nsJSNPRuntime.h"
 
-static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); // needed for NS_TRY_SAFE_CALL
 static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
 
 // nsNPAPIPluginStreamListener Methods
 
 NS_IMPL_ISUPPORTS3(nsNPAPIPluginStreamListener, nsIPluginStreamListener,
                    nsITimerCallback, nsIHTTPHeaderListener)
 
 nsNPAPIPluginStreamListener::nsNPAPIPluginStreamListener(nsNPAPIPluginInstance* inst, 
--- a/modules/plugin/base/src/nsPluginHostImpl.cpp
+++ b/modules/plugin/base/src/nsPluginHostImpl.cpp
@@ -190,18 +190,16 @@ static const char *kPluginRegistryVersio
 // The minimum registry version we know how to read
 static const char *kMinimumRegistryVersion = "0.9";
 
 // CID's && IID's
 static NS_DEFINE_IID(kIPluginInstanceIID, NS_IPLUGININSTANCE_IID);
 static NS_DEFINE_CID(kPluginCID, NS_PLUGIN_CID);
 static NS_DEFINE_IID(kIPluginTagInfo2IID, NS_IPLUGINTAGINFO2_IID);
 static const char kDirectoryServiceContractID[] = "@mozilla.org/file/directory_service;1";
-// for the dialog
-static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); // needed for NS_TRY_SAFE_CALL
 
 // Registry keys for caching plugin info
 static const char kPluginsRootKey[] = "software/plugins";
 static const char kPluginsNameKey[] = "name";
 static const char kPluginsDescKey[] = "description";
 static const char kPluginsFilenameKey[] = "filename";
 static const char kPluginsFullpathKey[] = "fullpath";
 static const char kPluginsModTimeKey[] = "lastModTimeStamp";
@@ -2507,19 +2505,17 @@ nsPluginHostImpl::nsPluginHostImpl()
 nsPluginHostImpl::~nsPluginHostImpl()
 {
   PLUGIN_LOG(PLUGIN_LOG_ALWAYS,("nsPluginHostImpl::dtor\n"));
 
   Destroy();
   sInst = nsnull;
 }
 
-NS_IMPL_ISUPPORTS6(nsPluginHostImpl,
-                   nsIPluginManager,
-                   nsIPluginManager2,
+NS_IMPL_ISUPPORTS4(nsPluginHostImpl,
                    nsIPluginHost,
                    nsIObserver,
                    nsPIPluginHost,
                    nsISupportsWeakReference)
 
 nsPluginHostImpl*
 nsPluginHostImpl::GetInst()
 {
@@ -2548,42 +2544,16 @@ nsPluginHostImpl::GetPluginName(nsIPlugi
     gActivePluginList ? gActivePluginList->find(aPluginInstance) : nsnull;
 
   if (plugin && plugin->mPluginTag)
     return plugin->mPluginTag->mName.get();
 
   return nsnull;
 }
 
-NS_IMETHODIMP nsPluginHostImpl::GetValue(nsPluginManagerVariable aVariable, void *aValue)
-{
-  nsresult rv = NS_OK;
-
-  NS_ENSURE_ARG_POINTER(aValue);
-
-#if defined(XP_UNIX) && !defined(XP_MACOSX) && defined(MOZ_X11)
-  if (nsPluginManagerVariable_XDisplay == aVariable) {
-    Display** value = reinterpret_cast<Display**>(aValue);
-#if defined (MOZ_WIDGET_GTK2)
-    *value = GDK_DISPLAY();
-#endif
-    if (!(*value))
-      return NS_ERROR_FAILURE;
-  }
-#endif
-  if (nsPluginManagerVariable_SupportsXEmbed == aVariable) {
-#ifdef MOZ_WIDGET_GTK2
-    *(NPBool*)aValue = PR_TRUE;
-#else
-    *(NPBool*)aValue = PR_FALSE;
-#endif
-  }
-  return rv;
-}
-
 PRBool nsPluginHostImpl::IsRunningPlugin(nsPluginTag * plugin)
 {
   if (!plugin)
     return PR_FALSE;
 
   // we can check for mLibrary to be non-zero and then querry nsIPluginInstancePeer
   // in nsPluginInstanceTagList to see if plugin with matching mime type is not stopped
   if (!plugin->mLibrary)
@@ -2762,17 +2732,17 @@ NS_IMETHODIMP nsPluginHostImpl::GetURL(n
                      const char* altHost,
                      const char* referrer,
                      PRBool forceJSEnabled)
 {
   return GetURLWithHeaders(pluginInst, url, target, streamListener,
                            altHost, referrer, forceJSEnabled, nsnull, nsnull);
 }
 
-NS_IMETHODIMP nsPluginHostImpl::GetURLWithHeaders(nsISupports* pluginInst,
+nsresult nsPluginHostImpl::GetURLWithHeaders(nsISupports* pluginInst,
                      const char* url,
                      const char* target,
                      nsIPluginStreamListener* streamListener,
                      const char* altHost,
                      const char* referrer,
                      PRBool forceJSEnabled,
                      PRUint32 getHeadersLength,
                      const char* getHeaders)
@@ -2898,53 +2868,16 @@ NS_IMETHODIMP nsPluginHostImpl::PostURL(
                               postHeaders, postHeadersLength);
     if (isFile)
       NS_Free(dataToPost);
   }
 
   return rv;
 }
 
-NS_IMETHODIMP nsPluginHostImpl::RegisterPlugin(REFNSIID aCID,
-                                               const char* aPluginName,
-                                               const char* aDescription,
-                                               const char** aMimeTypes,
-                                               const char** aMimeDescriptions,
-                                               const char** aFileExtensions,
-                                               PRInt32 aCount)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsPluginHostImpl::UnregisterPlugin(REFNSIID aCID)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsPluginHostImpl::BeginWaitCursor(void)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsPluginHostImpl::EndWaitCursor(void)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsPluginHostImpl::SupportsURLProtocol(const char* protocol, PRBool *result)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP nsPluginHostImpl::NotifyStatusChange(nsIPlugin* plugin, nsresult errorStatus)
-{
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-
 /* This method queries the prefs for proxy information.
  * It has been tested and is known to work in the following three cases
  * when no proxy host or port is specified
  * when only the proxy host is specified
  * when only the proxy port is specified
  * This method conforms to the return code specified in
  * http://developer.netscape.com/docs/manuals/proxy/adminnt/autoconf.htm#1020923
  * with the exception that multiple values are not implemented.
@@ -3613,17 +3546,17 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPlu
 
     // other failure return codes may be not fatal, so we can still try
     rv = TrySetUpPluginInstance(aMimeType, aURL, aOwner);
   }
 
   return rv;
 }
 
-NS_IMETHODIMP
+nsresult
 nsPluginHostImpl::TrySetUpPluginInstance(const char *aMimeType,
                                          nsIURI *aURL,
                                          nsIPluginInstanceOwner *aOwner)
 {
 #ifdef PLUGIN_LOGGING
   nsCAutoString urlSpec;
   if (aURL != nsnull) (void)aURL->GetSpec(urlSpec);
 
@@ -5255,25 +5188,24 @@ nsPluginHostImpl::EnsurePrivateDirServic
     rv = dirService->RegisterProvider(mPrivateDirServiceProvider);
     if (NS_FAILED(rv))
       return rv;
   }
   return NS_OK;
 }
 #endif /* XP_WIN */
 
-// Called by GetURL and PostURL
-NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
-                                                   nsIPluginInstance *aInstance,
-                                                   nsIPluginStreamListener* aListener,
-                                                   const char *aPostData,
-                                                   PRBool aIsFile,
-                                                   PRUint32 aPostDataLen,
-                                                   const char *aHeadersData,
-                                                   PRUint32 aHeadersDataLen)
+nsresult nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
+                                              nsIPluginInstance *aInstance,
+                                              nsIPluginStreamListener* aListener,
+                                              const char *aPostData,
+                                              PRBool aIsFile,
+                                              PRUint32 aPostDataLen,
+                                              const char *aHeadersData,
+                                              PRUint32 aHeadersDataLen)
 {
   nsCOMPtr<nsIURI> url;
   nsAutoString absUrl;
   nsresult rv;
 
   if (aURL.Length() <= 0)
     return NS_OK;
 
@@ -5440,17 +5372,17 @@ nsPluginHostImpl::DoURLLoadSecurityCheck
   if (NS_FAILED(rv))
     return rv;
 
   return secMan->CheckLoadURIWithPrincipal(doc->NodePrincipal(), targetURL,
                                            nsIScriptSecurityManager::STANDARD);
 
 }
 
-NS_IMETHODIMP
+nsresult
 nsPluginHostImpl::AddHeadersToChannel(const char *aHeadersData,
                                       PRUint32 aHeadersDataLen,
                                       nsIChannel *aGenericChannel)
 {
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIHttpChannel> aChannel = do_QueryInterface(aGenericChannel);
   if (!aChannel) {
--- a/modules/plugin/base/src/nsPluginHostImpl.h
+++ b/modules/plugin/base/src/nsPluginHostImpl.h
@@ -33,18 +33,16 @@
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsPluginHostImpl_h_
 #define nsPluginHostImpl_h_
 
-#include "nsIPluginManager.h"
-#include "nsIPluginManager2.h"
 #include "nsIPluginHost.h"
 #include "nsIObserver.h"
 #include "nsPIPluginHost.h"
 #include "nsCRT.h"
 #include "nsCOMPtr.h"
 #include "prlink.h"
 #include "prclist.h"
 #include "npapi.h"
@@ -209,134 +207,105 @@ public:
   nsPluginInstanceTag *findStopped(const char *url);
   PRUint32 getStoppedCount();
   nsPluginInstanceTag *findOldestStopped();
   void removeAllStopped();
   void stopRunning(nsISupportsArray *aReloadDocs, nsPluginTag *aPluginTag);
   PRBool IsLastInstance(nsPluginInstanceTag *plugin);
 };
 
-class nsPluginHostImpl : public nsIPluginManager2,
-                         public nsIPluginHost,
+class nsPluginHostImpl : public nsIPluginHost,
                          public nsIObserver,
                          public nsPIPluginHost,
                          public nsSupportsWeakReference
 {
 public:
   nsPluginHostImpl();
   virtual ~nsPluginHostImpl();
 
   static nsPluginHostImpl* GetInst();
+  static const char *GetPluginName(nsIPluginInstance *aPluginInstance);
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   NS_DECL_ISUPPORTS
-
-  static const char *GetPluginName(nsIPluginInstance *aPluginInstance);
-
-  //nsIPluginManager interface - the main interface nsIPlugin communicates to
-
-  NS_IMETHOD
-  GetValue(nsPluginManagerVariable variable, void *value);
-
-  NS_IMETHOD
-  ReloadPlugins(PRBool reloadPages);
-
-  NS_IMETHOD
-  UserAgent(const char* *resultingAgentString);
+  NS_DECL_NSIPLUGINHOST
+  NS_DECL_NSIFACTORY
+  NS_DECL_NSIOBSERVER
+  NS_DECL_NSPIPLUGINHOST
 
   NS_IMETHOD
   GetURL(nsISupports* pluginInst, 
            const char* url, 
            const char* target = NULL,
            nsIPluginStreamListener* streamListener = NULL,
            const char* altHost = NULL,
            const char* referrer = NULL,
            PRBool forceJSEnabled = PR_FALSE);
-
-  NS_IMETHOD
-  GetURLWithHeaders(nsISupports* pluginInst, 
-                    const char* url, 
-                    const char* target = NULL,
-                    nsIPluginStreamListener* streamListener = NULL,
-                    const char* altHost = NULL,
-                    const char* referrer = NULL,
-                    PRBool forceJSEnabled = PR_FALSE,
-                    PRUint32 getHeadersLength = 0, 
-                    const char* getHeaders = NULL);
   
   NS_IMETHOD
   PostURL(nsISupports* pluginInst,
             const char* url,
             PRUint32 postDataLen, 
             const char* postData,
             PRBool isFile = PR_FALSE,
             const char* target = NULL,
             nsIPluginStreamListener* streamListener = NULL,
             const char* altHost = NULL, 
             const char* referrer = NULL,
             PRBool forceJSEnabled = PR_FALSE,
             PRUint32 postHeadersLength = 0, 
             const char* postHeaders = NULL);
 
-  NS_IMETHOD
-  RegisterPlugin(REFNSIID aCID,
-                 const char* aPluginName,
-                 const char* aDescription,
-                 const char** aMimeTypes,
-                 const char** aMimeDescriptions,
-                 const char** aFileExtensions,
-                 PRInt32 aCount);
-
-  NS_IMETHOD
-  UnregisterPlugin(REFNSIID aCID);
-
-  NS_DECL_NSIPLUGINHOST
-  NS_DECL_NSIPLUGINMANAGER2
-  NS_DECL_NSIFACTORY
-  NS_DECL_NSIOBSERVER
-  NS_DECL_NSPIPLUGINHOST
-
-  /* Called by GetURL and PostURL */
-
-  NS_IMETHOD
+  nsresult
   NewPluginURLStream(const nsString& aURL, 
                      nsIPluginInstance *aInstance, 
                      nsIPluginStreamListener *aListener,
                      const char *aPostData = nsnull, 
                      PRBool isFile = PR_FALSE,
                      PRUint32 aPostDataLen = 0, 
                      const char *aHeadersData = nsnull, 
                      PRUint32 aHeadersDataLen = 0);
 
   nsresult
+  GetURLWithHeaders(nsISupports* pluginInst, 
+                    const char* url, 
+                    const char* target = NULL,
+                    nsIPluginStreamListener* streamListener = NULL,
+                    const char* altHost = NULL,
+                    const char* referrer = NULL,
+                    PRBool forceJSEnabled = PR_FALSE,
+                    PRUint32 getHeadersLength = 0, 
+                    const char* getHeaders = NULL);
+
+  nsresult
   DoURLLoadSecurityCheck(nsIPluginInstance *aInstance,
                          const char* aURL);
 
-  NS_IMETHOD
+  nsresult
   AddHeadersToChannel(const char *aHeadersData, PRUint32 aHeadersDataLen, 
                       nsIChannel *aGenericChannel);
 
-  NS_IMETHOD
+  nsresult
   AddUnusedLibrary(PRLibrary * aLibrary);
 
   static nsresult GetPluginTempDir(nsIFile **aDir);
 
   // Writes updated plugins settings to disk and unloads the plugin
   // if it is now disabled
   nsresult UpdatePluginInfo(nsPluginTag* aPluginTag);
 
   // checks whether aTag is a "java" plugin tag (a tag for a plugin
   // that does Java)
   static PRBool IsJavaMIMEType(const char *aType);
 
   static nsresult GetPrompt(nsIPluginInstanceOwner *aOwner, nsIPrompt **aPrompt);
 
 private:
-  NS_IMETHOD
+  nsresult
   TrySetUpPluginInstance(const char *aMimeType, nsIURI *aURL, nsIPluginInstanceOwner *aOwner);
 
   nsresult
   NewEmbeddedPluginStreamListener(nsIURI* aURL, nsIPluginInstanceOwner *aOwner,
                                   nsIPluginInstance* aInstance,
                                   nsIStreamListener** aListener);
 
   nsresult
--- a/modules/plugin/base/src/nsPluginModule.cpp
+++ b/modules/plugin/base/src/nsPluginModule.cpp
@@ -32,29 +32,23 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIGenericFactory.h"
-#include "nsIPluginManager.h"
+#include "nsPluginHostImpl.h"
 #include "nsPluginsCID.h"
-#include "nsPluginHostImpl.h"
 
 NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPluginHostImpl,
                                          nsPluginHostImpl::GetInst)
 
 static const nsModuleComponentInfo gComponentInfo[] = {
   { "Plugin Host",
     NS_PLUGIN_HOST_CID,
-    "@mozilla.org/plugin/host;1",
+    MOZ_PLUGIN_HOST_CONTRACTID,
     nsPluginHostImplConstructor
   },
-  { "Plugin Manager",
-    NS_PLUGINMANAGER_CID,
-    "@mozilla.org/plugin/manager;1",
-    nsPluginHostImplConstructor
-  }
 };
 
 NS_IMPL_NSGETMODULE(nsPluginModule, gComponentInfo)
--- a/toolkit/mozapps/plugins/content/pluginInstallerWizard.js
+++ b/toolkit/mozapps/plugins/content/pluginInstallerWizard.js
@@ -671,19 +671,19 @@ function wizardFinish(){
   }
 
   // don't refresh if no plugins were found or installed
   if ((gPluginInstaller.mSuccessfullPluginInstallation > 0) &&
       (gPluginInstaller.mPluginInfoArray.length != 0)) {
 
     // reload plugins so JS detection works immediately
     try {
-      var pm = Components.classes["@mozilla.org/plugin/manager;1"]
-                         .getService(Components.interfaces.nsIPluginManager);
-      pm.reloadPlugins(false);
+      var ph = Components.classes["@mozilla.org/plugin/host;1"]
+                         .getService(Components.interfaces.nsIPluginHost);
+      ph.reloadPlugins(false);
     }
     catch (e) {
       // reloadPlugins throws an exception if there were no plugins to load
     }
 
     if (gPluginInstaller.mBrowser) {
       // notify listeners that a plugin is installed,
       // so that they can reset the UI and update the browser.
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -149,18 +149,16 @@ PRLogModuleInfo* nsExternalHelperAppServ
 // Using 3 instead of PR_LOG_WARN because we don't output warnings
 #define LOG(args) PR_LOG(mLog, 3, args)
 #define LOG_ENABLED() PR_LOG_TEST(mLog, 3)
 
 static const char NEVER_ASK_PREF_BRANCH[] = "browser.helperApps.neverAsk.";
 static const char NEVER_ASK_FOR_SAVE_TO_DISK_PREF[] = "saveToDisk";
 static const char NEVER_ASK_FOR_OPEN_FILE_PREF[]    = "openFile";
 
-static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID);
-
 /**
  * Contains a pointer to the helper app service, set in its constructor
  */
 nsExternalHelperAppService* gExtProtSvc;
 
 // Helper functions for Content-Disposition headers
 
 /**
@@ -2558,20 +2556,19 @@ NS_IMETHODIMP nsExternalHelperAppService
   // Check extras array.
   found = GetTypeFromExtras(aFileExt, aContentType);
   if (found)
     return NS_OK;
 
   const nsCString& flatExt = PromiseFlatCString(aFileExt);
   // Try the plugins
   const char* mimeType;
-  nsCOMPtr<nsIPluginHost> pluginHost (do_GetService(kPluginManagerCID, &rv));
+  nsCOMPtr<nsIPluginHost> pluginHost (do_GetService(MOZ_PLUGIN_HOST_CONTRACTID, &rv));
   if (NS_SUCCEEDED(rv)) {
-    if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForExtension(flatExt.get(), mimeType)))
-    {
+    if (NS_SUCCEEDED(pluginHost->IsPluginEnabledForExtension(flatExt.get(), mimeType))) {
       aContentType = mimeType;
       return NS_OK;
     }
   }
   
   rv = NS_OK;
   // Let's see if an extension added something
   nsCOMPtr<nsICategoryManager> catMan(do_GetService("@mozilla.org/categorymanager;1"));