diff --git a/dom/commandhandler/nsICommandParams.idl b/dom/commandhandler/nsICommandParams.idl index 5b577a297a04..6e481c5cf8a9 100644 --- a/dom/commandhandler/nsICommandParams.idl +++ b/dom/commandhandler/nsICommandParams.idl @@ -91,9 +91,3 @@ interface nsICommandParams : nsISupports %} }; -// {f7fa4581-238e-11d5-a73c-ab64fb68f2bc} -%{C++ -#define NS_COMMAND_PARAMS_CID { 0xf7fa4581, 0x238e, 0x11d5, { 0xa7, 0x3c, 0xab, 0x64, 0xfb, 0x68, 0xf2, 0xbc } } -#define NS_COMMAND_PARAMS_CONTRACTID "@mozilla.org/embedcomp/command-params;1" -%} - diff --git a/js/xpconnect/idl/xpccomponents.idl b/js/xpconnect/idl/xpccomponents.idl index d141acdc6e50..dec5284da224 100644 --- a/js/xpconnect/idl/xpccomponents.idl +++ b/js/xpconnect/idl/xpccomponents.idl @@ -11,6 +11,7 @@ interface xpcIJSWeakReference; interface nsIClassInfo; +interface nsICommandParams; interface nsIComponentManager; interface nsICycleCollectorListener; interface nsIEditorSpellCheck; @@ -723,6 +724,9 @@ interface nsIXPCComponents_Utils : nsISupports /* Create a commandline object. */ nsISupports createCommandLine(); + + /* Create a command params object. */ + nsICommandParams createCommandParams(); }; /** diff --git a/js/xpconnect/src/XPCComponents.cpp b/js/xpconnect/src/XPCComponents.cpp index 64ffb4e4898c..6c1994dc563b 100644 --- a/js/xpconnect/src/XPCComponents.cpp +++ b/js/xpconnect/src/XPCComponents.cpp @@ -43,6 +43,7 @@ #include "GeckoProfiler.h" #include "mozilla/EditorSpellCheck.h" #include "nsCommandLine.h" +#include "nsCommandParams.h" using namespace mozilla; using namespace JS; @@ -3231,6 +3232,15 @@ nsXPCComponents_Utils::CreateCommandLine(nsISupports** aCommandLine) return NS_OK; } +NS_IMETHODIMP +nsXPCComponents_Utils::CreateCommandParams(nsICommandParams** aCommandParams) +{ + NS_ENSURE_ARG_POINTER(aCommandParams); + nsCOMPtr commandParams = new nsCommandParams(); + commandParams.forget(aCommandParams); + return NS_OK; +} + /***************************************************************************/ /***************************************************************************/ /***************************************************************************/ diff --git a/toolkit/actors/ControllersChild.jsm b/toolkit/actors/ControllersChild.jsm index 880139f45dc4..75965515bc65 100644 --- a/toolkit/actors/ControllersChild.jsm +++ b/toolkit/actors/ControllersChild.jsm @@ -19,8 +19,7 @@ class ControllersChild extends ActorChild { case "ControllerCommands:DoWithParams": var data = message.data; if (this.docShell.isCommandEnabled(data.cmd)) { - var params = Cc["@mozilla.org/embedcomp/command-params;1"]. - createInstance(Ci.nsICommandParams); + var params = Cu.createCommandParams(); for (var name in data.params) { var value = data.params[name]; if (value.type == "long") { diff --git a/toolkit/xre/nsEmbeddingModule.cpp b/toolkit/xre/nsEmbeddingModule.cpp index b6f2cb958696..1d07daaa836e 100644 --- a/toolkit/xre/nsEmbeddingModule.cpp +++ b/toolkit/xre/nsEmbeddingModule.cpp @@ -10,7 +10,6 @@ #include "nsFind.h" #include "nsWebBrowserFind.h" #include "nsWebBrowserPersist.h" -#include "nsCommandParams.h" #include "nsCommandGroup.h" #include "nsNetCID.h" #include "nsEmbedCID.h" @@ -26,7 +25,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsAppStartupNotifier) NS_GENERIC_FACTORY_CONSTRUCTOR(nsFind) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserFind) NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebBrowserPersist) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsCommandParams) NS_GENERIC_FACTORY_CONSTRUCTOR(nsControllerCommandGroup) #ifdef MOZ_XUL @@ -52,7 +50,6 @@ NS_DEFINE_NAMED_CID(NS_FIND_CID); NS_DEFINE_NAMED_CID(NS_WEB_BROWSER_FIND_CID); NS_DEFINE_NAMED_CID(NS_APPSTARTUPNOTIFIER_CID); NS_DEFINE_NAMED_CID(NS_WEBBROWSERPERSIST_CID); -NS_DEFINE_NAMED_CID(NS_COMMAND_PARAMS_CID); NS_DEFINE_NAMED_CID(NS_CONTROLLER_COMMAND_GROUP_CID); static const mozilla::Module::CIDEntry kEmbeddingCIDs[] = { @@ -75,7 +72,6 @@ static const mozilla::Module::CIDEntry kEmbeddingCIDs[] = { { &kNS_WEB_BROWSER_FIND_CID, false, nullptr, nsWebBrowserFindConstructor }, { &kNS_APPSTARTUPNOTIFIER_CID, false, nullptr, nsAppStartupNotifierConstructor }, { &kNS_WEBBROWSERPERSIST_CID, false, nullptr, nsWebBrowserPersistConstructor }, - { &kNS_COMMAND_PARAMS_CID, false, nullptr, nsCommandParamsConstructor }, { &kNS_CONTROLLER_COMMAND_GROUP_CID, false, nullptr, nsControllerCommandGroupConstructor }, { nullptr } }; @@ -92,7 +88,6 @@ static const mozilla::Module::ContractIDEntry kEmbeddingContracts[] = { { NS_WEB_BROWSER_FIND_CONTRACTID, &kNS_WEB_BROWSER_FIND_CID }, { NS_APPSTARTUPNOTIFIER_CONTRACTID, &kNS_APPSTARTUPNOTIFIER_CID }, { NS_WEBBROWSERPERSIST_CONTRACTID, &kNS_WEBBROWSERPERSIST_CID }, - { NS_COMMAND_PARAMS_CONTRACTID, &kNS_COMMAND_PARAMS_CID }, { NS_CONTROLLER_COMMAND_GROUP_CONTRACTID, &kNS_CONTROLLER_COMMAND_GROUP_CID }, { nullptr } };