Bug 1296767 part 8 - Remove legacy Sync in-content pref screens. r?markh draft
authorEdouard Oger <eoger@fastmail.com>
Thu, 19 Jan 2017 11:52:37 -0500
changeset 467368 814b2604647786a204f93e3539e58fbd18b21617
parent 467367 3914930ed3c81aed36617a95950c359b9cc593db
child 467369 54b01340514852b94662bb9b567bd5ff611e34ad
push id43155
push userbmo:eoger@fastmail.com
push dateFri, 27 Jan 2017 18:31:15 +0000
reviewersmarkh
bugs1296767
milestone54.0a1
Bug 1296767 part 8 - Remove legacy Sync in-content pref screens. r?markh MozReview-Commit-ID: Blpdd3jeeww
browser/base/content/sync/utils.js
browser/base/jar.mn
browser/components/preferences/in-content/sync.js
browser/components/preferences/in-content/sync.xul
browser/locales/en-US/chrome/browser/preferences/preferences.properties
browser/locales/en-US/chrome/browser/preferences/sync.dtd
browser/themes/linux/preferences/preferences.css
browser/themes/osx/preferences/preferences.css
browser/themes/shared/incontentprefs/preferences.inc.css
browser/themes/windows/preferences/preferences.css
services/sync/services-sync.js
deleted file mode 100644
--- a/browser/base/content/sync/utils.js
+++ /dev/null
@@ -1,50 +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/. */
-
-// Weave should always exist before before this file gets included.
-var gSyncUtils = {
-
-  get fxAccountsEnabled() {
-    let service = Components.classes["@mozilla.org/weave/service;1"]
-                            .getService(Components.interfaces.nsISupports)
-                            .wrappedJSObject;
-    return service.fxAccountsEnabled;
-  },
-
-  // opens in a new window if we're in a modal prefwindow world, in a new tab otherwise
-  _openLink(url) {
-    let thisDocEl = document.documentElement,
-        openerDocEl = window.opener && window.opener.document.documentElement;
-    if (thisDocEl.id == "accountSetup" && window.opener &&
-        openerDocEl.id == "BrowserPreferences" && !openerDocEl.instantApply)
-      openUILinkIn(url, "window");
-    else if (thisDocEl.id == "BrowserPreferences" && !thisDocEl.instantApply)
-      openUILinkIn(url, "window");
-    else if (document.documentElement.id == "change-dialog")
-      Services.wm.getMostRecentWindow("navigator:browser")
-              .openUILinkIn(url, "tab");
-    else
-      openUILinkIn(url, "tab");
-  },
-
-  changeName: function changeName(input) {
-    // Make sure to update to a modified name, e.g., empty-string -> default
-    Weave.Service.clientsEngine.localName = input.value;
-    input.value = Weave.Service.clientsEngine.localName;
-  },
-
-  resetPassword() {
-    this._openLink(Weave.Service.pwResetURL);
-  },
-
-  get tosURL() {
-    let root = this.fxAccountsEnabled ? "fxa." : "";
-    return Weave.Svc.Prefs.get(root + "termsURL");
-  },
-
-  get privacyPolicyURL() {
-    let root = this.fxAccountsEnabled ? "fxa." : "";
-    return Weave.Svc.Prefs.get(root + "privacyURL");
-  }
-};
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -134,17 +134,16 @@ browser.jar:
         content/browser/pageinfo/feeds.js             (content/pageinfo/feeds.js)
         content/browser/pageinfo/feeds.xml            (content/pageinfo/feeds.xml)
         content/browser/pageinfo/permissions.js       (content/pageinfo/permissions.js)
         content/browser/pageinfo/security.js          (content/pageinfo/security.js)
         content/browser/sync/aboutSyncTabs.xul        (content/sync/aboutSyncTabs.xul)
         content/browser/sync/aboutSyncTabs.js         (content/sync/aboutSyncTabs.js)
         content/browser/sync/aboutSyncTabs.css        (content/sync/aboutSyncTabs.css)
         content/browser/sync/aboutSyncTabs-bindings.xml  (content/sync/aboutSyncTabs-bindings.xml)
-        content/browser/sync/utils.js                 (content/sync/utils.js)
         content/browser/safeMode.css                  (content/safeMode.css)
         content/browser/safeMode.js                   (content/safeMode.js)
         content/browser/safeMode.xul                  (content/safeMode.xul)
         content/browser/sanitize.js                   (content/sanitize.js)
 *       content/browser/sanitize.xul                  (content/sanitize.xul)
 *       content/browser/sanitizeDialog.js             (content/sanitizeDialog.js)
         content/browser/sanitizeDialog.css            (content/sanitizeDialog.css)
         content/browser/contentSearchUI.js            (content/contentSearchUI.js)
--- a/browser/components/preferences/in-content/sync.js
+++ b/browser/components/preferences/in-content/sync.js
@@ -7,21 +7,18 @@ Components.utils.import("resource://gre/
 
 XPCOMUtils.defineLazyGetter(this, "FxAccountsCommon", function() {
   return Components.utils.import("resource://gre/modules/FxAccountsCommon.js", {});
 });
 
 XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts",
   "resource://gre/modules/FxAccounts.jsm");
 
