From 8e44bbb43789e585fab9fc1ce8becc94b45d566c Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Mon, 17 Dec 2018 03:51:39 +0100 Subject: Stub out FxA context menu functions. Tag #812 --- .../basilisk/base/content/browser-fxaccounts.js | 82 +--------------------- 1 file changed, 2 insertions(+), 80 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js index cfd9758b6..e1d556bff 100644 --- a/application/basilisk/base/content/browser-fxaccounts.js +++ b/application/basilisk/base/content/browser-fxaccounts.js @@ -77,15 +77,6 @@ var gFxAccounts = { return Weave.Status.login == Weave.LOGIN_FAILED_LOGIN_REJECTED; }, - get sendTabToDeviceEnabled() { - return Services.prefs.getBoolPref("services.sync.sendTabToDevice.enabled"); - }, - - get remoteClients() { - return Weave.Service.clientsEngine.remoteClients - .sort((a, b) => a.name.localeCompare(b.name)); - }, - init: function () { // Bail out if we're already initialized and for pop-up windows. if (this._initialized || !window.toolbar.visible) { @@ -303,81 +294,12 @@ var gFxAccounts = { this.openAccountsPage("reauth", { entrypoint: entryPoint }); }, - sendTabToDevice: function (url, clientId, title) { - Weave.Service.clientsEngine.sendURIToClientForDisplay(url, clientId, title); - }, - - populateSendTabToDevicesMenu: function (devicesPopup, url, title) { - // remove existing menu items - while (devicesPopup.hasChildNodes()) { - devicesPopup.removeChild(devicesPopup.firstChild); - } - - const fragment = document.createDocumentFragment(); - - const onTargetDeviceCommand = (event) => { - const clientId = event.target.getAttribute("clientId"); - const clients = clientId - ? [clientId] - : this.remoteClients.map(client => client.id); - - clients.forEach(clientId => this.sendTabToDevice(url, clientId, title)); - } - - function addTargetDevice(clientId, name) { - const targetDevice = document.createElement("menuitem"); - targetDevice.addEventListener("command", onTargetDeviceCommand, true); - targetDevice.setAttribute("class", "sendtab-target"); - targetDevice.setAttribute("clientId", clientId); - targetDevice.setAttribute("label", name); - fragment.appendChild(targetDevice); - } - - const clients = this.remoteClients; - for (let client of clients) { - addTargetDevice(client.id, client.name); - } - - // "All devices" menu item - if (clients.length > 1) { - const separator = document.createElement("menuseparator"); - fragment.appendChild(separator); - const allDevicesLabel = this.strings.GetStringFromName("sendTabToAllDevices.menuitem"); - addTargetDevice("", allDevicesLabel); - } - - devicesPopup.appendChild(fragment); - }, - updateTabContextMenu: function (aPopupMenu) { - if (!this.sendTabToDeviceEnabled) { - return; - } - - const remoteClientPresent = this.remoteClients.length > 0; - ["context_sendTabToDevice", "context_sendTabToDevice_separator"] - .forEach(id => { document.getElementById(id).hidden = !remoteClientPresent }); + // STUB }, initPageContextMenu: function (contextMenu) { - if (!this.sendTabToDeviceEnabled) { - return; - } - - const remoteClientPresent = this.remoteClients.length > 0; - // showSendLink and showSendPage are mutually exclusive - const showSendLink = remoteClientPresent - && (contextMenu.onSaveableLink || contextMenu.onPlainTextLink); - const showSendPage = !showSendLink && remoteClientPresent - && !(contextMenu.isContentSelected || - contextMenu.onImage || contextMenu.onCanvas || - contextMenu.onVideo || contextMenu.onAudio || - contextMenu.onLink || contextMenu.onTextInput); - - ["context-sendpagetodevice", "context-sep-sendpagetodevice"] - .forEach(id => contextMenu.showItem(id, showSendPage)); - ["context-sendlinktodevice", "context-sep-sendlinktodevice"] - .forEach(id => contextMenu.showItem(id, showSendLink)); + // STUB } }; -- cgit v1.2.3 From 4c431486433428b18610c3578b693f3e1f1136eb Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 13 Mar 2019 09:50:54 +0100 Subject: Remove CloudSync Tag #812 --- application/basilisk/base/content/browser-syncui.js | 11 ----------- application/basilisk/base/content/sync/aboutSyncTabs.js | 14 -------------- 2 files changed, 25 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index 3a57140f2..000c8f7b4 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -4,11 +4,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -#ifdef MOZ_SERVICES_CLOUDSYNC -XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -#endif - XPCOMUtils.defineLazyModuleGetter(this, "fxAccounts", "resource://gre/modules/FxAccounts.jsm"); @@ -171,13 +166,7 @@ var gSyncUI = { document.getElementById("sync-setup-state").hidden = true; document.getElementById("sync-syncnow-state").hidden = true; -#ifdef MOZ_SERVICES_CLOUDSYNC - if (CloudSync && CloudSync.ready && CloudSync().adapters.count) { - document.getElementById("sync-syncnow-state").hidden = false; - } else if (loginFailed) { -#else if (loginFailed) { -#endif // unhiding this element makes the menubar show the login failure state. document.getElementById("sync-reauth-state").hidden = false; } else if (needsSetup) { diff --git a/application/basilisk/base/content/sync/aboutSyncTabs.js b/application/basilisk/base/content/sync/aboutSyncTabs.js index f4bb607ea..08986f73f 100644 --- a/application/basilisk/base/content/sync/aboutSyncTabs.js +++ b/application/basilisk/base/content/sync/aboutSyncTabs.js @@ -14,11 +14,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); -#ifdef MOZ_SERVICES_CLOUDSYNC -XPCOMUtils.defineLazyModuleGetter(this, "CloudSync", - "resource://gre/modules/CloudSync.jsm"); -#endif - var RemoteTabViewer = { _tabsList: null, @@ -183,16 +178,7 @@ var RemoteTabViewer = { } } -#ifdef MOZ_SERVICES_CLOUDSYNC - if (CloudSync && CloudSync.ready && CloudSync().tabsReady && CloudSync().tabs.hasRemoteTabs()) { - this._generateCloudSyncTabList() - .then(complete, complete); - } else { - complete(); - } -#else complete(); -#endif }, _clearTabList: function () { -- cgit v1.2.3 From f999f544aad04069b03704d994a99352263f600b Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 13 Mar 2019 16:36:55 +0100 Subject: Remove fxAccountsEnabled checks. Tag #812 --- .../basilisk/base/content/browser-syncui.js | 24 +++------------------- application/basilisk/base/content/sync/utils.js | 13 ++---------- 2 files changed, 5 insertions(+), 32 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index 000c8f7b4..b796e663b 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -93,14 +93,6 @@ var gSyncUI = { // Returns a promise that resolves with true if Sync needs to be configured, // false otherwise. _needsSetup() { - // If Sync is configured for FxAccounts then we do that promise-dance. - if (this.weaveService.fxAccountsEnabled) { - return fxAccounts.getSignedInUser().then(user => { - // We want to treat "account needs verification" as "needs setup". - return !(user && user.verified); - }); - } - // We are using legacy sync - check that. let firstSync = ""; try { firstSync = Services.prefs.getCharPref("services.sync.firstSync"); @@ -114,19 +106,9 @@ var gSyncUI = { // to Sync needs to be verified, false otherwise. _needsVerification() { // For callers who care about the distinction between "needs setup" and - // "needs verification" - if (this.weaveService.fxAccountsEnabled) { - return fxAccounts.getSignedInUser().then(user => { - // If there is no user, they can't be in a "needs verification" state. - if (!user) { - return false; - } - return !user.verified; - }); - } - - // Otherwise we are configured for legacy Sync, which has no verification - // concept. + // "needs verification". Only for fxAccounts. XXX: remove this check. + // Since we are configured for legacy Sync only, which has no verification + // concept, just return false. return Promise.resolve(false); }, diff --git a/application/basilisk/base/content/sync/utils.js b/application/basilisk/base/content/sync/utils.js index 92981f7b4..1422c1d15 100644 --- a/application/basilisk/base/content/sync/utils.js +++ b/application/basilisk/base/content/sync/utils.js @@ -14,13 +14,6 @@ var gSyncUtils = { return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties"); }, - 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: function (url) { let thisDocEl = document.documentElement, @@ -78,8 +71,7 @@ var gSyncUtils = { }, get tosURL() { - let root = this.fxAccountsEnabled ? "fxa." : ""; - return Weave.Svc.Prefs.get(root + "termsURL"); + return Weave.Svc.Prefs.get("termsURL"); }, openToS: function () { @@ -87,8 +79,7 @@ var gSyncUtils = { }, get privacyPolicyURL() { - let root = this.fxAccountsEnabled ? "fxa." : ""; - return Weave.Svc.Prefs.get(root + "privacyURL"); + return Weave.Svc.Prefs.get("privacyURL"); }, openPrivacyPolicy: function () { -- cgit v1.2.3 From 711c9cd6cd08f4fe10eb7544aa3a51dfb863bfeb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 30 Mar 2019 13:28:49 -0400 Subject: [BASILISK] Remove FxA Synced Tabs Sidebar --- .../basilisk/base/content/browser-menubar.inc | 3 -- application/basilisk/base/content/browser-sets.inc | 4 -- application/basilisk/base/content/browser.xul | 53 ---------------------- 3 files changed, 60 deletions(-) (limited to 'application/basilisk/base') diff --git a/application/basilisk/base/content/browser-menubar.inc b/application/basilisk/base/content/browser-menubar.inc index 0549ad915..5b89875fd 100644 --- a/application/basilisk/base/content/browser-menubar.inc +++ b/application/basilisk/base/content/browser-menubar.inc @@ -195,9 +195,6 @@ key="key_gotoHistory" observes="viewHistorySidebar" label="&historyButton.label;"/> - diff --git a/application/basilisk/base/content/browser-sets.inc b/application/basilisk/base/content/browser-sets.inc index 6ea057d93..47fd1547c 100644 --- a/application/basilisk/base/content/browser-sets.inc +++ b/application/basilisk/base/content/browser-sets.inc @@ -169,10 +169,6 @@