Bug 1869043 allow a device to be specified with MediaTrackGraph::NotifyWhenDeviceStar...
[gecko.git] / toolkit / actors / ExtFindChild.sys.mjs
blobdc6d296d88561e6f5978f0c6e362f137944c1d6d
1 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 const lazy = {};
8 ChromeUtils.defineESModuleGetters(lazy, {
9   FindContent: "resource://gre/modules/FindContent.sys.mjs",
10 });
12 export class ExtFindChild extends JSWindowActorChild {
13   receiveMessage(message) {
14     if (!this._findContent) {
15       this._findContent = new lazy.FindContent(this.docShell);
16     }
18     switch (message.name) {
19       case "ext-Finder:CollectResults":
20         this.finderInited = true;
21         return this._findContent.findRanges(message.data);
22       case "ext-Finder:HighlightResults":
23         return this._findContent.highlightResults(message.data);
24       case "ext-Finder:ClearHighlighting":
25         this._findContent.highlighter.highlight(false);
26         break;
27     }
29     return null;
30   }