Bug 1374574 - Remove the FlyWeb system add-on from Fennec. r=sebastian draft
authorJohann Hofmann <jhofmann@mozilla.com>
Wed, 22 Nov 2017 14:49:35 +0100
changeset 703798 5c345ae5cbc2f4b0352d5e34c11478366240cbae
parent 703797 edf0c6585431ac8fdd229a2a09c8b21b797e8a5d
child 703799 fe711a2f06d542a2dcc7654e4397b7fcd0d3e359
push id90977
push userbmo:jhofmann@mozilla.com
push dateMon, 27 Nov 2017 19:50:43 +0000
reviewerssebastian
bugs1374574
milestone59.0a1
Bug 1374574 - Remove the FlyWeb system add-on from Fennec. r=sebastian MozReview-Commit-ID: AyYD4HedXFv
mobile/android/app.mozbuild
mobile/android/base/java/org/mozilla/gecko/widget/DoorHanger.java
mobile/android/chrome/content/PermissionsHelper.js
mobile/android/components/ContentPermissionPrompt.js
mobile/android/extensions/flyweb/bootstrap.js
mobile/android/extensions/flyweb/content/aboutFlyWeb.css
mobile/android/extensions/flyweb/content/aboutFlyWeb.js
mobile/android/extensions/flyweb/content/aboutFlyWeb.xhtml
mobile/android/extensions/flyweb/content/icon-64.png
mobile/android/extensions/flyweb/install.rdf.in
mobile/android/extensions/flyweb/jar.mn
mobile/android/extensions/flyweb/locale/en-US/aboutFlyWeb.dtd
mobile/android/extensions/flyweb/locale/en-US/flyweb.properties
mobile/android/extensions/flyweb/moz.build
mobile/android/extensions/moz.build
mobile/android/locales/en-US/chrome/browser.properties
mobile/android/moz.build
--- a/mobile/android/app.mozbuild
+++ b/mobile/android/app.mozbuild
@@ -1,14 +1,11 @@
 # vim: set filetype=python:
 # 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/.
 
 include('/toolkit/toolkit.mozbuild')
 
-if CONFIG['MOZ_EXTENSIONS']:
-    DIRS += ['/extensions']
-
 DIRS += [
     '/%s' % CONFIG['MOZ_BRANDING_DIRECTORY'],
     '/mobile/android',
 ]
--- a/mobile/android/base/java/org/mozilla/gecko/widget/DoorHanger.java
+++ b/mobile/android/base/java/org/mozilla/gecko/widget/DoorHanger.java
@@ -47,17 +47,16 @@ public abstract class DoorHanger extends
     public enum Type {
         DEFAULT,
         LOGIN,
         TRACKING,
         GEOLOCATION,
         DESKTOPNOTIFICATION2,
         WEBRTC,
         VIBRATION,
-        FLYWEBPUBLISHSERVER,
         ADDON
     }
 
     public interface OnButtonClickListener {
         public void onButtonClick(GeckoBundle response, DoorHanger doorhanger);
     }
 
     private static final String LOGTAG = "GeckoDoorHanger";