-const PAGE_NO_ACCOUNT = 0;
-const PAGE_HAS_ACCOUNT = 1;
-const PAGE_NEEDS_UPDATE = 2;
-const FXA_PAGE_LOGGED_OUT = 3;
-const FXA_PAGE_LOGGED_IN = 4;
+const FXA_PAGE_LOGGED_OUT = 0;
+const FXA_PAGE_LOGGED_IN = 1;
 
 // Indexes into the "login status" deck.
 // We are in a successful verified state - everything should work!
 const FXA_LOGIN_VERIFIED = 0;
 // We have logged in to an unverified account.
 const FXA_LOGIN_UNVERIFIED = 1;
 // We are logged in locally, but the server rejected our credentials.
 const FXA_LOGIN_FAILED = 2;
@@ -33,27 +30,16 @@ var gSyncPane = {
   get page() {
     return document.getElementById("weavePrefsDeck").selectedIndex;
   },
 
   set page(val) {
     document.getElementById("weavePrefsDeck").selectedIndex = val;
   },
 
-  get _usingCustomServer() {
-    return Weave.Svc.Prefs.isSet("serverURL");
-  },
-
-  needsUpdate() {
-    this.page = PAGE_NEEDS_UPDATE;
-    let label = document.getElementById("loginError");
-    label.textContent = Weave.Utils.getErrorString(Weave.Status.login);
-    label.className = "error";
-  },
-
   init() {
     this._setupEventListeners();
 
     // If the Service hasn't finished initializing, wait for it.
     let xps = Components.classes["@mozilla.org/weave/service;1"]
                                 .getService(Components.interfaces.nsISupports)
                                 .wrappedJSObject;
 
@@ -87,30 +73,29 @@ var gSyncPane = {
 
   _showLoadPage(xps) {
     let username;
     try {
       username = Services.prefs.getCharPref("services.sync.username");
     } catch (e) {}
     if (!username) {
       this.page = FXA_PAGE_LOGGED_OUT;
-    } else if (xps.fxAccountsEnabled) {
-      // Use cached values while we wait for the up-to-date values
-      let cachedComputerName;
-      try {
-        cachedComputerName = Services.prefs.getCharPref("services.sync.client.name");
-      } catch (e) {
-        cachedComputerName = "";
-      }
-      document.getElementById("fxaEmailAddress1").textContent = username;
-      this._populateComputerName(cachedComputerName);
-      this.page = FXA_PAGE_LOGGED_IN;
-    } else { // Old Sync
-      this.page = PAGE_HAS_ACCOUNT;
+      return;
     }
+
+    // Use cached values while we wait for the up-to-date values
+    let cachedComputerName;
+    try {
+      cachedComputerName = Services.prefs.getCharPref("services.sync.client.name");
+    } catch (e) {
+      cachedComputerName = "";
+    }
+    document.getElementById("fxaEmailAddress1").textContent = username;
+    this._populateComputerName(cachedComputerName);
+    this.page = FXA_PAGE_LOGGED_IN;
   },
 
   _init() {
     let topics = ["weave:service:login:error",
                   "weave:service:login:finish",
                   "weave:service:start-over:finish",
                   "weave:service:setup-complete",
                   "weave:service:logout:finish",
@@ -126,35 +111,29 @@ var gSyncPane = {
     }, this);
 
     window.addEventListener("unload", function() {
       topics.forEach(function(topic) {
         Weave.Svc.Obs.remove(topic, this.updateWeavePrefs, this);
       }, gSyncPane);
     });
 
-    XPCOMUtils.defineLazyGetter(this, "_stringBundle", () => {
-      return Services.strings.createBundle("chrome://browser/locale/preferences/preferences.properties");
-    });
-
     XPCOMUtils.defineLazyGetter(this, "_accountsStringBundle", () => {
       return Services.strings.createBundle("chrome://browser/locale/accounts.properties");
     });
 
     let url = Services.prefs.getCharPref("identity.mobilepromo.android") + "sync-preferences";
     document.getElementById("fxaMobilePromo-android").setAttribute("href", url);
     document.getElementById("fxaMobilePromo-android-hasFxaAccount").setAttribute("href", url);
     url = Services.prefs.getCharPref("identity.mobilepromo.ios") + "sync-preferences";
     document.getElementById("fxaMobilePromo-ios").setAttribute("href", url);
     document.getElementById("fxaMobilePromo-ios-hasFxaAccount").setAttribute("href", url);
 
-    document.getElementById("tosPP-small-ToS").setAttribute("href", gSyncUtils.tosURL);
-    document.getElementById("tosPP-normal-ToS").setAttribute("href", gSyncUtils.tosURL);
-    document.getElementById("tosPP-small-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
-    document.getElementById("tosPP-normal-PP").setAttribute("href", gSyncUtils.privacyPolicyURL);
+    document.getElementById("tosPP-small-ToS").setAttribute("href", Weave.Svc.Prefs.get("fxa.termsURL"));
+    document.getElementById("tosPP-small-PP").setAttribute("href", Weave.Svc.Prefs.get("fxa.privacyURL"));
 
     fxAccounts.promiseAccountsManageURI(this._getEntryPoint()).then(accountsManageURI => {
       document.getElementById("verifiedManage").setAttribute("href", accountsManageURI);
     });
 
     this.updateWeavePrefs();
 
     this._initProfileImageUI();
@@ -195,40 +174,16 @@ var gSyncPane = {
   },
 
   _setupEventListeners() {
     function setEventListener(aId, aEventType, aCallback) {
       document.getElementById(aId)
               .addEventListener(aEventType, aCallback.bind(gSyncPane));
     }
 
-    setEventListener("noAccountSetup", "click", function(aEvent) {
-      aEvent.stopPropagation();
-      gSyncPane.openSetup(null);
-    });
-    setEventListener("noAccountPair", "click", function(aEvent) {
-      aEvent.stopPropagation();
-      gSyncPane.openSetup("pair");
-    });
-    setEventListener("syncChangePassword", "command",
-      () => gSyncUtils.changePassword());
-    setEventListener("syncResetPassphrase", "command",
-      () => gSyncUtils.resetPassphrase());
-    setEventListener("syncReset", "command", gSyncPane.resetSync);
-    setEventListener("syncAddDeviceLabel", "click", function() {
-      gSyncPane.openAddDevice();
-      return false;
-    });
-    setEventListener("syncEnginesList", "select", function() {
-      if (this.selectedCount)
-        this.clearSelection();
-    });
-    setEventListener("syncComputerName", "change", function(e) {
-      gSyncUtils.changeName(e.target);
-    });
     setEventListener("fxaChangeDeviceName", "command", function() {
       this._toggleComputerNameControls(true);
       this._focusComputerNameTextbox();
     });
     setEventListener("fxaCancelChangeDeviceName", "command", function() {
       // We explicitly blur the textbox because of bug 75324, then after
       // changing the state of the buttons, force focus to whatever the focus
       // manager thinks should be next (which on the mac, depends on an OSX
@@ -240,32 +195,16 @@ var gSyncPane = {
     });
     setEventListener("fxaSaveChangeDeviceName", "command", function() {
       // Work around bug 75324 - see above.
       this._blurComputerNameTextbox();
       this._toggleComputerNameControls(false);
       this._updateComputerNameValue(true);
       this._focusAfterComputerNameTextbox();
     });
-    setEventListener("unlinkDevice", "click", function() {
-      gSyncPane.startOver(true);
-      return false;
-    });
-    setEventListener("loginErrorUpdatePass", "click", function() {
-      gSyncPane.updatePass();
-      return false;
-    });
-    setEventListener("loginErrorResetPass", "click", function() {
-      gSyncPane.resetPass();
-      return false;
-    });
-    setEventListener("loginErrorStartOver", "click", function() {
-      gSyncPane.startOver(true);
-      return false;
-    });
     setEventListener("noFxaSignUp", "command", function() {
       gSyncPane.signUp();
       return false;
     });
     setEventListener("noFxaSignIn", "command", function() {
       gSyncPane.signIn();
       return false;
     });
@@ -299,171 +238,114 @@ var gSyncPane = {
       }
     } catch (e) { }
   },
 
   updateWeavePrefs() {
     let service = Components.classes["@mozilla.org/weave/service;1"]
                   .getService(Components.interfaces.nsISupports)
                   .wrappedJSObject;
-    // service.fxAccountsEnabled is false iff sync is already configured for
-    // the legacy provider.
-    if (service.fxAccountsEnabled) {
-      let displayNameLabel = document.getElementById("fxaDisplayName");
-      let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
-      fxaEmailAddress1Label.hidden = false;
-      displayNameLabel.hidden = true;
+
+    let displayNameLabel = document.getElementById("fxaDisplayName");
+    let fxaEmailAddress1Label = document.getElementById("fxaEmailAddress1");
+    fxaEmailAddress1Label.hidden = false;
+    displayNameLabel.hidden = true;
 
-      let profileInfoEnabled;
-      try {
-        profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
-      } catch (ex) {}
+    let profileInfoEnabled;
+    try {
+      profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled");
+    } catch (ex) {}
 
-      // determine the fxa status...
-      this._showLoadPage(service);
+    // determine the fxa status...
+    this._showLoadPage(service);
 
-      fxAccounts.getSignedInUser().then(data => {
-        if (!data) {
-          this.page = FXA_PAGE_LOGGED_OUT;
-          return false;
-        }
-        this.page = FXA_PAGE_LOGGED_IN;
-        // We are logged in locally, but maybe we are in a state where the
-        // server rejected our credentials (eg, password changed on the server)
-        let fxaLoginStatus = document.getElementById("fxaLoginStatus");
-        let syncReady;
-        // Not Verfied implies login error state, so check that first.
-        if (!data.verified) {
-          fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
-          syncReady = false;
-        // So we think we are logged in, so login problems are next.
-        // (Although if the Sync identity manager is still initializing, we
-        // ignore login errors and assume all will eventually be good.)
-        // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
-        // All other login failures are assumed to be transient and should go
-        // away by themselves, so aren't reflected here.
-        } else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
-          fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
-          syncReady = false;
-        // Else we must be golden (or in an error state we expect to magically
-        // resolve itself)
-        } else {
-          fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
-          syncReady = true;
-        }
-        fxaEmailAddress1Label.textContent = data.email;
-        document.getElementById("fxaEmailAddress2").textContent = data.email;
-        document.getElementById("fxaEmailAddress3").textContent = data.email;
-        this._populateComputerName(Weave.Service.clientsEngine.localName);
-        let engines = document.getElementById("fxaSyncEngines")
-        for (let checkbox of engines.querySelectorAll("checkbox")) {
-          checkbox.disabled = !syncReady;
-        }
-        document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
+    fxAccounts.getSignedInUser().then(data => {
+      if (!data) {
+        this.page = FXA_PAGE_LOGGED_OUT;
+        return false;
+      }
+      this.page = FXA_PAGE_LOGGED_IN;
+      // We are logged in locally, but maybe we are in a state where the
+      // server rejected our credentials (eg, password changed on the server)
+      let fxaLoginStatus = document.getElementById("fxaLoginStatus");
+      let syncReady;
+      // Not Verfied implies login error state, so check that first.
+      if (!data.verified) {
+        fxaLoginStatus.selectedIndex = FXA_LOGIN_UNVERIFIED;
+        syncReady = false;
+      // So we think we are logged in, so login problems are next.
+      // (Although if the Sync identity manager is still initializing, we
+      // ignore login errors and assume all will eventually be good.)
+      // LOGIN_FAILED_LOGIN_REJECTED explicitly means "you must log back in".
+      // All other login failures are assumed to be transient and should go
+      // away by themselves, so aren't reflected here.
+      } else if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
+        fxaLoginStatus.selectedIndex = FXA_LOGIN_FAILED;
+        syncReady = false;
+      // Else we must be golden (or in an error state we expect to magically
+      // resolve itself)
+      } else {
+        fxaLoginStatus.selectedIndex = FXA_LOGIN_VERIFIED;
+        syncReady = true;
+      }
+      fxaEmailAddress1Label.textContent = data.email;
+      document.getElementById("fxaEmailAddress2").textContent = data.email;
+      document.getElementById("fxaEmailAddress3").textContent = data.email;
+      this._populateComputerName(Weave.Service.clientsEngine.localName);
+      let engines = document.getElementById("fxaSyncEngines")
+      for (let checkbox of engines.querySelectorAll("checkbox")) {
+        checkbox.disabled = !syncReady;
+      }
+      document.getElementById("fxaChangeDeviceName").disabled = !syncReady;
 
-        // Clear the profile image (if any) of the previously logged in account.
-        document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
+      // Clear the profile image (if any) of the previously logged in account.
+      document.getElementById("fxaProfileImage").style.removeProperty("list-style-image");
 
-        // If the account is verified the next promise in the chain will
-        // fetch profile data.
-        return data.verified;
-      }).then(isVerified => {
-        if (isVerified) {
-          return fxAccounts.getSignedInUserProfile();
-        }
-        return null;
-      }).then(data => {
-        let fxaLoginStatus = document.getElementById("fxaLoginStatus");
-        if (data && profileInfoEnabled) {
-          if (data.displayName) {
-            fxaLoginStatus.setAttribute("hasName", true);
-            displayNameLabel.hidden = false;
-            displayNameLabel.textContent = data.displayName;
-          } else {
-            fxaLoginStatus.removeAttribute("hasName");
-          }
-          if (data.avatar) {
-            let bgImage = "url(\"" + data.avatar + "\")";
-            let profileImageElement = document.getElementById("fxaProfileImage");
-            profileImageElement.style.listStyleImage = bgImage;
-
-            let img = new Image();
-            img.onerror = () => {
-              // Clear the image if it has trouble loading. Since this callback is asynchronous
-              // we check to make sure the image is still the same before we clear it.
-              if (profileImageElement.style.listStyleImage === bgImage) {
-                profileImageElement.style.removeProperty("list-style-image");
-              }
-            };
-            img.src = data.avatar;
-          }
+      // If the account is verified the next promise in the chain will
+      // fetch profile data.
+      return data.verified;
+    }).then(isVerified => {
+      if (isVerified) {
+        return fxAccounts.getSignedInUserProfile();
+      }
+      return null;
+    }).then(data => {
+      let fxaLoginStatus = document.getElementById("fxaLoginStatus");
+      if (data && profileInfoEnabled) {
+        if (data.displayName) {
+          fxaLoginStatus.setAttribute("hasName", true);
+          displayNameLabel.hidden = false;
+          displayNameLabel.textContent = data.displayName;
         } else {
           fxaLoginStatus.removeAttribute("hasName");
         }
-      }, err => {
-        FxAccountsCommon.log.error(err);
-      }).catch(err => {
-        // If we get here something's really busted
-        Cu.reportError(String(err));
-      });
-
-    // If fxAccountEnabled is false and we are in a "not configured" state,
-    // then fxAccounts is probably fully disabled rather than just unconfigured,
-    // so handle this case.  This block can be removed once we remove support
-    // for fxAccounts being disabled.
-    } else if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED ||
-               Weave.Svc.Prefs.get("firstSync", "") == "notReady") {
-      this.page = PAGE_NO_ACCOUNT;
-    // else: sync was previously configured for the legacy provider, so we
-    // make the "old" panels available.
-    } else if (Weave.Status.login == Weave.LOGIN_FAILED_INVALID_PASSPHRASE ||
-               Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED) {
-      this.needsUpdate();
-    } else {
-      this.page = PAGE_HAS_ACCOUNT;
-      document.getElementById("accountName").textContent = Weave.Service.identity.account;
-      document.getElementById("syncComputerName").value = Weave.Service.clientsEngine.localName;
-      document.getElementById("tosPP-normal").hidden = this._usingCustomServer;
-    }
-  },
+        if (data.avatar) {
+          let bgImage = "url(\"" + data.avatar + "\")";
+          let profileImageElement = document.getElementById("fxaProfileImage");
+          profileImageElement.style.listStyleImage = bgImage;
 
-  startOver(showDialog) {
-    if (showDialog) {
-      let flags = Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING +
-                  Services.prompt.BUTTON_POS_1 * Services.prompt.BUTTON_TITLE_CANCEL +
-                  Services.prompt.BUTTON_POS_1_DEFAULT;
-      let buttonChoice =
-        Services.prompt.confirmEx(window,
-                                  this._stringBundle.GetStringFromName("syncUnlink.title"),
-                                  this._stringBundle.GetStringFromName("syncUnlink.label"),
-                                  flags,
-                                  this._stringBundle.GetStringFromName("syncUnlinkConfirm.label"),
-                                  null, null, null, {});
-
-      // If the user selects cancel, just bail
-      if (buttonChoice == 1)
-        return;
-    }
-
-    Weave.Service.startOver();
-    this.updateWeavePrefs();
-  },
-
-  updatePass() {
-    if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED)
-      gSyncUtils.changePassword();
-    else
-      gSyncUtils.updatePassphrase();
-  },
-
-  resetPass() {
-    if (Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED)
-      gSyncUtils.resetPassword();
-    else
-      gSyncUtils.resetPassphrase();
+          let img = new Image();
+          img.onerror = () => {
+            // Clear the image if it has trouble loading. Since this callback is asynchronous
+            // we check to make sure the image is still the same before we clear it.
+            if (profileImageElement.style.listStyleImage === bgImage) {
+              profileImageElement.style.removeProperty("list-style-image");
+            }
+          };
+          img.src = data.avatar;
+        }
+      } else {
+        fxaLoginStatus.removeAttribute("hasName");
+      }
+    }, err => {
+      FxAccountsCommon.log.error(err);
+    }).catch(err => {
+      // If we get here something's really busted
+      Cu.reportError(String(err));
+    });
   },
 
   _getEntryPoint() {
     let params = new URLSearchParams(document.URL.split("#")[0].split("?")[1] || "");
     return params.get("entrypoint") || "preferences";
   },
 
   _openAboutAccounts(action) {
@@ -472,51 +354,20 @@ var gSyncPane = {
     if (action) {
       params.set("action", action);
     }
     params.set("entrypoint", entryPoint);
 
     this.replaceTabWithUrl("about:accounts?" + params);
   },
 
-  /**
-   * Invoke the Sync setup wizard.
-   *
-   * @param wizardType
-   *        Indicates type of wizard to launch:
-   *          null    -- regular set up wizard
-   *          "pair"  -- pair a device first
-   *          "reset" -- reset sync
-   */
-  openSetup(wizardType) {
-    let service = Components.classes["@mozilla.org/weave/service;1"]
-                  .getService(Components.interfaces.nsISupports)
-                  .wrappedJSObject;
-
-    if (service.fxAccountsEnabled) {
-      this._openAboutAccounts();
-    } else {
-      let win = Services.wm.getMostRecentWindow("Weave:AccountSetup");
-      if (win)
-        win.focus();
-      else {
-        window.openDialog("chrome://browser/content/sync/setup.xul",
-                          "weaveSetup", "centerscreen,chrome,resizable=no",
-                          wizardType);
-      }
-    }
-  },
-
   openContentInBrowser(url, options) {
     let win = Services.wm.getMostRecentWindow("navigator:browser");
     if (!win) {
-      // no window to use, so use _openLink to create a new one.  We don't
-      // always use that as it prefers to open a new window rather than use
-      // an existing one.
-      gSyncUtils._openLink(url);
+      openUILinkIn(url, "tab");
       return;
     }
     win.switchToTabHavingURI(url, true, options);
   },
 
   // Replace the current tab with the specified URL.
   replaceTabWithUrl(url) {
     // Get the <browser> element hosting us.
@@ -602,21 +453,16 @@ var gSyncPane = {
       }
     };
 
     fxAccounts.resendVerificationEmail()
       .then(fxAccounts.getSignedInUser, onError)
       .then(onSuccess, onError);
   },
 
-  openOldSyncSupportPage() {
-    let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "old-sync";
-    this.openContentInBrowser(url);
-  },
-
   unlinkFirefoxAccount(confirm) {
     if (confirm) {
       // We use a string bundle shared with aboutAccounts.
       let sb = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");
       let disconnectLabel = sb.GetStringFromName("disconnect.label");
       let title = sb.GetStringFromName("disconnect.verify.title");
       let body = sb.GetStringFromName("disconnect.verify.bodyHeading") +
                  "\n\n" +
@@ -639,32 +485,16 @@ var gSyncPane = {
         return;
       }
     }
     fxAccounts.signOut().then(() => {
       this.updateWeavePrefs();
     });
   },
 
-  openAddDevice() {
-    if (!Weave.Utils.ensureMPUnlocked())
-      return;
-
-    let win = Services.wm.getMostRecentWindow("Sync:AddDevice");
-    if (win)
-      win.focus();
-    else
-      window.openDialog("chrome://browser/content/sync/addDevice.xul",
-                        "syncAddDevice", "centerscreen,chrome,resizable=no");
-  },
-
-  resetSync() {
-    this.openSetup("reset");
-  },
-
   _populateComputerName(value) {
     let textbox = document.getElementById("fxaSyncComputerName");
     if (!textbox.hasAttribute("placeholder")) {
       textbox.setAttribute("placeholder",
                            Weave.Utils.getDefaultDeviceName());
     }
     textbox.value = value;
   },
--- a/browser/components/preferences/in-content/sync.xul
+++ b/browser/components/preferences/in-content/sync.xul
@@ -22,160 +22,26 @@
               type="bool"/>
   <preference id="engine.passwords"
               name="services.sync.engine.passwords"
               type="bool"/>
 </preferences>
 
 <script type="application/javascript"
         src="chrome://browser/content/preferences/in-content/sync.js"/>
-<script type="application/javascript"
-        src="chrome://browser/content/sync/utils.js"/>
 
 <hbox id="header-sync"
       class="header"
       hidden="true"
       data-category="paneSync">
   <label class="header-name" flex="1">&paneSync.title;</label>
   <html:a class="help-button text-link" target="_blank" aria-label="&helpButton.label;"></html:a>
 </hbox>
 
 <deck id="weavePrefsDeck" data-category="paneSync" hidden="true">
-  <!-- These panels are for the "legacy" sync provider -->
-  <vbox id="noAccount" align="center">
-    <spacer flex="1"/>
-    <description id="syncDesc">
-      &weaveDesc.label;
-    </description>
-    <separator/>
-    <label id="noAccountSetup" class="text-link">
-      &setupButton.label;
-    </label>
-    <vbox id="pairDevice">
-      <separator/>
-      <label id="noAccountPair" class="text-link">
-        &pairDevice.label;
-      </label>
-    </vbox>
-    <spacer flex="3"/>
-  </vbox>
-
-  <vbox id="hasAccount">
-    <groupbox class="syncGroupBox">
-      <!-- label is set to account name -->
-      <caption id="accountCaption" align="center">
-        <image id="accountCaptionImage"/>
-        <label id="accountName"/>
-      </caption>
-
-      <hbox>
-        <button type="menu"
-                label="&manageAccount.label;"
-                accesskey="&manageAccount.accesskey;">
-          <menupopup>
-            <menuitem id="syncChangePassword" label="&changePassword2.label;"/>
-            <menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/>
-            <menuseparator/>
-            <menuitem id="syncReset" label="&resetSync2.label;"/>
-          </menupopup>
-        </button>
-      </hbox>
-
-      <hbox>
-        <label id="syncAddDeviceLabel"
-               class="text-link">
-          &pairDevice.label;
-        </label>
-      </hbox>
-
-      <vbox>
-        <label>&syncMy.label;</label>
-        <richlistbox id="syncEnginesList"
-                     orient="vertical">
-          <richlistitem>
-            <checkbox label="&engine.addons.label;"
-                      accesskey="&engine.addons.accesskey;"
-                      preference="engine.addons"/>
-          </richlistitem>
-          <richlistitem>
-            <checkbox label="&engine.bookmarks.label;"
-                      accesskey="&engine.bookmarks.accesskey;"
-                      preference="engine.bookmarks"/>
-          </richlistitem>
-          <richlistitem>
-            <checkbox label="&engine.passwords.label;"
-                      accesskey="&engine.passwords.accesskey;"
-                      preference="engine.passwords"/>
-          </richlistitem>
-          <richlistitem>
-            <checkbox label="&engine.prefs.label;"
-                      accesskey="&engine.prefs.accesskey;"
-                      preference="engine.prefs"/>
-          </richlistitem>
-          <richlistitem>
-            <checkbox label="&engine.history.label;"
-                      accesskey="&engine.history.accesskey;"
-                      preference="engine.history"/>
-          </richlistitem>
-          <richlistitem>
-            <checkbox label="&engine.tabs.label2;"
-                      accesskey="&engine.tabs.accesskey;"
-                      preference="engine.tabs"/>
-          </richlistitem>
-        </richlistbox>
-      </vbox>
-    </groupbox>
-
-    <groupbox class="syncGroupBox">
-      <grid>
-        <columns>
-          <column/>
-          <column flex="1"/>
-        </columns>
-        <rows>
-          <row align="center">
-            <label control="syncComputerName">
-              &syncDeviceName.label;
-            </label>
-            <textbox id="syncComputerName"/>
-          </row>
-        </rows>
-      </grid>
-      <hbox>
-        <label id="unlinkDevice" class="text-link">
-          &unlinkDevice.label;
-        </label>
-      </hbox>
-    </groupbox>
-    <vbox id="tosPP-normal">
-      <label id="tosPP-normal-ToS" class="text-link">
-        &prefs.tosLink.label;
-      </label>
-      <label id="tosPP-normal-PP" class="text-link">
-        &prefs.ppLink.label;
-      </label>
-    </vbox>
-  </vbox>
-
-  <vbox id="needsUpdate" align="center" pack="center">
-    <hbox>
-      <label id="loginError"/>
-      <label id="loginErrorUpdatePass" class="text-link">
-        &updatePass.label;
-      </label>
-      <label id="loginErrorResetPass" class="text-link">
-        &resetPass.label;
-      </label>
-    </hbox>
-    <label id="loginErrorStartOver" class="text-link">
-      &unlinkDevice.label;
-    </label>
-  </vbox>
-
-  <!-- These panels are for the Firefox Accounts identity provider -->
   <vbox id="noFxaAccount">
     <hbox>
       <vbox id="fxaContentWrapper">
         <groupbox id="noFxaGroup">
           <vbox>
             <label id="noFxaCaption">&signedOut.caption;</label>
             <description id="noFxaDescription" flex="1">&signedOut.description;</description>
             <hbox class="fxaAccountBox">
--- a/browser/locales/en-US/chrome/browser/preferences/preferences.properties
+++ b/browser/locales/en-US/chrome/browser/preferences/preferences.properties
@@ -172,20 +172,16 @@ actualAppCacheSize=Your application cach
 totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
 clearSiteDataPromptTitle=Clear all cookies and site data
 clearSiteDataPromptText=Selecting ‘Clear Now’ will clear all cookies and site data stored by Firefox. This may sign you out of websites and remove offline web content.
 clearSiteDataNow=Clear Now
 important=Important
 default=Default
 siteUsage=%1$S %2$S
 
-syncUnlink.title=Do you want to unlink your device?
-syncUnlink.label=This device will no longer be associated with your Sync account. All of your personal data, both on this device and in your Sync account, will remain intact.
-syncUnlinkConfirm.label=Unlink
-
 # LOCALIZATION NOTE (featureEnableRequiresRestart, featureDisableRequiresRestart, restartTitle): %S = brandShortName
 featureEnableRequiresRestart=%S must restart to enable this feature.
 featureDisableRequiresRestart=%S must restart to disable this feature.
 shouldRestartTitle=Restart %S
 okToRestartButton=Restart %S now
 revertNoRestartButton=Revert
 
 restartNow=Restart Now
--- a/browser/locales/en-US/chrome/browser/preferences/sync.dtd
+++ b/browser/locales/en-US/chrome/browser/preferences/sync.dtd
@@ -1,64 +1,39 @@
 <!-- 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/. -->
 
-<!-- The page shown when not logged in... -->
-<!ENTITY setupButton.label          "Set Up &syncBrand.fullName.label;">
-<!ENTITY setupButton.accesskey      "S">
-<!ENTITY weaveDesc.label            "&syncBrand.fullName.label; lets you access your history, bookmarks, passwords and open tabs across all your devices.">
-
 <!-- The page shown when logged in... -->
 
-<!-- Login error feedback -->
-<!ENTITY updatePass.label             "Update">
-<!ENTITY resetPass.label              "Reset">
-
-<!-- Manage Account -->
-<!ENTITY manageAccount.label          "Manage Account">
-<!ENTITY manageAccount.accesskey      "n">
-<!ENTITY changePassword2.label        "Change Password…">
-<!ENTITY myRecoveryKey.label          "My Recovery Key">
-<!ENTITY resetSync2.label             "Reset Sync…">
-
-<!ENTITY pairDevice.label             "Pair a Device">
-
-<!ENTITY syncMy.label               "Sync My">
 <!ENTITY engine.bookmarks.label     "Bookmarks">
 <!ENTITY engine.bookmarks.accesskey "m">
 <!ENTITY engine.tabs.label2         "Open Tabs">
 <!ENTITY engine.tabs.accesskey      "T">
 <!ENTITY engine.history.label       "History">
 <!ENTITY engine.history.accesskey   "r">
 <!ENTITY engine.passwords.label     "Passwords">
 <!ENTITY engine.passwords.accesskey "P">
 <!ENTITY engine.prefs.label         "Preferences">
 <!ENTITY engine.prefs.accesskey     "S">
 <!ENTITY engine.addons.label        "Add-ons">
 <!ENTITY engine.addons.accesskey    "A">
 
 <!-- Device Settings -->
-<!ENTITY syncDeviceName.label       "Device Name:">
 <!ENTITY fxaSyncDeviceName.label       "Device Name">
 <!ENTITY changeSyncDeviceName.label "Change Device Name…">
 <!ENTITY changeSyncDeviceName.accesskey "h">
 <!ENTITY cancelChangeSyncDeviceName.label "Cancel">
 <!ENTITY cancelChangeSyncDeviceName.accesskey "n">
 <!ENTITY saveChangeSyncDeviceName.label "Save">
 <!ENTITY saveChangeSyncDeviceName.accesskey "v">
-<!ENTITY unlinkDevice.label           "Unlink This Device">
 
 <!-- Footer stuff -->
 <!ENTITY prefs.tosLink.label        "Terms of Service">
-<!ENTITY prefs.ppLink.label         "Privacy Policy">
-
-<!-- Firefox Accounts stuff -->
 <!ENTITY fxaPrivacyNotice.link.label "Privacy Notice">
-<!ENTITY determiningAcctStatus.label     "Determining your account status…">
 
 <!-- LOCALIZATION NOTE (signedInUnverified.beforename.label,
 signedInUnverified.aftername.label): these two string are used respectively
 before and after the account email address. Localizers can use one of them, or
 both, to better adapt this sentence to their language.
 -->
 <!ENTITY signedInUnverified.beforename.label "">
 <!ENTITY signedInUnverified.aftername.label "is not verified.">
@@ -79,22 +54,16 @@ both, to better adapt this sentence to t
 <!ENTITY verifiedManage.accesskey    "o">
 <!ENTITY disconnect.label            "Disconnect…">
 <!ENTITY disconnect.accesskey        "D">
 <!ENTITY verify.label                "Verify Email">
 <!ENTITY verify.accesskey            "V">
 <!ENTITY forget.label                "Forget this Email">
 <!ENTITY forget.accesskey            "F">
 
-<!ENTITY welcome.description "Access your tabs, bookmarks, passwords and more wherever you use &brandShortName;.">
-<!ENTITY welcome.signIn.label "Sign In">
-<!ENTITY welcome.createAccount.label "Create Account">
-
-<!ENTITY welcome.useOldSync.label "Using an older version of Sync?">
-
 <!ENTITY signedOut.caption            "Take Your Web With You">
 <!ENTITY signedOut.description        "Synchronize your bookmarks, history, tabs, passwords, add-ons, and preferences across all your devices.">
 <!ENTITY signedOut.accountBox.title   "Connect with a &syncBrand.fxAccount.label;">
 <!ENTITY signedOut.accountBox.create  "Create Account">
 <!ENTITY signedOut.accountBox.create.accesskey  "C">
 <!ENTITY signedOut.accountBox.signin  "Sign In">
 <!ENTITY signedOut.accountBox.signin.accesskey  "I">
 
--- a/browser/themes/linux/preferences/preferences.css
+++ b/browser/themes/linux/preferences/preferences.css
@@ -78,28 +78,15 @@
  * Clear Private Data
  */
 #SanitizeDialogPane > groupbox {
   margin-top: 0;
 }
 
 /* Sync Pane */
 
-#syncDesc {
-  padding: 0 8em;
-}
-
-#accountCaptionImage {
-  list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
-}
-
-#syncAddDeviceLabel {
-  margin-top: 1em;
-  margin-bottom: 1em;
-}
-
 #noFxaAccount {
   line-height: 1.2em;
 }
 
 #noFxaAccount > label:first-child {
   margin-bottom: 0.6em;
 }
