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/. */
9 var EXPORTED_SYMBOLS = ["InlineSpellCheckerParent"];
11 class InlineSpellCheckerParent extends JSWindowActorParent {
12 selectDictionaries({ localeCodes }) {
13 this.sendAsyncMessage("InlineSpellChecker:selectDictionaries", {
18 replaceMisspelling({ suggestion }) {
19 this.sendAsyncMessage("InlineSpellChecker:replaceMisspelling", {
25 this.sendAsyncMessage("InlineSpellChecker:toggleEnabled", {});
29 this.sendAsyncMessage("InlineSpellChecker:recheck", {});
33 // This method gets called by InlineSpellChecker when the context menu
34 // goes away and the InlineSpellChecker instance is still alive.
35 // Stop referencing it and tidy the child end of us.
36 this.sendAsyncMessage("InlineSpellChecker:uninit", {});
39 _destructionObservers = new Set();
40 registerDestructionObserver(obj) {
41 this._destructionObservers.add(obj);
44 unregisterDestructionObserver(obj) {
45 this._destructionObservers.delete(obj);
49 for (let obs of this._destructionObservers) {
50 obs.actorDestroyed(this);
52 this._destructionObservers = null;