[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-38.1.0esr-5.0-1] Bug 16488: Remove "Sign in to Sync" from the menu.



commit 1bde4135dc8dad312e3f8823480545f61af47171
Author: Kathy Brade <brade@xxxxxxxxxxxxxxxxx>
Date:   Tue Jul 28 17:11:12 2015 -0400

    Bug 16488:  Remove "Sign in to Sync" from the menu.
    
    By default, hide the "Sign in to Sync" item (aka the Firefox Sync
    status item) within the hamburger menu.
    Unhide by setting the pref. services.sync.ui.hidden to false.
---
 browser/app/profile/000-tor-browser.js     |    1 +
 browser/base/content/browser-fxaccounts.js |   14 +++++++++++++-
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/browser/app/profile/000-tor-browser.js b/browser/app/profile/000-tor-browser.js
index 8188855..d57a3e2 100644
--- a/browser/app/profile/000-tor-browser.js
+++ b/browser/app/profile/000-tor-browser.js
@@ -60,6 +60,7 @@ pref("browser.syncPromoViewsLeftMap", "{\"addons\":0, \"passwords\":0, \"bookmar
 pref("services.sync.engine.prefs", false); // Never sync prefs, addons, or tabs with other browsers
 pref("services.sync.engine.addons", false);
 pref("services.sync.engine.tabs", false);
+pref("services.sync.ui.hidden", true);
 pref("extensions.getAddons.cache.enabled", false); // https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/
 pref("browser.newtabpage.directory.ping", "data:text/plain,"); // Bug 16316 - Avoid potential confusion over tiles for now.
 pref("browser.newtabpage.directory.source", "data:text/plain,"); // Bug 16316 - Avoid potential confusion over tiles for now.
diff --git a/browser/base/content/browser-fxaccounts.js b/browser/base/content/browser-fxaccounts.js
index d6cbccc..760f261 100644
--- a/browser/base/content/browser-fxaccounts.js
+++ b/browser/base/content/browser-fxaccounts.js
@@ -5,6 +5,7 @@
 let gFxAccounts = {
 
   PREF_SYNC_START_DOORHANGER: "services.sync.ui.showSyncStartDoorhanger",
+  PREF_SYNC_UI_HIDDEN: "services.sync.ui.hidden",
   DOORHANGER_ACTIVATE_DELAY_MS: 5000,
   SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration",
 
@@ -80,6 +81,8 @@ let gFxAccounts = {
       Services.obs.addObserver(this, topic, false);
     }
 
+    Services.prefs.addObserver(this.PREF_SYNC_UI_HIDDEN, this, false);
+
     addEventListener("activate", this);
     gNavToolbox.addEventListener("customizationstarting", this);
     gNavToolbox.addEventListener("customizationending", this);
@@ -102,6 +105,8 @@ let gFxAccounts = {
       Services.obs.removeObserver(this, topic);
     }
 
+    Services.prefs.removeObserver(this.PREF_SYNC_UI_HIDDEN, this);
+
     this._initialized = false;
   },
 
@@ -126,6 +131,9 @@ let gFxAccounts = {
           this.fxaMigrator.recordTelemetry(this.fxaMigrator.TELEMETRY_DECLINED);
         }
         break;
+      case this.PREF_SYNC_UI_HIDDEN:
+        this.updateAppMenuItem();
+        break;
       default:
         this.updateUI();
         break;
@@ -203,7 +211,11 @@ let gFxAccounts = {
     }
 
     // Bail out if FxA is disabled.
-    if (!this.weave.fxAccountsEnabled) {
+    let hideSyncUI = false;
+    try {
+      hideSyncUI = Services.prefs.getBoolPref(this.PREF_SYNC_UI_HIDDEN);
+    } catch (e) {}
+    if (hideSyncUI || !this.weave.fxAccountsEnabled) {
       // When migration transitions from needs-verification to the null state,
       // fxAccountsEnabled is false because migration has not yet finished.  In
       // that case, hide the button.  We'll get another notification with a null



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits