summaryrefslogtreecommitdiffstats
path: root/mobile/android/extensions/flyweb/bootstrap.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-04-23 15:32:23 -0400
commitabe80cc31d5a40ebed743085011fbcda0c1a9a10 (patch)
treefb3762f06b84745b182af281abb107b95a9fcf01 /mobile/android/extensions/flyweb/bootstrap.js
parent63295d0087eb58a6eb34cad324c4c53d1b220491 (diff)
downloadUXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.gz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.lz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.tar.xz
UXP-abe80cc31d5a40ebed743085011fbcda0c1a9a10.zip
Issue #1053 - Drop support Android and remove Fennec - Part 1a: Remove mobile/android
Diffstat (limited to 'mobile/android/extensions/flyweb/bootstrap.js')
-rw-r--r--mobile/android/extensions/flyweb/bootstrap.js154
1 files changed, 0 insertions, 154 deletions
diff --git a/mobile/android/extensions/flyweb/bootstrap.js b/mobile/android/extensions/flyweb/bootstrap.js
deleted file mode 100644
index 017cb4763..000000000
--- a/mobile/android/extensions/flyweb/bootstrap.js
+++ /dev/null
@@ -1,154 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* 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/. */
-
-const {classes: Cc, interfaces: Ci, manager: Cm, results: Cr, utils: Cu, Constructor: CC} = Components;
-
-Cm.QueryInterface(Ci.nsIComponentRegistrar);
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Console",
- "resource://gre/modules/Console.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "gFlyWebBundle", function() {
- return Services.strings.createBundle("chrome://flyweb/locale/flyweb.properties");
-});
-
-const FLYWEB_ENABLED_PREF = "dom.flyweb.enabled";
-
-let factory, menuID;
-
-function AboutFlyWeb() {}
-
-AboutFlyWeb.prototype = Object.freeze({
- classDescription: "About page for displaying nearby FlyWeb services",
- contractID: "@mozilla.org/network/protocol/about;1?what=flyweb",
- classID: Components.ID("{baa04ff0-08b5-11e6-a837-0800200c9a66}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
-
- getURIFlags: function(aURI) {
- return Ci.nsIAboutModule.ALLOW_SCRIPT;
- },
-
- newChannel: function(aURI, aLoadInfo) {
- let uri = Services.io.newURI("chrome://flyweb/content/aboutFlyWeb.xhtml", null, null);
- let channel = Services.io.newChannelFromURIWithLoadInfo(uri, aLoadInfo);
- channel.originalURI = aURI;
- return channel;
- }
-});
-
-function Factory(component) {
- this.createInstance = function(outer, iid) {
- if (outer) {
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
- return new component();
- };
- this.register = function() {
- Cm.registerFactory(component.prototype.classID, component.prototype.classDescription, component.prototype.contractID, this);
- };
- this.unregister = function() {
- Cm.unregisterFactory(component.prototype.classID, this);
- }
- Object.freeze(this);
- this.register();
-}
-
-let windowListener = {
- onOpenWindow: function(aWindow) {
- // Wait for the window to finish loading
- let domWindow = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow);
- domWindow.addEventListener("UIReady", function onLoad() {
- domWindow.removeEventListener("UIReady", onLoad, false);
- loadIntoWindow(domWindow);
- }, false);
- },
-
- onCloseWindow: function(aWindow) {},
- onWindowTitleChange: function(aWindow, aTitle) {}
-};
-
-let FlyWebUI = {
- init() {
- factory = new Factory(AboutFlyWeb);
-
- // Load into any existing windows
- let windows = Services.wm.getEnumerator("navigator:browser");
- while (windows.hasMoreElements()) {
- let domWindow = windows.getNext().QueryInterface(Ci.nsIDOMWindow);
- loadIntoWindow(domWindow);
- }
-
- // Load into any new windows
- Services.wm.addListener(windowListener);
- },
-
- uninit() {
- factory.unregister();
-
- // Stop listening for new windows
- Services.wm.removeListener(windowListener);
-
- // Unload from any existing windows
- let windows = Services.wm.getEnumerator("navigator:browser");
- while (windows.hasMoreElements()) {
- let domWindow = windows.getNext().QueryInterface(Ci.nsIDOMWindow);
- unloadFromWindow(domWindow);
- }
- }
-};
-
-function loadIntoWindow(aWindow) {
- menuID = aWindow.NativeWindow.menu.add({
- name: gFlyWebBundle.GetStringFromName("flyweb-menu.name"),
- callback() {
- aWindow.BrowserApp.addTab("about:flyweb");
- }
- });
-}
-
-function unloadFromWindow(aWindow) {
- if (!aWindow) {
- return;
- }
-
- aWindow.NativeWindow.menu.remove(menuID);
-}
-
-function prefObserver(aSubject, aTopic, aData) {
- let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF);
- if (enabled) {
- FlyWebUI.init();
- } else {
- FlyWebUI.uninit();
- }
-}
-
-function install(aData, aReason) {}
-
-function uninstall(aData, aReason) {}
-
-function startup(aData, aReason) {
- // Observe pref changes and enable/disable as necessary.
- Services.prefs.addObserver(FLYWEB_ENABLED_PREF, prefObserver, false);
-
- // Only initialize if pref is enabled.
- let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF);
- if (enabled) {
- FlyWebUI.init();
- }
-}
-
-function shutdown(aData, aReason) {
- Services.prefs.removeObserver(FLYWEB_ENABLED_PREF, prefObserver);
-
- let enabled = Services.prefs.getBoolPref(FLYWEB_ENABLED_PREF);
- if (enabled) {
- FlyWebUI.uninit();
- }
-}