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 selectDictionary({ localeCode }) {
13 this.sendAsyncMessage("InlineSpellChecker:selectDictionary", {
18 replaceMisspelling({ index }) {
19 this.sendAsyncMessage("InlineSpellChecker:replaceMisspelling", { index });
23 this.sendAsyncMessage("InlineSpellChecker:toggleEnabled", {});
27 this.sendAsyncMessage("InlineSpellChecker:recheck", {});
31 // This method gets called by InlineSpellChecker when the context menu
32 // goes away and the InlineSpellChecker instance is still alive.
33 // Stop referencing it and tidy the child end of us.
34 this.sendAsyncMessage("InlineSpellChecker:uninit", {});
37 _destructionObservers = new Set();
38 registerDestructionObserver(obj) {
39 this._destructionObservers.add(obj);
42 unregisterDestructionObserver(obj) {
43 this._destructionObservers.delete(obj);
47 for (let obs of this._destructionObservers) {
48 obs.actorDestroyed(this);
50 this._destructionObservers = null;