Bug 1820641: Make a test that calls window.restore handle zoomed windows. r=mstange
[gecko.git] / toolkit / actors / InlineSpellCheckerParent.jsm
blobe8aa0c14dc8d1e35b9f218303fb055e95a1a397c
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 "use strict";
9 var EXPORTED_SYMBOLS = ["InlineSpellCheckerParent"];
11 class InlineSpellCheckerParent extends JSWindowActorParent {
12   selectDictionaries({ localeCodes }) {
13     this.sendAsyncMessage("InlineSpellChecker:selectDictionaries", {
14       localeCodes,
15     });
16   }
18   replaceMisspelling({ suggestion }) {
19     this.sendAsyncMessage("InlineSpellChecker:replaceMisspelling", {
20       suggestion,
21     });
22   }
24   toggleEnabled() {
25     this.sendAsyncMessage("InlineSpellChecker:toggleEnabled", {});
26   }
28   recheckSpelling() {
29     this.sendAsyncMessage("InlineSpellChecker:recheck", {});
30   }
32   uninit() {
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", {});
37   }
39   _destructionObservers = new Set();
40   registerDestructionObserver(obj) {
41     this._destructionObservers.add(obj);
42   }
44   unregisterDestructionObserver(obj) {
45     this._destructionObservers.delete(obj);
46   }
48   didDestroy() {
49     for (let obs of this._destructionObservers) {
50       obs.actorDestroyed(this);
51     }
52     this._destructionObservers = null;
53   }