mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1489790 - Part 8: Remove the XPCOM component registration for @mozilla.org/editor/editorcontroller;1; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5363
This commit is contained in:
parent
c9bfa076d5
commit
65f44ebf27
@ -202,6 +202,27 @@ nsBaseCommandController::CreateWindowController()
|
||||
return controller.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIController>
|
||||
nsBaseCommandController::CreateEditorController()
|
||||
{
|
||||
nsCOMPtr<nsIController> controller = new nsBaseCommandController();
|
||||
|
||||
nsCOMPtr<nsIControllerCommandTable> editorCommandTable =
|
||||
nsControllerCommandTable::CreateEditorCommandTable();
|
||||
|
||||
// this guy is a singleton, so make it immutable
|
||||
editorCommandTable->MakeImmutable();
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv);
|
||||
if (NS_FAILED(rv)) return nullptr;
|
||||
|
||||
rv = controllerContext->Init(editorCommandTable);
|
||||
if (NS_FAILED(rv)) return nullptr;
|
||||
|
||||
return controller.forget();
|
||||
}
|
||||
|
||||
already_AddRefed<nsIController>
|
||||
nsBaseCommandController::CreateEditingController()
|
||||
{
|
||||
|
@ -31,6 +31,7 @@ public:
|
||||
NS_DECL_NSIINTERFACEREQUESTOR
|
||||
|
||||
static already_AddRefed<nsIController> CreateWindowController();
|
||||
static already_AddRefed<nsIController> CreateEditorController();
|
||||
static already_AddRefed<nsIController> CreateEditingController();
|
||||
|
||||
protected:
|
||||
|
@ -5805,11 +5805,10 @@ HTMLInputElement::GetControllers(ErrorResult& aRv)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIController>
|
||||
controller(do_CreateInstance("@mozilla.org/editor/editorcontroller;1",
|
||||
&rv));
|
||||
if (NS_FAILED(rv)) {
|
||||
aRv.Throw(rv);
|
||||
nsCOMPtr<nsIController> controller =
|
||||
nsBaseCommandController::CreateEditorController();
|
||||
if (!controller) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -631,9 +631,10 @@ HTMLTextAreaElement::GetControllers(ErrorResult& aError)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIController> controller = do_CreateInstance("@mozilla.org/editor/editorcontroller;1", &rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
aError.Throw(rv);
|
||||
nsCOMPtr<nsIController> controller =
|
||||
nsBaseCommandController::CreateEditorController();
|
||||
if (!controller) {
|
||||
aError.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -8,10 +8,6 @@
|
||||
|
||||
#include "nscore.h"
|
||||
|
||||
#define NS_EDITORCONTROLLER_CID \
|
||||
{ 0x26fb965c, 0x9de6, 0x11d3, \
|
||||
{ 0xbc, 0xcc, 0x0, 0x60, 0xb0, 0xfc, 0x76, 0xbd } }
|
||||
|
||||
class nsIControllerCommandTable;
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -490,7 +490,6 @@ NS_DEFINE_NAMED_CID(STORAGEACTIVITYSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NOTIFICATIONTELEMETRYSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(PUSHNOTIFIER_CID);
|
||||
NS_DEFINE_NAMED_CID(WORKERDEBUGGERMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_EDITORCONTROLLER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
|
||||
@ -538,30 +537,6 @@ NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
|
||||
|
||||
NS_DEFINE_NAMED_CID(NS_SCRIPTERROR_CID);
|
||||
|
||||
|
||||
// Constructor of a controller which is set up to use, internally, a
|
||||
// singleton command-table pre-filled with editor commands.
|
||||
static nsresult
|
||||
EditorControllerConstructor(nsISupports* aOuter, REFNSIID aIID, void** aResult)
|
||||
{
|
||||
nsCOMPtr<nsIController> controller = new nsBaseCommandController();
|
||||
|
||||
nsCOMPtr<nsIControllerCommandTable> editorCommandTable =
|
||||
nsControllerCommandTable::CreateEditorCommandTable();
|
||||
|
||||
// this guy is a singleton, so make it immutable
|
||||
editorCommandTable->MakeImmutable();
|
||||
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIControllerContext> controllerContext = do_QueryInterface(controller, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = controllerContext->Init(editorCommandTable);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return controller->QueryInterface(aIID, aResult);
|
||||
}
|
||||
|
||||
static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
||||
XPCONNECT_CIDENTRIES
|
||||
#ifdef DEBUG
|
||||
@ -610,7 +585,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
||||
{ &kNOTIFICATIONTELEMETRYSERVICE_CID, false, nullptr, NotificationTelemetryServiceConstructor },
|
||||
{ &kPUSHNOTIFIER_CID, false, nullptr, PushNotifierConstructor },
|
||||
{ &kWORKERDEBUGGERMANAGER_CID, true, nullptr, WorkerDebuggerManagerConstructor },
|
||||
{ &kNS_EDITORCONTROLLER_CID, false, nullptr, EditorControllerConstructor },
|
||||
{ &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
|
||||
{ &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
|
||||
{ &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
|
||||
@ -697,7 +671,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
||||
{ NOTIFICATIONTELEMETRYSERVICE_CONTRACTID, &kNOTIFICATIONTELEMETRYSERVICE_CID },
|
||||
{ PUSHNOTIFIER_CONTRACTID, &kPUSHNOTIFIER_CID },
|
||||
{ WORKERDEBUGGERMANAGER_CONTRACTID, &kWORKERDEBUGGERMANAGER_CID },
|
||||
{ "@mozilla.org/editor/editorcontroller;1", &kNS_EDITORCONTROLLER_CID },
|
||||
{ "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
|
||||
{ "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
|
||||
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
|
||||
|
Loading…
Reference in New Issue
Block a user