diff options
Diffstat (limited to 'application/basilisk')
20 files changed, 438 insertions, 365 deletions
diff --git a/application/basilisk/app/blocklist.xml b/application/basilisk/app/blocklist.xml index 239fe43a4..435d0e78f 100644 --- a/application/basilisk/app/blocklist.xml +++ b/application/basilisk/app/blocklist.xml @@ -1,6 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> -<blocklist lastupdate="1521130300000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> +<blocklist lastupdate="1547041082000" xmlns="http://www.mozilla.org/2006/addons-blocklist"> <emItems> + <!-- Basilisk --> + <!-- Inherited malware items --> <emItem blockID="i988" id="{b12785f5-d8d0-4530-a3ea-5c4263b85bef}"> <prefs/> <versionRange minVersion="0" maxVersion="*" severity="1"/> diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index cff5f599f..ff1f1fbc2 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1051,6 +1051,9 @@ sticky_pref("browser.newtabpage.enhanced", false); // enables Activity Stream inspired layout pref("browser.newtabpage.compact", false); +// Disables capturing of page thumbnails +pref("browser.pagethumbnails.capturing_disabled", false); + // enables showing basic placeholders for missing thumbnails pref("browser.newtabpage.thumbnailPlaceholder", false); diff --git a/application/basilisk/base/content/browser-fxaccounts.js b/application/basilisk/base/content/browser-fxaccounts.js index 94a591f1e..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) { @@ -153,11 +144,6 @@ var gFxAccounts = { profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled"); } catch (e) { } - // Bail out if FxA is disabled. - if (!this.weave.fxAccountsEnabled) { - return Promise.resolve(); - } - this.panelUIFooter.hidden = false; // Make sure the button is disabled in customization mode. @@ -176,6 +162,7 @@ var gFxAccounts = { let defaultLabel = this.panelUIStatus.getAttribute("defaultlabel"); let errorLabel = this.panelUIStatus.getAttribute("errorlabel"); let unverifiedLabel = this.panelUIStatus.getAttribute("unverifiedlabel"); + let settingslabel = this.panelUIStatus.getAttribute("settingslabel"); // The localization string is for the signed in text, but it's the default text as well let defaultTooltiptext = this.panelUIStatus.getAttribute("signedinTooltiptext"); @@ -191,34 +178,19 @@ var gFxAccounts = { this.panelUIFooter.removeAttribute("fxastatus"); this.panelUIFooter.removeAttribute("fxaprofileimage"); this.panelUIAvatar.style.removeProperty("list-style-image"); - let showErrorBadge = false; - if (userData) { - // At this point we consider the user as logged-in (but still can be in an error state) - if (this.loginFailed) { - let tooltipDescription = this.strings.formatStringFromName("reconnectDescription", [userData.email], 1); - this.panelUIFooter.setAttribute("fxastatus", "error"); - this.panelUILabel.setAttribute("label", errorLabel); - this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription); - showErrorBadge = true; - } else if (!userData.verified) { - let tooltipDescription = this.strings.formatStringFromName("verifyDescription", [userData.email], 1); - this.panelUIFooter.setAttribute("fxastatus", "error"); - this.panelUIFooter.setAttribute("unverified", "true"); - this.panelUILabel.setAttribute("label", unverifiedLabel); - this.panelUIStatus.setAttribute("tooltiptext", tooltipDescription); - showErrorBadge = true; - } else { - this.panelUIFooter.setAttribute("fxastatus", "signedin"); - this.panelUILabel.setAttribute("label", userData.email); - } - if (profileInfoEnabled) { - this.panelUIFooter.setAttribute("fxaprofileimage", "enabled"); - } + + if (Weave.Status.service == Weave.CLIENT_NOT_CONFIGURED) { + // Leave the default state + return; } - if (showErrorBadge) { - gMenuButtonBadgeManager.addBadge(gMenuButtonBadgeManager.BADGEID_FXA, "fxa-needs-authentication"); + + if (this.loginFailed) { + this.panelUIFooter.setAttribute("fxastatus", "error"); + this.panelUILabel.setAttribute("label", errorLabel); } else { - gMenuButtonBadgeManager.removeBadge(gMenuButtonBadgeManager.BADGEID_FXA); + this.panelUIFooter.setAttribute("fxastatus", "signedin"); + this.panelUILabel.setAttribute("label", settingslabel); + this.panelUIStatus.setAttribute("tooltiptext", ""); } } @@ -322,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 } }; diff --git a/application/basilisk/base/content/browser-syncui.js b/application/basilisk/base/content/browser-syncui.js index 51bcb15d5..3a57140f2 100644 --- a/application/basilisk/base/content/browser-syncui.js +++ b/application/basilisk/base/content/browser-syncui.js @@ -19,6 +19,7 @@ var gSyncUI = { _obs: ["weave:service:sync:start", "weave:service:sync:finish", "weave:service:sync:error", + "weave:service:quota:remaining", "weave:service:setup-complete", "weave:service:login:start", "weave:service:login:finish", @@ -246,6 +247,21 @@ var gSyncUI = { this.updateUI(); }, + onQuotaNotice: function onQuotaNotice(subject, data) { + let title = this._stringBundle.GetStringFromName("warning.sync.quota.label"); + let description = this._stringBundle.GetStringFromName("warning.sync.quota.description"); + let buttons = []; + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"), + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"), + function() { gSyncUI.openQuotaDialog(); return true; } + )); + + let notification = new Weave.Notification( + title, description, null, Weave.Notifications.PRIORITY_WARNING, buttons); + Weave.Notifications.replaceTitle(notification); + }, + _getAppName: function () { let brand = new StringBundle("chrome://branding/locale/brand.properties"); return brand.get("brandShortName"); @@ -293,17 +309,13 @@ var gSyncUI = { */ openSetup: function SUI_openSetup(wizardType, entryPoint = "syncbutton") { - if (this.weaveService.fxAccountsEnabled) { - this.openPrefs(entryPoint); - } 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); } }, @@ -328,23 +340,6 @@ var gSyncUI = { gFxAccounts.openSignInAgainPage(entryPoint); }, - openSyncedTabsPanel() { - let placement = CustomizableUI.getPlacementOfWidget("sync-button"); - let area = placement ? placement.area : CustomizableUI.AREA_NAVBAR; - let anchor = document.getElementById("sync-button") || - document.getElementById("PanelUI-menu-button"); - if (area == CustomizableUI.AREA_PANEL) { - // The button is in the panel, so we need to show the panel UI, then our - // subview. - PanelUI.show().then(() => { - PanelUI.showSubView("PanelUI-remotetabs", anchor, area); - }).catch(Cu.reportError); - } else { - // It is placed somewhere else - just try and show it. - PanelUI.showSubView("PanelUI-remotetabs", anchor, area); - } - }, - /* After Sync is initialized we perform a once-only check for the sync button being in "customize purgatory" and if so, move it to the panel. This is done primarily for profiles created before SyncedTabs landed, @@ -456,6 +451,32 @@ var gSyncUI = { } }, + onSyncError: function SUI_onSyncError() { + this.log.debug("onSyncError: login=${login}, sync=${sync}", Weave.Status); + let title = this._stringBundle.GetStringFromName("error.sync.title"); + let error = Weave.Utils.getErrorString(Weave.Status.sync); + let description = + this._stringBundle.formatStringFromName("error.sync.description", [error], 1); + let priority = Weave.Notifications.PRIORITY_WARNING; + let buttons = []; + + if (Weave.Status.sync == Weave.OVER_QUOTA) { + description = this._stringBundle.GetStringFromName("error.sync.quota.description"); + buttons.push(new Weave.NotificationButton( + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.label"), + this._stringBundle.GetStringFromName("error.sync.viewQuotaButton.accesskey"), + function() { gSyncUI.openQuotaDialog(); return true; } ) + ); + // Only show the notification bar on Quota error. the panel will show the rest. + let notification = + new Weave.Notification(title, description, null, priority, buttons); + Weave.Notifications.replaceTitle(notification); + } + + this.updateUI(); + }, + + observe: function SUI_observe(subject, topic, data) { this.log.debug("observed", topic); if (this._unloaded) { @@ -487,12 +508,17 @@ var gSyncUI = { // Do nothing. break; case "weave:ui:sync:error": + this.onSyncError(); + break; case "weave:service:setup-complete": case "weave:service:login:finish": case "weave:service:login:start": case "weave:service:start-over": this.updateUI(); break; + case "weave:service:quota:remaining": + this.onQuotaNotice(); + break; case "weave:ui:login:error": case "weave:service:login:error": this.onLoginError(); diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index d45956191..9fb997a42 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -6347,7 +6347,7 @@ function checkEmptyPageOrigin(browser = gBrowser.selectedBrowser, } function BrowserOpenSyncTabs() { - gSyncUI.openSyncedTabsPanel(); + switchToTabHavingURI("about:sync-tabs", true); } /** diff --git a/application/basilisk/base/content/sync/quota.js b/application/basilisk/base/content/sync/quota.js new file mode 100644 index 000000000..b416a44cc --- /dev/null +++ b/application/basilisk/base/content/sync/quota.js @@ -0,0 +1,247 @@ +/* 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/. */ + +const Ci = Components.interfaces; +const Cc = Components.classes; +const Cr = Components.results; +const Cu = Components.utils; + +Cu.import("resource://services-sync/main.js"); +Cu.import("resource://gre/modules/DownloadUtils.jsm"); + +var gSyncQuota = { + + init: function init() { + this.bundle = document.getElementById("quotaStrings"); + let caption = document.getElementById("treeCaption"); + caption.firstChild.nodeValue = this.bundle.getString("quota.treeCaption.label"); + + gUsageTreeView.init(); + this.tree = document.getElementById("usageTree"); + this.tree.view = gUsageTreeView; + + this.loadData(); + }, + + loadData: function loadData() { + this._usage_req = Weave.Service.getStorageInfo(Weave.INFO_COLLECTION_USAGE, + function (error, usage) { + delete gSyncQuota._usage_req; + // displayUsageData handles null values, so no need to check 'error'. + gUsageTreeView.displayUsageData(usage); + }); + + let usageLabel = document.getElementById("usageLabel"); + let bundle = this.bundle; + + this._quota_req = Weave.Service.getStorageInfo(Weave.INFO_QUOTA, + function (error, quota) { + delete gSyncQuota._quota_req; + + if (error) { + usageLabel.value = bundle.getString("quota.usageError.label"); + return; + } + let used = gSyncQuota.convertKB(quota[0]); + if (!quota[1]) { + // No quota on the server. + usageLabel.value = bundle.getFormattedString( + "quota.usageNoQuota.label", used); + return; + } + let percent = Math.round(100 * quota[0] / quota[1]); + let total = gSyncQuota.convertKB(quota[1]); + usageLabel.value = bundle.getFormattedString( + "quota.usagePercentage.label", [percent].concat(used).concat(total)); + }); + }, + + onCancel: function onCancel() { + if (this._usage_req) { + this._usage_req.abort(); + } + if (this._quota_req) { + this._quota_req.abort(); + } + return true; + }, + + onAccept: function onAccept() { + let engines = gUsageTreeView.getEnginesToDisable(); + for each (let engine in engines) { + Weave.Service.engineManager.get(engine).enabled = false; + } + if (engines.length) { + // The 'Weave' object will disappear once the window closes. + let Service = Weave.Service; + Weave.Utils.nextTick(function() { Service.sync(); }); + } + return this.onCancel(); + }, + + convertKB: function convertKB(value) { + return DownloadUtils.convertByteUnits(value * 1024); + } + +}; + +var gUsageTreeView = { + + _ignored: {keys: true, + meta: true, + clients: true}, + + /* + * Internal data structures underlaying the tree. + */ + _collections: [], + _byname: {}, + + init: function init() { + let retrievingLabel = gSyncQuota.bundle.getString("quota.retrieving.label"); + for each (let engine in Weave.Service.engineManager.getEnabled()) { + if (this._ignored[engine.name]) + continue; + + // Some engines use the same pref, which means they can only be turned on + // and off together. We need to combine them here as well. + let existing = this._byname[engine.prefName]; + if (existing) { + existing.engines.push(engine.name); + continue; + } + + let obj = {name: engine.prefName, + title: this._collectionTitle(engine), + engines: [engine.name], + enabled: true, + sizeLabel: retrievingLabel}; + this._collections.push(obj); + this._byname[engine.prefName] = obj; + } + }, + + _collectionTitle: function _collectionTitle(engine) { + try { + return gSyncQuota.bundle.getString( + "collection." + engine.prefName + ".label"); + } catch (ex) { + return engine.Name; + } + }, + + /* + * Process the quota information as returned by info/collection_usage. + */ + displayUsageData: function displayUsageData(data) { + for each (let coll in this._collections) { + coll.size = 0; + // If we couldn't retrieve any data, just blank out the label. + if (!data) { + coll.sizeLabel = ""; + continue; + } + + for each (let engineName in coll.engines) + coll.size += data[engineName] || 0; + let sizeLabel = ""; + sizeLabel = gSyncQuota.bundle.getFormattedString( + "quota.sizeValueUnit.label", gSyncQuota.convertKB(coll.size)); + coll.sizeLabel = sizeLabel; + } + let sizeColumn = this.treeBox.columns.getNamedColumn("size"); + this.treeBox.invalidateColumn(sizeColumn); + }, + + /* + * Handle click events on the tree. + */ + onTreeClick: function onTreeClick(event) { + if (event.button == 2) + return; + + let cell = this.treeBox.getCellAt(event.clientX, event.clientY); + if (cell.col && cell.col.id == "enabled") + this.toggle(cell.row); + }, + + /* + * Toggle enabled state of an engine. + */ + toggle: function toggle(row) { + // Update the tree + let collection = this._collections[row]; + collection.enabled = !collection.enabled; + this.treeBox.invalidateRow(row); + }, + + /* + * Return a list of engines (or rather their pref names) that should be + * disabled. + */ + getEnginesToDisable: function getEnginesToDisable() { + // Tycho: return [coll.name for each (coll in this._collections) if (!coll.enabled)]; + let engines = []; + for each (let coll in this._collections) { + if (!coll.enabled) { + engines.push(coll.name); + } + } + return engines; + }, + + // nsITreeView + + get rowCount() { + return this._collections.length; + }, + + getRowProperties: function(index) { return ""; }, + getCellProperties: function(row, col) { return ""; }, + getColumnProperties: function(col) { return ""; }, + isContainer: function(index) { return false; }, + isContainerOpen: function(index) { return false; }, + isContainerEmpty: function(index) { return false; }, + isSeparator: function(index) { return false; }, + isSorted: function() { return false; }, + canDrop: function(index, orientation, dataTransfer) { return false; }, + drop: function(row, orientation, dataTransfer) {}, + getParentIndex: function(rowIndex) {}, + hasNextSibling: function(rowIndex, afterIndex) { return false; }, + getLevel: function(index) { return 0; }, + getImageSrc: function(row, col) {}, + + getCellValue: function(row, col) { + return this._collections[row].enabled; + }, + + getCellText: function getCellText(row, col) { + let collection = this._collections[row]; + switch (col.id) { + case "collection": + return collection.title; + case "size": + return collection.sizeLabel; + default: + return ""; + } + }, + + setTree: function setTree(tree) { + this.treeBox = tree; + }, + + toggleOpenState: function(index) {}, + cycleHeader: function(col) {}, + selectionChanged: function() {}, + cycleCell: function(row, col) {}, + isEditable: function(row, col) { return false; }, + isSelectable: function (row, col) { return false; }, + setCellValue: function(row, col, value) {}, + setCellText: function(row, col, value) {}, + performAction: function(action) {}, + performActionOnRow: function(action, row) {}, + performActionOnCell: function(action, row, col) {} + +}; diff --git a/application/basilisk/base/content/sync/quota.xul b/application/basilisk/base/content/sync/quota.xul new file mode 100644 index 000000000..99e6ed78b --- /dev/null +++ b/application/basilisk/base/content/sync/quota.xul @@ -0,0 +1,65 @@ +<?xml version="1.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/. --> + +<?xml-stylesheet href="chrome://global/skin/" type="text/css"?> +<?xml-stylesheet href="chrome://browser/skin/syncQuota.css"?> + +<!DOCTYPE dialog [ +<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd"> +<!ENTITY % syncBrandDTD SYSTEM "chrome://browser/locale/syncBrand.dtd"> +<!ENTITY % syncQuotaDTD SYSTEM "chrome://browser/locale/syncQuota.dtd"> +%brandDTD; +%syncBrandDTD; +%syncQuotaDTD; +]> +<dialog id="quotaDialog" + windowtype="Sync:ViewQuota" + persist="screenX screenY width height" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + xmlns:html="http://www.w3.org/1999/xhtml" + onload="gSyncQuota.init()" + buttons="accept,cancel" + title=""a.dialogTitle.label;" + ondialogcancel="return gSyncQuota.onCancel();" + ondialogaccept="return gSyncQuota.onAccept();"> + + <script type="application/javascript" + src="chrome://browser/content/sync/quota.js"/> + + <stringbundleset id="stringbundleset"> + <stringbundle id="quotaStrings" + src="chrome://browser/locale/syncQuota.properties"/> + </stringbundleset> + + <vbox flex="1"> + <label id="usageLabel" + value=""a.retrievingInfo.label;"/> + <separator/> + <tree id="usageTree" + seltype="single" + hidecolumnpicker="true" + onclick="gUsageTreeView.onTreeClick(event);" + flex="1"> + <treecols> + <treecol id="enabled" + type="checkbox" + fixed="true"/> + <splitter class="tree-splitter"/> + <treecol id="collection" + label=""a.typeColumn.label;" + flex="1"/> + <splitter class="tree-splitter"/> + <treecol id="size" + label=""a.sizeColumn.label;" + flex="1"/> + </treecols> + <treechildren flex="1"/> + </tree> + <separator/> + <description id="treeCaption"> </description> + </vbox> + +</dialog> diff --git a/application/basilisk/base/jar.mn b/application/basilisk/base/jar.mn index 5ec92d79a..c288685b9 100644 --- a/application/basilisk/base/jar.mn +++ b/application/basilisk/base/jar.mn @@ -150,6 +150,8 @@ browser.jar: content/browser/sync/customize.xul (content/sync/customize.xul) content/browser/sync/customize.js (content/sync/customize.js) content/browser/sync/customize.css (content/sync/customize.css) + content/browser/sync/quota.xul (content/sync/quota.xul) + content/browser/sync/quota.js (content/sync/quota.js) content/browser/safeMode.css (content/safeMode.css) content/browser/safeMode.js (content/safeMode.js) content/browser/safeMode.xul (content/safeMode.xul) diff --git a/application/basilisk/components/customizableui/CustomizableWidgets.jsm b/application/basilisk/components/customizableui/CustomizableWidgets.jsm index 642e06f0f..09b3f167e 100644 --- a/application/basilisk/components/customizableui/CustomizableWidgets.jsm +++ b/application/basilisk/components/customizableui/CustomizableWidgets.jsm @@ -23,8 +23,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", "resource://gre/modules/PrivateBrowsingUtils.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "SyncedTabs", - "resource://services-sync/SyncedTabs.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "ContextualIdentityService", "resource://gre/modules/ContextualIdentityService.jsm"); @@ -312,77 +310,6 @@ const CustomizableWidgets = [ obnode.setAttribute("element", "sync-status"); obnode.setAttribute("attribute", "syncstatus"); aNode.appendChild(obnode); - - // A somewhat complicated dance to format the mobilepromo label. - let bundle = doc.getElementById("bundle_browser"); - let formatArgs = ["android", "ios"].map(os => { - let link = doc.createElement("label"); - link.textContent = bundle.getString(`appMenuRemoteTabs.mobilePromo.${os}`); - link.setAttribute("mobile-promo-os", os); - link.className = "text-link remotetabs-promo-link"; - return link.outerHTML; - }); - let promoParentElt = doc.getElementById("PanelUI-remotetabs-mobile-promo"); - // Put it all together... - let contents = bundle.getFormattedString("appMenuRemoteTabs.mobilePromo.text2", formatArgs); - promoParentElt.innerHTML = contents; - // We manually manage the "click" event to open the promo links because - // allowing the "text-link" widget handle it has 2 problems: (1) it only - // supports button 0 and (2) it's tricky to intercept when it does the - // open and auto-close the panel. (1) can probably be fixed, but (2) is - // trickier without hard-coding here the knowledge of exactly what buttons - // it does support. - // So we allow left and middle clicks to open the link in a new tab and - // close the panel; not setting a "href" attribute prevents the text-link - // widget handling it, and we build the final URL in the click handler to - // make testing easier (ie, so tests can change the pref after the links - // were created and have the new pref value used.) - promoParentElt.addEventListener("click", e => { - let os = e.target.getAttribute("mobile-promo-os"); - if (!os || e.button > 1) { - return; - } - let link = Services.prefs.getCharPref(`identity.mobilepromo.${os}`) + "synced-tabs"; - doc.defaultView.openUILinkIn(link, "tab"); - CustomizableUI.hidePanelForNode(e.target); - }); - }, - onViewShowing(aEvent) { - let doc = aEvent.target.ownerDocument; - this._tabsList = doc.getElementById("PanelUI-remotetabs-tabslist"); - Services.obs.addObserver(this, SyncedTabs.TOPIC_TABS_CHANGED, false); - - if (SyncedTabs.isConfiguredToSyncTabs) { - if (SyncedTabs.hasSyncedThisSession) { - this.setDeckIndex(this.deckIndices.DECKINDEX_TABS); - } else { - // Sync hasn't synced tabs yet, so show the "fetching" panel. - this.setDeckIndex(this.deckIndices.DECKINDEX_FETCHING); - } - // force a background sync. - SyncedTabs.syncTabs().catch(ex => { - Cu.reportError(ex); - }); - // show the current list - it will be updated by our observer. - this._showTabs(); - } else { - // not configured to sync tabs, so no point updating the list. - this.setDeckIndex(this.deckIndices.DECKINDEX_TABSDISABLED); - } - }, - onViewHiding() { - Services.obs.removeObserver(this, SyncedTabs.TOPIC_TABS_CHANGED); - this._tabsList = null; - }, - _tabsList: null, - observe(subject, topic, data) { - switch (topic) { - case SyncedTabs.TOPIC_TABS_CHANGED: - this._showTabs(); - break; - default: - break; - } }, setDeckIndex(index) { let deck = this._tabsList.ownerDocument.getElementById("PanelUI-remotetabs-deck"); diff --git a/application/basilisk/components/customizableui/content/panelUI.inc.xul b/application/basilisk/components/customizableui/content/panelUI.inc.xul index e389b14bf..8ebd93327 100644 --- a/application/basilisk/components/customizableui/content/panelUI.inc.xul +++ b/application/basilisk/components/customizableui/content/panelUI.inc.xul @@ -23,10 +23,11 @@ <hbox id="PanelUI-footer-fxa"> <hbox id="PanelUI-fxa-status" defaultlabel="&fxaSignIn.label;" - signedinTooltiptext="&fxaSignedIn.tooltip;" - tooltiptext="&fxaSignedIn.tooltip;" + signedinTooltiptext="&syncSettings.label;" + tooltiptext="&syncSettings.label;" errorlabel="&fxaSignInError.label;" unverifiedlabel="&fxaUnverified.label;" + settingslabel="&syncSettings.label;" onclick="if (event.which == 1) gFxAccounts.onMenuPanelCommand();"> <image id="PanelUI-fxa-avatar"/> <toolbarbutton id="PanelUI-fxa-label" @@ -111,7 +112,7 @@ <vbox id="PanelUI-remotetabs-buttons"> <toolbarbutton id="PanelUI-remotetabs-view-sidebar" class="subviewbutton" - observes="viewTabsSidebar" + oncommand="BrowserOpenSyncTabs();" label="&appMenuRemoteTabs.sidebar.label;"/> <toolbarbutton id="PanelUI-remotetabs-syncnow" observes="sync-status" diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js index 3258159b6..d77e97f87 100644 --- a/application/basilisk/components/nsBrowserGlue.js +++ b/application/basilisk/components/nsBrowserGlue.js @@ -1080,24 +1080,19 @@ BrowserGlue.prototype = { // For any add-ons that were installed disabled and can be enabled offer // them to the user. - let win = RecentWindow.getMostRecentBrowserWindow(); - AddonManager.getAllAddons(addons => { - for (let addon of addons) { - // If this add-on has already seen (or seen is undefined for non-XPI - // add-ons) then skip it. - if (addon.seen !== false) { - continue; - } - - // If this add-on cannot be enabled (either already enabled or - // appDisabled) then skip it. - if (!(addon.permissions & AddonManager.PERM_CAN_ENABLE)) { - continue; - } - - win.openUILinkIn("about:newaddon?id=" + addon.id, "tab"); - } - }); + let changedIDs = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_INSTALLED); + if (changedIDs.length > 0) { + let win = this.getMostRecentBrowserWindow(); + AddonManager.getAddonsByIDs(changedIDs, function(aAddons) { + aAddons.forEach(function(aAddon) { + // If the add-on isn't user disabled or can't be enabled then skip it. + if (!aAddon.userDisabled || !(aAddon.permissions & AddonManager.PERM_CAN_ENABLE)) + return; + + win.openUILinkIn("about:newaddon?id=" + aAddon.id, "tab"); + }) + }); + } let signingRequired; if (AppConstants.MOZ_REQUIRE_SIGNING) { @@ -1110,6 +1105,11 @@ BrowserGlue.prototype = { let disabledAddons = AddonManager.getStartupChanges(AddonManager.STARTUP_CHANGE_DISABLED); AddonManager.getAddonsByIDs(disabledAddons, (addons) => { for (let addon of addons) { + // WEs return null, skip. + if (!addon) { + continue; + } + if (addon.type == "experiment") continue; diff --git a/application/basilisk/components/preferences/in-content/sync.js b/application/basilisk/components/preferences/in-content/sync.js index 27f7cd48c..2600677a8 100644 --- a/application/basilisk/components/preferences/in-content/sync.js +++ b/application/basilisk/components/preferences/in-content/sync.js @@ -306,113 +306,8 @@ var gSyncPane = { 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 profileInfoEnabled; - try { - profileInfoEnabled = Services.prefs.getBoolPref("identity.fxaccounts.profile_image.enabled"); - } catch (ex) {} - - // 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; - - // 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; - } - } 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") { + 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. @@ -646,6 +541,16 @@ var gSyncPane = { }); }, + openQuotaDialog: function () { + let win = Services.wm.getMostRecentWindow("Sync:ViewQuota"); + if (win) { + win.focus(); + } else { + window.openDialog("chrome://browser/content/sync/quota.xul", "", + "centerscreen,chrome,dialog,modal"); + } + }, + openAddDevice: function () { if (!Weave.Utils.ensureMPUnlocked()) return; diff --git a/application/basilisk/components/preferences/in-content/sync.xul b/application/basilisk/components/preferences/in-content/sync.xul index f1aebf2aa..cf0e81ca1 100644 --- a/application/basilisk/components/preferences/in-content/sync.xul +++ b/application/basilisk/components/preferences/in-content/sync.xul @@ -71,6 +71,9 @@ label="&manageAccount.label;" accesskey="&manageAccount.accesskey;"> <menupopup> + <menuitem id="syncViewQuota" label="&viewQuota.label;" + oncommand="gSyncPane.openQuotaDialog();"/> + <menuseparator/> <menuitem id="syncChangePassword" label="&changePassword2.label;"/> <menuitem id="syncResetPassphrase" label="&myRecoveryKey.label;"/> <menuseparator/> @@ -91,11 +94,6 @@ <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"/> diff --git a/application/basilisk/confvars.sh b/application/basilisk/confvars.sh index 62aa1a84f..cd18bdb94 100644 --- a/application/basilisk/confvars.sh +++ b/application/basilisk/confvars.sh @@ -55,7 +55,7 @@ MOZ_APP_STATIC_INI=1 MOZ_WEBGL_CONFORMANT=1 MOZ_JSDOWNLOADS=1 MOZ_WEBRTC=1 -MOZ_WEBEXTENSIONS=1 +MOZ_WEBEXTENSIONS= MOZ_DEVTOOLS=1 MOZ_SERVICES_COMMON=1 MOZ_SERVICES_SYNC=1 diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in index 35060ea5e..cebcb6796 100644 --- a/application/basilisk/installer/package-manifest.in +++ b/application/basilisk/installer/package-manifest.in @@ -58,8 +58,8 @@ #ifdef HAVE_MAKENSISU @BINPATH@/uninstall/helper.exe #endif -#ifdef MOZ_UPDATER @RESPATH@/update.locale +#ifdef MOZ_UPDATER @RESPATH@/updater.ini #endif @@ -140,13 +140,6 @@ @RESPATH@/run-mozilla.sh #endif #endif -#ifdef XP_WIN -#ifdef _AMD64_ -@BINPATH@/@DLL_PREFIX@qipcap64@DLL_SUFFIX@ -#else -@BINPATH@/@DLL_PREFIX@qipcap@DLL_SUFFIX@ -#endif -#endif ; [Components] #ifdef MOZ_ARTIFACT_BUILDS diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.dtd b/application/basilisk/locales/en-US/chrome/browser/browser.dtd index 09da91dee..d02a6eedb 100644 --- a/application/basilisk/locales/en-US/chrome/browser/browser.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/browser.dtd @@ -116,10 +116,9 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY toggleReaderMode.key "R"> <!ENTITY fxaSignIn.label "Sign in to &syncBrand.shortName.label;"> -<!ENTITY fxaSignedIn.tooltip "Open &syncBrand.shortName.label; preferences"> <!ENTITY fxaSignInError.label "Reconnect to &syncBrand.shortName.label;"> <!ENTITY fxaUnverified.label "Verify Your Account"> - +<!ENTITY syncSettings.label "Open &syncBrand.shortName.label; settings"> <!ENTITY fullScreenMinimize.tooltip "Minimize"> <!ENTITY fullScreenRestore.tooltip "Restore"> @@ -349,7 +348,7 @@ These should match what Safari and other Apple applications use on OS X Lion. -- <!ENTITY appMenuRemoteTabs.openprefs.label "Sync Preferences"> <!ENTITY appMenuRemoteTabs.notsignedin.label "Sign in to view a list of tabs from your other devices."> <!ENTITY appMenuRemoteTabs.signin.label "Sign in to Sync"> -<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs Sidebar"> +<!ENTITY appMenuRemoteTabs.sidebar.label "View Synced Tabs"> <!ENTITY customizeMenu.addToToolbar.label "Add to Toolbar"> <!ENTITY customizeMenu.addToToolbar.accesskey "A"> diff --git a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd index 78cadd74c..a5b290052 100644 --- a/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/preferences/sync.dtd @@ -16,6 +16,7 @@ <!-- Manage Account --> <!ENTITY manageAccount.label "Manage Account"> <!ENTITY manageAccount.accesskey "n"> +<!ENTITY viewQuota.label "View Quota"> <!ENTITY changePassword2.label "Change Password…"> <!ENTITY myRecoveryKey.label "My Recovery Key"> <!ENTITY resetSync2.label "Reset Sync…"> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd index 0c9e9201a..71a9f68af 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/syncBrand.dtd @@ -3,5 +3,5 @@ - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> <!ENTITY syncBrand.shortName.label "Sync"> -<!ENTITY syncBrand.fullName.label "Firefox Sync"> +<!ENTITY syncBrand.fullName.label "Pale Moon Sync"> <!ENTITY syncBrand.fxAccount.label "Firefox Account"> diff --git a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd index 950a83553..2657156b7 100644 --- a/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/syncSetup.dtd @@ -16,7 +16,7 @@ <!-- New Account AND Existing Account --> <!ENTITY server.label "Server"> -<!ENTITY serverType.default.label "Default: Mozilla &syncBrand.fullName.label; server"> +<!ENTITY serverType.default.label "Default: &syncBrand.fullName.label; server"> <!ENTITY serverType.custom2.label "Use a custom server…"> <!ENTITY signIn.account2.label "Account"> <!ENTITY signIn.account2.accesskey "A"> diff --git a/application/basilisk/modules/WindowsPreviewPerTab.jsm b/application/basilisk/modules/WindowsPreviewPerTab.jsm index 6586b5d3b..81c2f229f 100644 --- a/application/basilisk/modules/WindowsPreviewPerTab.jsm +++ b/application/basilisk/modules/WindowsPreviewPerTab.jsm @@ -597,6 +597,7 @@ TabWindow.prototype = { "file", "chrome", "resource", "about" ]), onLinkIconAvailable: function (aBrowser, aIconURL) { + let self = this; let requestURL = null; if (aIconURL) { let shouldRequestFaviconURL = true; @@ -613,15 +614,15 @@ TabWindow.prototype = { let isDefaultFavicon = !requestURL; getFaviconAsImage( requestURL, - PrivateBrowsingUtils.isWindowPrivate(this.win), + PrivateBrowsingUtils.isWindowPrivate(self.win), img => { - let index = this.tabbrowser.browsers.indexOf(aBrowser); + let index = self.tabbrowser.browsers.indexOf(aBrowser); // Only add it if we've found the index and the URI is still the same. // The tab could have closed, and there's no guarantee the icons // will have finished fetching 'in order'. if (index != -1) { - let tab = this.tabbrowser.tabs[index]; - let preview = this.previews.get(tab); + let tab = self.tabbrowser.tabs[index]; + let preview = self.previews.get(tab); if (tab.getAttribute("image") == aIconURL || (!preview.icon && isDefaultFavicon)) { preview.icon = img; |