Bug 1540963 - Make nsIControllerCommandTable builtinclass and make its users use nsControllerCommandTable directly r=bzbarsky

`nsIControllerCommandTable` isn't implemented with JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, it's inherited only by nsControllerCommandTable.  So, all users
in C++ can treat the concrete class directly.

Differential Revision: https://phabricator.services.mozilla.com/D25727
This commit is contained in:
Masayuki Nakano
2019-04-03 12:52:14 +00:00
parent 1b2614bcc1
commit fc6bb1720f
16 changed files with 128 additions and 125 deletions

View File

@@ -28,7 +28,7 @@
#include "HTMLFormSubmissionConstants.h"
#include "mozilla/Telemetry.h"
#include "nsIControllers.h"
#include "nsBaseCommandController.h"
#include "nsIStringBundle.h"
#include "nsFocusManager.h"
#include "nsColorControlFrame.h"
@@ -109,7 +109,6 @@
#include "nsIColorPicker.h"
#include "nsIStringEnumerator.h"
#include "HTMLSplitOnSpacesTokenizer.h"
#include "nsIController.h"
#include "nsIMIMEInfo.h"
#include "nsFrameSelection.h"
#include "nsBaseCommandController.h"
@@ -5448,22 +5447,22 @@ nsIControllers* HTMLInputElement::GetControllers(ErrorResult& aRv) {
return nullptr;
}
nsCOMPtr<nsIController> controller =
RefPtr<nsBaseCommandController> commandController =
nsBaseCommandController::CreateEditorController();
if (!controller) {
if (!commandController) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
mControllers->AppendController(controller);
mControllers->AppendController(commandController);
controller = nsBaseCommandController::CreateEditingController();
if (!controller) {
commandController = nsBaseCommandController::CreateEditingController();
if (!commandController) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
mControllers->AppendController(controller);
mControllers->AppendController(commandController);
}
}