--- a/mobile/android/chrome/content/PermissionsHelper.js
+++ b/mobile/android/chrome/content/PermissionsHelper.js
@@ -1,33 +1,27 @@
 /* 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 PermissionsHelper = {
   _permissonTypes: ["password", "geolocation", "popup", "indexedDB",
-                    "offline-app", "desktop-notification", "plugins", "native-intent",
-                    "flyweb-publish-server"],
+                    "offline-app", "desktop-notification", "plugins", "native-intent"],
   _permissionStrings: {
     "password": {
       label: "password.logins",
       allowed: "password.save",
       denied: "password.dontSave"
     },
     "geolocation": {
       label: "geolocation.location",
       allowed: "geolocation.allow",
       denied: "geolocation.dontAllow"
     },
-    "flyweb-publish-server": {
-      label: "flyWebPublishServer.publishServer",
-      allowed: "flyWebPublishServer.allow",
-      denied: "flyWebPublishServer.dontAllow"
-    },
     "popup": {
       label: "blockPopups.label2",
       allowed: "popup.show",
       denied: "popup.dontShow"
     },
     "indexedDB": {
       label: "offlineApps.offlineData",
       allowed: "offlineApps.allow",
--- a/mobile/android/components/ContentPermissionPrompt.js
+++ b/mobile/android/components/ContentPermissionPrompt.js
@@ -15,24 +15,22 @@ XPCOMUtils.defineLazyModuleGetter(this, 
 
 XPCOMUtils.defineLazyModuleGetter(this, "DoorHanger",
                                   "resource://gre/modules/Prompt.jsm");
 
 const kEntities = {
   "contacts": "contacts",
   "desktop-notification": "desktopNotification2",
   "geolocation": "geolocation",
-  "flyweb-publish-server": "flyWebPublishServer",
 };
 
 // For these types, prompt for permission if action is unknown.
 const PROMPT_FOR_UNKNOWN = [
   "desktop-notification",
   "geolocation",
-  "flyweb-publish-server",
 ];
 
 function ContentPermissionPrompt() {}
 
 ContentPermissionPrompt.prototype = {
   classID: Components.ID("{C6E8C44D-9F39-4AF7-BCC0-76E38A8310F5}"),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentPermissionPrompt]),
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/bootstrap.js
+++ /dev/null
@@ -1,153 +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");
-    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.nsIDOMWindow);
-    domWindow.addEventListener("UIReady", function() {
-      loadIntoWindow(domWindow);
-    }, {once: true});
-  },
-
-  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);
-
-  // 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();
-  }
-}
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/content/aboutFlyWeb.css
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 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/. */
-
-include "defines.css"
-
-.list-item > a {
-  color: inherit;
-  text-decoration: none;
-}
-
-.details {
-  -moz-margin-start: calc(var(--icon-size) + var(--icon-margin) * 2 - 1em);
-  padding: 1em;
-}
-
-#flyweb-item-template {
-  display: none;
-}
-
-#flyweb-list-empty {
-  display: none;
-}
-
-#flyweb-list:empty + #flyweb-list-empty {
-  display: block;
-  text-align: center;
-  padding-top: 3.9em;
-}
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/content/aboutFlyWeb.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* 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";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Console.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "gFlyWebBundle", function() {
-  return Services.strings.createBundle("chrome://flyweb/locale/flyweb.properties");
-});
-
-let discoveryManager = new FlyWebDiscoveryManager();
-
-let discoveryCallback = {
-  onDiscoveredServicesChanged(services) {
-    if (!this.id) {
-      return;
-    }
-
-    let list = document.getElementById("flyweb-list");
-    while (list.firstChild) {
-      list.firstChild.remove();
-    }
-
-    let template = document.getElementById("flyweb-item-template");
-
-    for (let service of services) {
-      let item = template.cloneNode(true);
-      item.removeAttribute("id");
-
-      item.setAttribute("data-service-id", service.serviceId);
-      item.querySelector(".title").setAttribute("value", service.displayName);
-      item.querySelector(".icon").src = "chrome://flyweb/content/icon-64.png";
-
-      list.appendChild(item);
-    }
-  },
-  start() {
-    this.id = discoveryManager.startDiscovery(this);
-  },
-  stop() {
-    discoveryManager.stopDiscovery(this.id);
-    this.id = undefined;
-  }
-};
-
-window.addEventListener("DOMContentLoaded", () => {
-  let list = document.getElementById("flyweb-list");
-  list.addEventListener("click", (evt) => {
-    let serviceId = evt.target.closest("[data-service-id]").getAttribute("data-service-id");
-
-    discoveryManager.pairWithService(serviceId, {
-      pairingSucceeded(service) {
-        window.open(service.uiUrl, "FlyWebWindow_" + serviceId);
-      },
-
-      pairingFailed(error) {
-        console.error("FlyWeb failed to connect to service " + serviceId, error);
-      }
-    });
-  });
-
-  discoveryCallback.start();
-});
-
-window.addEventListener("unload", () => {
-  discoveryCallback.stop();
-});
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/content/aboutFlyWeb.xhtml
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
-  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [
-<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
-%brandDTD;
-<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd" >
-%globalDTD;
-<!ENTITY % flywebDTD SYSTEM "chrome://flyweb/locale/aboutFlyWeb.dtd" >
-%flywebDTD;
-]>
-
-<!-- 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/.  -->
-
-<html xmlns="http://www.w3.org/1999/xhtml"
-      xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<head>
-  <title>&aboutFlyWeb.title;</title>
-  <meta name="viewport" content="width=device-width; user-scalable=0" />
-  <link rel="icon" type="image/png" sizes="64x64" href="chrome://branding/content/favicon64.png" />
-  <link rel="stylesheet" href="chrome://browser/skin/aboutBase.css" type="text/css"/>
-  <link rel="stylesheet" href="chrome://flyweb/content/aboutFlyWeb.css" type="text/css"/>
-</head>
-
-<body dir="&locale.dir;">
-  <!--template id="flyweb-item-template"-->
-    <li id="flyweb-item-template" class="list-item" role="button">
-      <img class="icon" src=""/>
-      <div class="details">
-        <div class="row">
-          <!-- This is a hack so that we can crop this label in its center -->
-          <xul:label class="title" crop="center" value=""/>
-        </div>
-      </div>
-    </li>
-  <!--/template-->
-
-  <div class="header">
-    <div>&aboutFlyWeb.header;</div>
-  </div>
-  <ul id="flyweb-list" class="list"></ul>
-  <span id="flyweb-list-empty">&aboutFlyWeb.empty;</span>
-  <script type="application/javascript" src="chrome://flyweb/content/aboutFlyWeb.js"/>
-</body>
-</html>
deleted file mode 100644
index be8ece467b7b1df0683febca9253079af55abad2..0000000000000000000000000000000000000000
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/install.rdf.in
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<!-- 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/. -->
-
-#filter substitution
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-     xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
-  <Description about="urn:mozilla:install-manifest">
-    <em:id>flyweb@mozilla.org</em:id>
-    <em:version>1.0.0</em:version>
-    <em:type>2</em:type>
-    <em:bootstrap>true</em:bootstrap>
-
-    <!-- Target Application this theme can install into,
-        with minimum and maximum supported versions. -->
-    <em:targetApplication>
-      <Description>
-        <em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id>
-        <em:minVersion>@FIREFOX_VERSION@</em:minVersion>
-        <em:maxVersion>@FIREFOX_VERSION@</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-
-    <!-- Front End MetaData -->
-    <em:name>FlyWeb</em:name>
-    <em:description>Discover nearby services in the browser</em:description>
-  </Description>
-</RDF>
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/jar.mn
+++ /dev/null
@@ -1,10 +0,0 @@
-#filter substitution
-# 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/.
-
-[features/flyweb@mozilla.org] chrome.jar:
-% content   flyweb              %content/        contentaccessible=yes
-  content/                      (content/*)
-% locale    flyweb en-US        %locale/en-US/
-  locale/                       (locale/*)
\ No newline at end of file
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/locale/en-US/aboutFlyWeb.dtd
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- 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/. -->
-
-<!ENTITY aboutFlyWeb.title  "FlyWeb">
-<!ENTITY aboutFlyWeb.header "Nearby FlyWeb Services">
-<!ENTITY aboutFlyWeb.empty  "No FlyWeb Services Found">
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/locale/en-US/flyweb.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-flyweb-menu.name = FlyWeb
deleted file mode 100644
--- a/mobile/android/extensions/flyweb/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-FINAL_TARGET_FILES.features['flyweb@mozilla.org'] += [
-  'bootstrap.js'
-]
-
-FINAL_TARGET_PP_FILES.features['flyweb@mozilla.org'] += [
-  'install.rdf.in'
-]
-
-JAR_MANIFESTS += ['jar.mn']
deleted file mode 100644
--- a/mobile/android/extensions/moz.build
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# 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/.
-
-with Files('**'):
-    BUG_COMPONENT = ('Firefox for Android', 'General')
-
-# Only include the following system add-ons if building Aurora or Nightly
-if not CONFIG['RELEASE_OR_BETA']:
-    DIRS += [
-        'flyweb',
-    ]
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -209,28 +209,16 @@ geolocation.dontAskAgain=Don't ask again
 # Desktop notification UI
 desktopNotification2.allow=Always
 desktopNotification2.dontAllow=Never
 desktopNotification2.ask=Would you like to receive notifications from this site?
 # LOCALIZATION NOTE (desktopNotification.notifications): Label that will be
 # used in site settings dialog.
 desktopNotification.notifications=Notifications
 
-# FlyWeb UI
-# LOCALIZATION NOTE (flyWebPublishServer.allow): This is an experimental feature only shipping in Nightly, and doesn't need translation.
-flyWebPublishServer.allow=Allow
-# LOCALIZATION NOTE (flyWebPublishServer.dontAllow): This is an experimental feature only shipping in Nightly, and doesn't need translation.
-flyWebPublishServer.dontAllow=Deny
-# LOCALIZATION NOTE (flyWebPublishServer.ask): This is an experimental feature only shipping in Nightly, and doesn't need translation.
-flyWebPublishServer.ask=Would you like to let this site start a server accessible to nearby devices and people?
-# LOCALIZATION NOTE (flyWebPublishServer.dontAskAgain): This is an experimental feature only shipping in Nightly, and doesn't need translation.
-flyWebPublishServer.dontAskAgain=Don't ask again for this site
-# LOCALIZATION NOTE (flyWebPublishServer.publishServer): This is an experimental feature only shipping in Nightly, and doesn't need translation.
-flyWebPublishServer.publishServer=Publish Server
-
 # Imageblocking
 imageblocking.downloadedImage=Image unblocked
 imageblocking.showAllImages=Show All
 
 # New Tab Popup
 # LOCALIZATION NOTE (newtabpopup, newprivatetabpopup): Semicolon-separated list of plural forms.
 # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
 # #1 number of tabs
--- a/mobile/android/moz.build
+++ b/mobile/android/moz.build
@@ -53,17 +53,16 @@ DIRS += [
 
 if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
     DIRS += ['stumbler']
 
 DIRS += [
     'base',
     'chrome',
     'components',
-    'extensions',
     'modules',
     'themes/core',
     'themes/geckoview',
     'app',
     'fonts',
 ]
 
 TEST_DIRS += [