--- a/browser/themes/osx/preferences/preferences.css
+++ b/browser/themes/osx/preferences/preferences.css
@@ -103,28 +103,15 @@ caption {
  */
 #SanitizeDialogPane > groupbox {
   margin-top: 0;
 }
 
 
 /* ----- SYNC PANE ----- */
 
-#syncDesc {
-  padding: 0 8em;
-}
-
-#accountCaptionImage {
-  list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
-}
-
-#syncAddDeviceLabel {
-  margin-top: 1em;
-  margin-bottom: 1em;
-}
-
 #noFxaAccount {
   line-height: 1.2em;
 }
 
 #noFxaAccount > label:first-child {
   margin-bottom: 0.6em;
 }
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -243,38 +243,33 @@ treecol {
   font-size: 1em !important;
   margin-left: 0;
 }
 
 /* Collapse the non-active vboxes in decks to use only the height the
    active vbox needs */
 #historyPane:not([selectedIndex="1"]) > #historyDontRememberPane,
 #historyPane:not([selectedIndex="2"]) > #historyCustomPane,
-#weavePrefsDeck:not([selectedIndex="1"]) > #hasAccount,
-#weavePrefsDeck:not([selectedIndex="2"]) > #needsUpdate,
-#weavePrefsDeck:not([selectedIndex="3"]) > #noFxaAccount,
-#weavePrefsDeck:not([selectedIndex="4"]) > #hasFxaAccount,
+#weavePrefsDeck:not([selectedIndex="1"]) > #hasFxaAccount,
 #fxaLoginStatus:not([selectedIndex="1"]) > #fxaLoginUnverified,
 #fxaLoginStatus:not([selectedIndex="2"]) > #fxaLoginRejected {
   visibility: collapse;
 }
 
 /* XXX This style is for bug 740213 and should be removed once that
    bug has a solution. */
 description > html|a {
   cursor: pointer;
 }
 
 #weavePrefsDeck > vbox > label,
 #weavePrefsDeck > vbox > groupbox,
 #weavePrefsDeck > vbox > description,
