From 361e70ce0285465662bf3637949d2e9c6b54fc44 Mon Sep 17 00:00:00 2001 From: Kathy Brade Date: Tue, 28 Jul 2015 17:11:12 -0400 Subject: [PATCH] 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 e28028c6e48d0..2c5f94bf30830 100644 --- a/browser/app/profile/000-tor-browser.js +++ b/browser/app/profile/000-tor-browser.js @@ -101,6 +101,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 0bbce3e26dd4f..1eda9f304f7ce 100644 --- a/browser/base/content/browser-fxaccounts.js +++ b/browser/base/content/browser-fxaccounts.js @@ -5,6 +5,7 @@ var gFxAccounts = { SYNC_MIGRATION_NOTIFICATION_TITLE: "fxa-migration", + PREF_SYNC_UI_HIDDEN: "services.sync.ui.hidden", _initialized: false, _inCustomizationMode: false, @@ -99,6 +100,8 @@ var gFxAccounts = { Services.obs.addObserver(this, topic, false); } + Services.prefs.addObserver(this.PREF_SYNC_UI_HIDDEN, this, false); + gNavToolbox.addEventListener("customizationstarting", this); gNavToolbox.addEventListener("customizationending", this); @@ -117,6 +120,8 @@ var gFxAccounts = { Services.obs.removeObserver(this, topic); } + Services.prefs.removeObserver(this.PREF_SYNC_UI_HIDDEN, this); + this._initialized = false; }, @@ -125,6 +130,9 @@ var gFxAccounts = { case "fxa-migration:state-changed": this.onMigrationStateChanged(data, subject); break; + case this.PREF_SYNC_UI_HIDDEN: + this.updateAppMenuItem(); + break; case this.FxAccountsCommon.ON_PROFILE_CHANGE_NOTIFICATION: this._cachedProfile = null; // Fallthrough intended @@ -202,7 +210,11 @@ var gFxAccounts = { } catch (e) { } // 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) { return Promise.resolve(); } -- GitLab