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') 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 -------------- application/palemoon/configure.in | 4 ---- 3 files changed, 29 deletions(-) (limited to 'application') 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 () { diff --git a/application/palemoon/configure.in b/application/palemoon/configure.in index 96f63781e..eb02af3c0 100644 --- a/application/palemoon/configure.in +++ b/application/palemoon/configure.in @@ -36,7 +36,3 @@ MOZ_ARG_DISABLE_BOOL(sync, MOZ_SERVICES_SYNC=, MOZ_SERVICES_SYNC=1) -if test -z "$MOZ_SERVICES_SYNC"; then - MOZ_SERVICES_CLOUDSYNC= -fi - -- 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 ++------- .../components/preferences/in-content/sync.js | 32 ++++++---------------- 3 files changed, 13 insertions(+), 56 deletions(-) (limited to 'application') 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 () { diff --git a/application/basilisk/components/preferences/in-content/sync.js b/application/basilisk/components/preferences/in-content/sync.js index 2600677a8..32b94de86 100644 --- a/application/basilisk/components/preferences/in-content/sync.js +++ b/application/basilisk/components/preferences/in-content/sync.js @@ -92,19 +92,7 @@ var gSyncPane = { } 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 + } else { this.page = PAGE_HAS_ACCOUNT; } }, @@ -388,17 +376,13 @@ var gSyncPane = { .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); - } + 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); } }, -- cgit v1.2.3 From 3e466a01e4185483895edb1243de032f25aa71e1 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sat, 30 Mar 2019 12:22:28 -0400 Subject: [BASILISK] Add configure option to disable sync --- application/basilisk/configure.in | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'application') diff --git a/application/basilisk/configure.in b/application/basilisk/configure.in index 4e7a06390..13f2ad54d 100644 --- a/application/basilisk/configure.in +++ b/application/basilisk/configure.in @@ -16,3 +16,10 @@ AC_SUBST(MC_BASILISK) dnl Optional parts of the build. +dnl ======================================================== +dnl = Disable Sync +dnl ======================================================== +MOZ_ARG_DISABLE_BOOL(sync, +[ --disable-sync Disable Sync], + MOZ_SERVICES_SYNC=, + MOZ_SERVICES_SYNC=1) \ No newline at end of file -- 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 -- application/basilisk/components/moz.build | 1 - .../components/syncedtabs/EventEmitter.jsm | 45 -- .../syncedtabs/SyncedTabsDeckComponent.js | 169 ------ .../components/syncedtabs/SyncedTabsDeckStore.js | 60 --- .../components/syncedtabs/SyncedTabsDeckView.js | 116 ----- .../components/syncedtabs/SyncedTabsListStore.js | 235 --------- .../components/syncedtabs/TabListComponent.js | 138 ----- .../basilisk/components/syncedtabs/TabListView.js | 568 --------------------- application/basilisk/components/syncedtabs/jar.mn | 7 - .../basilisk/components/syncedtabs/moz.build | 17 - .../basilisk/components/syncedtabs/sidebar.js | 30 -- .../basilisk/components/syncedtabs/sidebar.xhtml | 114 ----- application/basilisk/components/syncedtabs/util.js | 23 - .../locales/en-US/chrome/browser/browser.dtd | 25 - application/basilisk/themes/linux/jar.mn | 1 - .../basilisk/themes/linux/syncedtabs/sidebar.css | 69 --- application/basilisk/themes/osx/jar.mn | 1 - .../basilisk/themes/osx/syncedtabs/sidebar.css | 154 ------ .../themes/shared/syncedtabs/sidebar.inc.css | 234 --------- application/basilisk/themes/windows/jar.mn | 1 - .../basilisk/themes/windows/syncedtabs/sidebar.css | 132 ----- 24 files changed, 2200 deletions(-) delete mode 100644 application/basilisk/components/syncedtabs/EventEmitter.jsm delete mode 100644 application/basilisk/components/syncedtabs/SyncedTabsDeckComponent.js delete mode 100644 application/basilisk/components/syncedtabs/SyncedTabsDeckStore.js delete mode 100644 application/basilisk/components/syncedtabs/SyncedTabsDeckView.js delete mode 100644 application/basilisk/components/syncedtabs/SyncedTabsListStore.js delete mode 100644 application/basilisk/components/syncedtabs/TabListComponent.js delete mode 100644 application/basilisk/components/syncedtabs/TabListView.js delete mode 100644 application/basilisk/components/syncedtabs/jar.mn delete mode 100644 application/basilisk/components/syncedtabs/moz.build delete mode 100644 application/basilisk/components/syncedtabs/sidebar.js delete mode 100644 application/basilisk/components/syncedtabs/sidebar.xhtml delete mode 100644 application/basilisk/components/syncedtabs/util.js delete mode 100644 application/basilisk/themes/linux/syncedtabs/sidebar.css delete mode 100644 application/basilisk/themes/osx/syncedtabs/sidebar.css delete mode 100644 application/basilisk/themes/shared/syncedtabs/sidebar.inc.css delete mode 100644 application/basilisk/themes/windows/syncedtabs/sidebar.css (limited to 'application') 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 @@