Bug 965064 - Part 1: back out non-native about:accounts. r=nalexander
authorRichard Newman <rnewman@mozilla.com>
Tue, 28 Jan 2014 16:49:54 -0800
changeset 166076 17789e0d6218b0b713d19ba35b24d3af8ec47109
parent 166075 707758a718fd3f72d47b89bdfabf19b202d60856
child 166077 77baf0b8fb9ed5a42685d0900546a9e511fa4687
push id26111
push userrnewman@mozilla.com
push dateFri, 31 Jan 2014 04:28:22 +0000
treeherdermozilla-central@5e0a22097bff [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs965064
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 965064 - Part 1: back out non-native about:accounts. r=nalexander
mobile/android/app/mobile.js
mobile/android/chrome/content/aboutAccounts.js
mobile/android/chrome/content/aboutAccounts.xhtml
mobile/android/chrome/jar.mn
mobile/android/components/AboutRedirector.js
mobile/android/components/MobileComponents.manifest
mobile/android/locales/en-US/chrome/aboutAccounts.dtd
mobile/android/locales/jar.mn
mobile/android/themes/core/aboutAccounts.css
mobile/android/themes/core/jar.mn
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -795,19 +795,16 @@ pref("gfx.canvas.azure.accelerated", tru
 pref("general.useragent.override.youtube.com", "Android; Tablet;#Android; Mobile;");
 
 // When true, phone number linkification is enabled.
 pref("browser.ui.linkify.phone", false);
 
 // Enables/disables Spatial Navigation
 pref("snav.enabled", true);
 
-// URL to fetch about:accounts web content from.
-pref("identity.fxaccounts.remote.uri", "https://accounts.dev.lcip.org/mobile");
-
 // This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into
 // this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream
 // repackager of this code using an alternate snippet url, please keep your users safe
 pref("browser.snippets.updateUrl", "https://snippets.mozilla.com/json/%SNIPPETS_VERSION%/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/");
 
 // How frequently we check for new snippets, in seconds (1 day)
 pref("browser.snippets.updateInterval", 86400);
 
deleted file mode 100644
--- a/mobile/android/chrome/content/aboutAccounts.js
+++ /dev/null
@@ -1,133 +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/Log.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-// loglevel should be one of "Fatal", "Error", "Warn", "Info", "Config",
-// "Debug", "Trace" or "All". If none is specified, "Error" will be used by
-// default.
-const PREF_LOG_LEVEL = "identity.fxaccounts.loglevel";
-
-// Shamelessly cribbed from services/fxaccounts/FxAccountsCommon.js.
-let log = Log.repository.getLogger("FirefoxAccounts");
-
-// Avoid adding lots of appenders, which results in duplicate messages.
-try {
-   if (log.ownAppenders.length == 0) {
-    log.addAppender(new Log.DumpAppender());
-  }
-} catch (e) {
-  log.addAppender(new Log.DumpAppender());
-}
-
-log.level = Log.Level.Error;
-try {
-  let level =
-    Services.prefs.getPrefType(PREF_LOG_LEVEL) == Ci.nsIPrefBranch.PREF_STRING
-    && Services.prefs.getCharPref(PREF_LOG_LEVEL);
-  log.level = Log.Level[level] || Log.Level.Error;
-} catch (e) {
-  log.error(e);
-}
-
-function sendMessageToJava(message) {
-  return Services.androidBridge.handleGeckoMessage(JSON.stringify(message));
-}
-
-let wrapper = {
-  iframe: null,
-
-  init: function () {
-    log.info("about:accounts init");
-    let iframe = document.getElementById("remote");
-    this.iframe = iframe;
-    iframe.addEventListener("load", this);
-    log.debug("accountsURI " + this.accountsURI);
-    iframe.src = this.accountsURI;
-  },
-
-  handleEvent: function (evt) {
-    switch (evt.type) {
-      case "load":
-        this.iframe.contentWindow.addEventListener("FirefoxAccountsCommand", this);
-        this.iframe.removeEventListener("load", this);
-        break;
-      case "FirefoxAccountsCommand":
-        this.handleRemoteCommand(evt);
-        break;
-    }
-  },
-
-  onLogin: function (data) {
-    log.debug("Received: 'login'. Data:" + JSON.stringify(data));
-    this.injectData("message", { status: "login" });
-    sendMessageToJava({
-      type: "FxAccount:Login",
-      data: data,
-    });
-  },
-
-  onCreate: function (data) {
-    log.debug("Received: 'create'. Data:" + JSON.stringify(data));
-    this.injectData("message", { status: "create" });
-    sendMessageToJava({
-      type: "FxAccount:Create",
-      data: data,
-    });
-  },
-
-  onVerified: function (data) {
-    log.debug("Received: 'verified'. Data:" + JSON.stringify(data));
-    this.injectData("message", { status: "verified" });
-    sendMessageToJava({
-      type: "FxAccount:Verified",
-      data: data,
-    });
-  },
-
-  get accountsURI() {
-    delete this.accountsURI;
-    return this.accountsURI = Services.urlFormatter.formatURLPref("identity.fxaccounts.remote.uri");
-  },
-
-  handleRemoteCommand: function (evt) {
-    log.debug('command: ' + evt.detail.command);
-    let data = evt.detail.data;
-
-    switch (evt.detail.command) {
-      case "create":
-        this.onCreate(data);
-        break;
-      case "login":
-        this.onLogin(data);
-        break;
-      case "verified":
-        this.onVerified(data);
-        break;
-      default:
-        log.warn("Unexpected remote command received: " + evt.detail.command + ". Ignoring command.");
-        break;
-    }
-  },
-
-  injectData: function (type, content) {
-    let authUrl = this.accountsURI;
-
-    let data = {
-      type: type,
-      content: content
-    };
-
-    this.iframe.contentWindow.postMessage(data, authUrl);
-  },
-};
-
-log.info("about:accounts initializing.");
-wrapper.init();
-log.info("about:accounts initialized.");
deleted file mode 100644
--- a/mobile/android/chrome/content/aboutAccounts.xhtml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/. -->
-<!DOCTYPE html [
-  <!ENTITY % htmlDTD PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
-  %htmlDTD;
-  <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-  %brandDTD;
-  <!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
-  %globalDTD;
-  <!ENTITY % aboutAccountsDTD SYSTEM "chrome://browser/locale/aboutAccounts.dtd">
-  %aboutAccountsDTD;
-]>
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-  <head>
-   <meta name="viewport" content="width=device-width, initial-scale=1" />
-   <link rel="icon" type="image/png" sizes="64x64"
-     href="chrome://branding/content/favicon64.png" />
-   <title>&aboutAccounts.pageTitle;</title>
-   <link rel="stylesheet"
-     href="chrome://browser/skin/aboutAccounts.css"
-     type="text/css" />
-  </head>
-  <body>
-    <iframe mozframetype="content" id="remote" />
-    <script type="text/javascript;version=1.8"
-      src="chrome://browser/content/aboutAccounts.js" />
-  </body>
-</html>
--- a/mobile/android/chrome/jar.mn
+++ b/mobile/android/chrome/jar.mn
@@ -53,16 +53,14 @@ chrome.jar:
   content/FeedHandler.js               (content/FeedHandler.js)
   content/Feedback.js                  (content/Feedback.js)
   content/Linkify.js                   (content/Linkify.js)
   content/CastingApps.js               (content/CastingApps.js)
 #ifdef MOZ_SERVICES_HEALTHREPORT
   content/aboutHealthReport.xhtml      (content/aboutHealthReport.xhtml)
 * content/aboutHealthReport.js         (content/aboutHealthReport.js)
 #endif
-  content/aboutAccounts.xhtml          (content/aboutAccounts.xhtml)
-* content/aboutAccounts.js             (content/aboutAccounts.js)
 
 % content branding %content/branding/
 
 % override chrome://global/content/config.xul chrome://browser/content/config.xhtml
 % override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
 % override chrome://mozapps/content/extensions/extensions.xul chrome://browser/content/aboutAddons.xhtml
--- a/mobile/android/components/AboutRedirector.js
+++ b/mobile/android/components/AboutRedirector.js
@@ -73,20 +73,16 @@ let modules = {
     privileged: true
   },
 #ifdef MOZ_SERVICES_HEALTHREPORT
   healthreport: {
     uri: "chrome://browser/content/aboutHealthReport.xhtml",
     privileged: true
   },
 #endif
-  accounts: {
-    uri: "chrome://browser/content/aboutAccounts.xhtml",
-    privileged: true
-  },
 }
 
 function AboutRedirector() {}
 AboutRedirector.prototype = {
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
   classID: Components.ID("{322ba47e-7047-4f71-aebf-cb7d69325cd9}"),
 
   _getModuleInfo: function (aURI) {
--- a/mobile/android/components/MobileComponents.manifest
+++ b/mobile/android/components/MobileComponents.manifest
@@ -7,17 +7,16 @@ contract @mozilla.org/network/protocol/a
 contract @mozilla.org/network/protocol/about;1?what=rights {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=certerror {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=home {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=apps {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=downloads {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=reader {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=feedback {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 contract @mozilla.org/network/protocol/about;1?what=privatebrowsing {322ba47e-7047-4f71-aebf-cb7d69325cd9}
-contract @mozilla.org/network/protocol/about;1?what=accounts {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 #ifdef MOZ_SERVICES_HEALTHREPORT
 contract @mozilla.org/network/protocol/about;1?what=healthreport {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 #endif
 #ifdef MOZ_SAFE_BROWSING
 contract @mozilla.org/network/protocol/about;1?what=blocked {322ba47e-7047-4f71-aebf-cb7d69325cd9}
 #endif
 
 # DirectoryProvider.js
deleted file mode 100644
--- a/mobile/android/locales/en-US/chrome/aboutAccounts.dtd
+++ /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/. -->
-
-<!ENTITY aboutAccounts.pageTitle "&brandShortName; Accounts">
--- a/mobile/android/locales/jar.mn
+++ b/mobile/android/locales/jar.mn
@@ -2,17 +2,16 @@
 # 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/.
 
 
 @AB_CD@.jar:
 % locale browser @AB_CD@ %locale/@AB_CD@/browser/
   locale/@AB_CD@/browser/about.dtd                (%chrome/about.dtd)
-  locale/@AB_CD@/browser/aboutAccounts.dtd        (%chrome/aboutAccounts.dtd)
   locale/@AB_CD@/browser/aboutAddons.dtd          (%chrome/aboutAddons.dtd)
   locale/@AB_CD@/browser/aboutAddons.properties   (%chrome/aboutAddons.properties)
   locale/@AB_CD@/browser/aboutApps.dtd            (%chrome/aboutApps.dtd)
   locale/@AB_CD@/browser/aboutCertError.dtd       (%chrome/aboutCertError.dtd)
   locale/@AB_CD@/browser/aboutDownloads.dtd       (%chrome/aboutDownloads.dtd)
   locale/@AB_CD@/browser/aboutDownloads.properties (%chrome/aboutDownloads.properties)
   locale/@AB_CD@/browser/aboutFeedback.dtd        (%chrome/aboutFeedback.dtd)
   locale/@AB_CD@/browser/aboutHome.dtd            (%chrome/aboutHome.dtd)
deleted file mode 100644
--- a/mobile/android/themes/core/aboutAccounts.css
+++ /dev/null
@@ -1,21 +0,0 @@
-* {
-  margin: 0;
-  padding: 0;
-}
-
-html, body {
-  height: 100%;
-}
-
-#content {
-  width: 100%;
-  height: 100%;
-  border: 0;
-  display: flex;
-}
-
-#remote {
-  width: 100%;
-  height: 100%;
-  border: 0;
-}
--- a/mobile/android/themes/core/jar.mn
+++ b/mobile/android/themes/core/jar.mn
@@ -3,17 +3,16 @@
 # 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/.
 
 
 chrome.jar:
 % skin browser classic/1.0 %skin/
   skin/aboutPage.css                        (aboutPage.css)
   skin/about.css                            (about.css)
-  skin/aboutAccounts.css                    (aboutAccounts.css)
   skin/aboutAddons.css                      (aboutAddons.css)
   skin/aboutApps.css                        (aboutApps.css)
   skin/aboutBase.css                        (aboutBase.css)
 * skin/aboutDownloads.css                   (aboutDownloads.css)
   skin/aboutFeedback.css                    (aboutFeedback.css)
 #ifdef MOZ_SERVICES_HEALTHREPORT
   skin/aboutHealthReport.css                (aboutHealthReport.css)
 #endif