1 /* -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- */
2 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 export class InlineSpellCheckerParent extends JSWindowActorParent {
8 selectDictionaries({ localeCodes }) {
9 this.sendAsyncMessage("InlineSpellChecker:selectDictionaries", {
14 replaceMisspelling({ suggestion }) {
15 this.sendAsyncMessage("InlineSpellChecker:replaceMisspelling", {
21 this.sendAsyncMessage("InlineSpellChecker:toggleEnabled", {});
25 this.sendAsyncMessage("InlineSpellChecker:recheck", {});
29 // This method gets called by InlineSpellChecker when the context menu
30 // goes away and the InlineSpellChecker instance is still alive.
31 // Stop referencing it and tidy the child end of us.
32 this.sendAsyncMessage("InlineSpellChecker:uninit", {});
35 _destructionObservers = new Set();
36 registerDestructionObserver(obj) {
37 this._destructionObservers.add(obj);
40 unregisterDestructionObserver(obj) {
41 this._destructionObservers.delete(obj);
45 for (let obs of this._destructionObservers) {
46 obs.actorDestroyed(this);
48 this._destructionObservers = null;