mobile/android/modules/geckoview/GeckoViewAccessibility.jsm
author Kris Maglione <maglione.k@gmail.com>
Tue, 24 Apr 2018 20:18:09 -0700
changeset 415693 95b7f4ae23fdaf6d806ffac8a402e5f043dbd1c5
parent 414098 34ebcf9dcd6e0bdc991d4b445321ae9d5f6acc16
child 420655 eb39298e432d05c0816f4f679d3da10baea43806
permissions -rw-r--r--
Bug 1456686: Part 1 - Fix unused and shadowed explicit imports. r=standard8 These issues were previously ignored due to the nature of our global import rules. They need to be fixed before that rule can be updated. MozReview-Commit-ID: DCChktTc5TW

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

var EXPORTED_SYMBOLS = ["GeckoViewAccessibility"];

ChromeUtils.import("resource://gre/modules/GeckoViewModule.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");

XPCOMUtils.defineLazyModuleGetters(this, {
  EventDispatcher: "resource://gre/modules/Messaging.jsm",
  AccessFu: "resource://gre/modules/accessibility/AccessFu.jsm"
});

class GeckoViewAccessibility extends GeckoViewModule {
  onInit() {
    EventDispatcher.instance.dispatch("GeckoView:AccessibilityReady");
    EventDispatcher.instance.registerListener((aEvent, aData, aCallback) => {
      if (aData.enabled) {
        AccessFu.attach(this.window);
      } else {
        AccessFu.detach();
      }
    }, "GeckoView:AccessibilitySettings");
  }
}