-#weavePrefsDeck > vbox > #pairDevice > label,
-#weavePrefsDeck > #needsUpdate > hbox > #loginError,
 #weavePrefsDeck > #hasFxaAccount > vbox > label,
-#weavePrefsDeck > #hasFxaAccount > hbox:not(#tosPP-normal) > label {
+#weavePrefsDeck > #hasFxaAccount > hbox > label {
   /* no margin-inline-start for elements at the beginning of a line */
   margin-inline-start: 0;
 }
 
 #tabsElement {
   margin-inline-end: 4px; /* add the 4px end-margin of other elements */
 }
 
--- a/browser/themes/windows/preferences/preferences.css
+++ b/browser/themes/windows/preferences/preferences.css
@@ -65,32 +65,15 @@
 /* bottom-most box containing a groupbox in a prefpane. Prevents the bottom
    of the groupbox from being cutoff */
 .bottomBox {
   padding-bottom: 4px;
 }
 
 /* Sync Pane */
 
-#syncDesc {
-  padding: 0 8em;
-}
-
-.syncGroupBox {
-  padding: 10px;
-}
-
-#accountCaptionImage {
-  list-style-image: url("chrome://mozapps/skin/profile/profileicon.png");
-}
-
-#syncAddDeviceLabel {
-  margin-top: 1em;
-  margin-bottom: 1em;
-}
-
 #noFxaAccount {
   line-height: 1.2em;
 }
 
 #noFxaAccount > label:first-child {
   margin-bottom: 0.6em;
 }
--- a/services/sync/services-sync.js
+++ b/services/sync/services-sync.js
@@ -1,16 +1,14 @@
 /* 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/. */
 
 pref("services.sync.serverURL", "https://auth.services.mozilla.com/");
 pref("services.sync.miscURL", "misc/");
-pref("services.sync.termsURL", "https://services.mozilla.com/tos/");
-pref("services.sync.privacyURL", "https://services.mozilla.com/privacy-policy/");
 pref("services.sync.statusURL", "https://services.mozilla.com/status/");
 pref("services.sync.syncKeyHelpURL", "https://services.mozilla.com/help/synckey");
 
 pref("services.sync.lastversion", "firstrun");
 pref("services.sync.sendVersionInfo", true);
 
 pref("services.sync.scheduler.eolInterval", 604800); // 1 week
 pref("services.sync.scheduler.idleInterval", 3600);  // 1 hour