From 110e82b7421479b17bad22e015828d77b43a2b3c Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 19 Apr 2020 20:21:32 -0400 Subject: Issue #13 - Part 1: Remove AppConstants from base/ --- basilisk/base/content/aboutDialog.js | 27 ++- basilisk/base/content/browser-customization.js | 5 +- basilisk/base/content/browser-feeds.js | 46 ++-- .../content/browser-fullScreenAndPointerLock.js | 29 ++- basilisk/base/content/browser-gestureSupport.js | 8 +- basilisk/base/content/browser-media.js | 33 +-- basilisk/base/content/browser-places.js | 11 +- basilisk/base/content/browser-tabsintitlebar.js | 81 +++---- basilisk/base/content/browser.js | 233 +++++++++++---------- basilisk/base/content/sanitize.js | 42 ++-- basilisk/base/content/tabbrowser.xml | 91 ++++---- basilisk/base/content/urlbarBindings.xml | 32 ++- basilisk/base/content/utilityOverlay.js | 27 ++- basilisk/base/jar.mn | 22 +- basilisk/base/moz.build | 1 + 15 files changed, 361 insertions(+), 327 deletions(-) diff --git a/basilisk/base/content/aboutDialog.js b/basilisk/base/content/aboutDialog.js index f957162..92cfc44 100644 --- a/basilisk/base/content/aboutDialog.js +++ b/basilisk/base/content/aboutDialog.js @@ -6,7 +6,6 @@ // Services = object with smart getters for common XPCOM services Components.utils.import("resource://gre/modules/Services.jsm"); -Components.utils.import("resource://gre/modules/AppConstants.jsm"); function init(aEvent) { @@ -73,19 +72,19 @@ function init(aEvent) let releaseNotesURL = Services.prefs.getCharPref("app.releaseNotesURL"); document.getElementById("releasenotes").setAttribute("href", releaseNotesURL); - if (AppConstants.MOZ_UPDATER) { - gAppUpdater = new appUpdater(); +#ifdef MOZ_UPDATER + gAppUpdater = new appUpdater(); - let channelLabel = document.getElementById("currentChannel"); - let currentChannelText = document.getElementById("currentChannelText"); - channelLabel.value = UpdateUtils.UpdateChannel; - if (/^release($|\-)/.test(channelLabel.value)) - currentChannelText.hidden = true; - } + let channelLabel = document.getElementById("currentChannel"); + let currentChannelText = document.getElementById("currentChannelText"); + channelLabel.value = UpdateUtils.UpdateChannel; + if (/^release($|\-)/.test(channelLabel.value)) + currentChannelText.hidden = true; +#endif - if (AppConstants.platform == "macosx") { - // it may not be sized at this point, and we need its width to calculate its position - window.sizeToContent(); - window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5); - } +#ifdef XP_MACOSX + // it may not be sized at this point, and we need its width to calculate its position + window.sizeToContent(); + window.moveTo((screen.availWidth / 2) - (window.outerWidth / 2), screen.availHeight / 5); +#endif } diff --git a/basilisk/base/content/browser-customization.js b/basilisk/base/content/browser-customization.js index d5d51b8..016671b 100644 --- a/basilisk/base/content/browser-customization.js +++ b/basilisk/base/content/browser-customization.js @@ -63,8 +63,9 @@ var CustomizationHandler = { gHomeButton.updateTooltip(); XULBrowserWindow.init(); - if (AppConstants.platform != "macosx") - updateEditUIVisibility(); +#ifndef XP_MACOSX + updateEditUIVisibility(); +#endif // Hacky: update the PopupNotifications' object's reference to the iconBox, // if it already exists, since it may have changed if the URL bar was diff --git a/basilisk/base/content/browser-feeds.js b/basilisk/base/content/browser-feeds.js index 6f29d89..6cb2980 100644 --- a/basilisk/base/content/browser-feeds.js +++ b/basilisk/base/content/browser-feeds.js @@ -301,22 +301,19 @@ var FeedHandler = { * @return The display name of the application represented by the file. */ _getFileDisplayName(file) { - switch (AppConstants.platform) { - case "win": - if (file instanceof Ci.nsILocalFileWin) { - try { - return file.getVersionInfoField("FileDescription"); - } catch (e) {} - } - break; - case "macosx": - if (file instanceof Ci.nsILocalFileMac) { - try { - return file.bundleDisplayName; - } catch (e) {} - } - break; +#ifdef XP_WIN + if (file instanceof Ci.nsILocalFileWin) { + try { + return file.getVersionInfoField("FileDescription"); + } catch (e) {} + } +#elif XP_MACOSX + if (file instanceof Ci.nsILocalFileMac) { + try { + return file.bundleDisplayName; + } catch (e) {} } +#endif return file.leafName; }, @@ -335,18 +332,13 @@ var FeedHandler = { // XXXben - we need to compare this with the running instance // executable just don't know how to do that via script // XXXmano TBD: can probably add this to nsIShellService - let appName = ""; - switch (AppConstants.platform) { - case "win": - appName = AppConstants.MOZ_APP_NAME + ".exe"; - break; - case "macosx": - appName = AppConstants.MOZ_MACBUNDLE_NAME; - break; - default: - appName = AppConstants.MOZ_APP_NAME + "-bin"; - break; - } +#ifdef XP_WIN +#expand let appName = "__MOZ_APP_NAME__.exe"; +#elif XP_MACOSX +#expand let appName = "__MOZ_MACBUNDLE_NAME__"; +#else +#expand let appName = "__MOZ_APP_NAME__-bin"; +#endif if (fp.file.leafName != appName) { Services.prefs.setComplexValue(prefName, Ci.nsILocalFile, selectedApp); diff --git a/basilisk/base/content/browser-fullScreenAndPointerLock.js b/basilisk/base/content/browser-fullScreenAndPointerLock.js index b26a31f..d9d2f1a 100644 --- a/basilisk/base/content/browser-fullScreenAndPointerLock.js +++ b/basilisk/base/content/browser-fullScreenAndPointerLock.js @@ -289,11 +289,11 @@ var FullScreen = { fullscreenCommand.removeAttribute("checked"); } - if (AppConstants.platform == "macosx") { - // Make sure the menu items are adjusted. - document.getElementById("enterFullScreenItem").hidden = enterFS; - document.getElementById("exitFullScreenItem").hidden = !enterFS; - } +#ifdef XP_MACOSX + // Make sure the menu items are adjusted. + document.getElementById("enterFullScreenItem").hidden = enterFS; + document.getElementById("exitFullScreenItem").hidden = !enterFS; +#endif if (!this._fullScrToggler) { this._fullScrToggler = document.getElementById("fullscr-toggler"); @@ -305,12 +305,16 @@ var FullScreen = { if (enterFS) { gNavToolbox.setAttribute("inFullscreen", true); document.documentElement.setAttribute("inFullscreen", true); +#ifdef XP_MACOSX if (!document.fullscreenElement && this.useLionFullScreen) document.documentElement.setAttribute("OSXLionFullscreen", true); +#endif } else { gNavToolbox.removeAttribute("inFullscreen"); document.documentElement.removeAttribute("inFullscreen"); +#ifdef XP_MACOSX document.documentElement.removeAttribute("OSXLionFullscreen"); +#endif } if (!document.fullscreenElement) @@ -524,9 +528,11 @@ var FullScreen = { if (this._isPopupOpen) return false; +#ifdef XP_MACOSX // On OS X Lion we don't want to hide toolbars. if (this.useLionFullScreen) return false; +#endif // a textbox in chrome is focused (location bar anyone?): don't collapse chrome if (document.commandDispatcher.focusedElement && @@ -576,11 +582,13 @@ var FullScreen = { return; } +#ifndef XP_MACOSX // Track whether mouse is near the toolbox - if (trackMouse && !this.useLionFullScreen) { + if (trackMouse) { gBrowser.mPanelContainer.addEventListener("mousemove", this._collapseCallback, false); } +#endif this._isChromeCollapsed = false; }, @@ -635,6 +643,7 @@ var FullScreen = { ToolbarIconColor.inferFromText(); +#ifdef XP_MACOSX // For Lion fullscreen, all fullscreen controls are hidden, don't // bother to touch them. If we don't stop here, the following code // could cause the native fullscreen button be shown unexpectedly. @@ -642,6 +651,7 @@ var FullScreen = { if (this.useLionFullScreen) { return; } +#endif var fullscreenctls = document.getElementById("window-controls"); var navbar = document.getElementById("nav-bar"); @@ -657,11 +667,12 @@ var FullScreen = { fullscreenctls.hidden = !aEnterFS; } }; +#ifdef XP_MACOSX XPCOMUtils.defineLazyGetter(FullScreen, "useLionFullScreen", function() { // We'll only use OS X Lion full screen if we're // * on OS X - // * on Lion or higher (Darwin 11+) + // * on Lion or higher (Darwin 11+) which we ALWAYS are // * have fullscreenbutton="true" - return AppConstants.isPlatformAndVersionAtLeast("macosx", 11) && - document.documentElement.getAttribute("fullscreenbutton") == "true"; + return document.documentElement.getAttribute("fullscreenbutton") == "true"; }); +#endif diff --git a/basilisk/base/content/browser-gestureSupport.js b/basilisk/base/content/browser-gestureSupport.js index 9ca8e09..e837c96 100644 --- a/basilisk/base/content/browser-gestureSupport.js +++ b/basilisk/base/content/browser-gestureSupport.js @@ -81,9 +81,11 @@ var gGestureSupport = { break; case "MozMagnifyGestureStart": aEvent.preventDefault(); - let pinchPref = AppConstants.platform == "win" - ? def(25, 0) - : def(150, 1); +#ifdef XP_WIN + let pinchPref = def(25, 0); +#else + let pinchPref = def(150, 0); +#endif this._setupGesture(aEvent, "pinch", pinchPref, "out", "in"); break; case "MozRotateGestureStart": diff --git a/basilisk/base/content/browser-media.js b/basilisk/base/content/browser-media.js index 775fc4d..1d2d6c4 100644 --- a/basilisk/base/content/browser-media.js +++ b/basilisk/base/content/browser-media.js @@ -193,32 +193,39 @@ const TELEMETRY_DDSTAT_SOLVED = 4; let gDecoderDoctorHandler = { getLabelForNotificationBox(type) { +#ifdef XP_WIN if (type == "platform-decoder-not-found") { - if (AppConstants.platform == "win") { - return gNavigatorBundle.getString("decoder.noHWAcceleration.message"); - } - if (AppConstants.platform == "linux") { - return gNavigatorBundle.getString("decoder.noCodecsLinux.message"); - } + return gNavigatorBundle.getString("decoder.noHWAcceleration.message"); + } else { + return ""; } - if (type == "cannot-initialize-pulseaudio") { - return gNavigatorBundle.getString("decoder.noPulseAudio.message"); +#else + if (type == "platform-decoder-not-found") { + return gNavigatorBundle.getString("decoder.noCodecsLinux.message"); } - if (type == "unsupported-libavcodec" && - AppConstants.platform == "linux") { + + if (type == "unsupported-libavcodec") { return gNavigatorBundle.getString("decoder.unsupportedLibavcodec.message"); } + + if (type == "cannot-initialize-pulseaudio") { + return gNavigatorBundle.getString("decoder.noPulseAudio.message"); + } + return ""; +#endif }, getSumoForLearnHowButton(type) { - if (AppConstants.platform == "win") { - return "fix-video-audio-problems-firefox-windows"; - } +#ifdef XP_WIN + return "fix-video-audio-problems-firefox-windows"; +#else if (type == "cannot-initialize-pulseaudio") { return "fix-common-audio-and-video-issues"; } + return ""; +#endif }, receiveMessage({target: browser, data: data}) { diff --git a/basilisk/base/content/browser-places.js b/basilisk/base/content/browser-places.js index a7f33b1..dc0f9c8 100644 --- a/basilisk/base/content/browser-places.js +++ b/basilisk/base/content/browser-places.js @@ -868,12 +868,11 @@ var BookmarksEventHandler = { */ onClick: function(aEvent, aView) { // Only handle middle-click or left-click with modifiers. - let modifKey; - if (AppConstants.platform == "macosx") { - modifKey = aEvent.metaKey || aEvent.shiftKey; - } else { - modifKey = aEvent.ctrlKey || aEvent.shiftKey; - } +#ifdef XP_MACOSX + let modifKey = aEvent.metaKey || aEvent.shiftKey; +#else + let modifKey = aEvent.ctrlKey || aEvent.shiftKey; +#endif if (aEvent.button == 2 || (aEvent.button == 0 && !modifKey)) return; diff --git a/basilisk/base/content/browser-tabsintitlebar.js b/basilisk/base/content/browser-tabsintitlebar.js index 1bb348b..25e35a2 100644 --- a/basilisk/base/content/browser-tabsintitlebar.js +++ b/basilisk/base/content/browser-tabsintitlebar.js @@ -159,17 +159,17 @@ var TabsInTitlebar = { let captionButtonsBoxWidth = rect($("titlebar-buttonbox-container")).width; let secondaryButtonsWidth, menuHeight, fullMenuHeight, menuStyles; - if (AppConstants.platform == "macosx") { - secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width; - // No need to look up the menubar stuff on OS X: - menuHeight = 0; - fullMenuHeight = 0; - } else { - // Otherwise, get the height and margins separately for the menubar - menuHeight = rect(menubar).height; - menuStyles = window.getComputedStyle(menubar); - fullMenuHeight = verticalMargins(menuStyles) + menuHeight; - } +#ifdef XP_MACOSX + secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width; + // No need to look up the menubar stuff on OS X: + menuHeight = 0; + fullMenuHeight = 0; +#else + // Otherwise, get the height and margins separately for the menubar + menuHeight = rect(menubar).height; + menuStyles = window.getComputedStyle(menubar); + fullMenuHeight = verticalMargins(menuStyles) + menuHeight; +#endif // And get the height of what's in the titlebar: let titlebarContentHeight = rect(titlebarContent).height; @@ -211,9 +211,9 @@ var TabsInTitlebar = { // We need to increase the titlebar content's outer height (ie including margins) // to match the tab and menu height: let extraMargin = tabAndMenuHeight - titlebarContentHeight; - if (AppConstants.platform != "macosx") { - titlebarContent.style.marginBottom = extraMargin + "px"; - } +#ifndef XP_MACOSX + titlebarContent.style.marginBottom = extraMargin + "px"; +#endif titlebarContentHeight += extraMargin; } else { @@ -226,19 +226,19 @@ var TabsInTitlebar = { titlebar.style.marginBottom = "-" + minTitlebarOrTabsHeight + "px"; // Finally, size the placeholders: - if (AppConstants.platform == "macosx") { - this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth); - } +#ifdef XP_MACOSX + this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth); +#endif this._sizePlaceholder("caption-buttons", captionButtonsBoxWidth); } else { document.documentElement.removeAttribute("tabsintitlebar"); updateTitlebarDisplay(); - if (AppConstants.platform == "macosx") { - let secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width; - this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth); - } +#ifdef XP_MACOSX + let secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width; + this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth); +#endif // Reset the margins and padding that might have been modified: titlebarContent.style.marginTop = ""; @@ -268,35 +268,36 @@ var TabsInTitlebar = { }; function updateTitlebarDisplay() { - if (AppConstants.platform == "macosx") { // OS X and the other platforms differ enough to necessitate this kind of // special-casing. Like the other platforms where we CAN_DRAW_IN_TITLEBAR, // we draw in the OS X titlebar when putting the tabs up there. However, OS X // also draws in the titlebar when a lightweight theme is applied, regardless // of whether or not the tabs are drawn in the titlebar. - if (TabsInTitlebar.enabled) { - document.documentElement.setAttribute("chromemargin-nonlwtheme", "0,-1,-1,-1"); - document.documentElement.setAttribute("chromemargin", "0,-1,-1,-1"); - document.documentElement.removeAttribute("drawtitle"); - } else { - // We set chromemargin-nonlwtheme to "" instead of removing it as a way of - // making sure that LightweightThemeConsumer doesn't take it upon itself to - // detect this value again if and when we do a lwtheme state change. - document.documentElement.setAttribute("chromemargin-nonlwtheme", ""); - let isCustomizing = document.documentElement.hasAttribute("customizing"); - let hasLWTheme = document.documentElement.hasAttribute("lwtheme"); - let isPrivate = PrivateBrowsingUtils.isWindowPrivate(window); - if ((!hasLWTheme || isCustomizing) && !isPrivate) { - document.documentElement.removeAttribute("chromemargin"); - } - document.documentElement.setAttribute("drawtitle", "true"); +#ifdef XP_MACOSX + if (TabsInTitlebar.enabled) { + document.documentElement.setAttribute("chromemargin-nonlwtheme", "0,-1,-1,-1"); + document.documentElement.setAttribute("chromemargin", "0,-1,-1,-1"); + document.documentElement.removeAttribute("drawtitle"); + } else { + // We set chromemargin-nonlwtheme to "" instead of removing it as a way of + // making sure that LightweightThemeConsumer doesn't take it upon itself to + // detect this value again if and when we do a lwtheme state change. + document.documentElement.setAttribute("chromemargin-nonlwtheme", ""); + let isCustomizing = document.documentElement.hasAttribute("customizing"); + let hasLWTheme = document.documentElement.hasAttribute("lwtheme"); + let isPrivate = PrivateBrowsingUtils.isWindowPrivate(window); + if ((!hasLWTheme || isCustomizing) && !isPrivate) { + document.documentElement.removeAttribute("chromemargin"); } - } else if (TabsInTitlebar.enabled) { - // not OS X + document.documentElement.setAttribute("drawtitle", "true"); + } +#else +if (TabsInTitlebar.enabled) { document.documentElement.setAttribute("chromemargin", "0,2,2,2"); } else { document.documentElement.removeAttribute("chromemargin"); } +#endif } function onTitlebarMaxClick() { diff --git a/basilisk/base/content/browser.js b/basilisk/base/content/browser.js index de69eae..9d7c4dd 100644 --- a/basilisk/base/content/browser.js +++ b/basilisk/base/content/browser.js @@ -14,7 +14,7 @@ Cu.import("resource://gre/modules/NotificationDB.jsm"); [ ["AboutHome", "resource:///modules/AboutHome.jsm"], ["AddonWatcher", "resource://gre/modules/AddonWatcher.jsm"], - ["AppConstants", "resource://gre/modules/AppConstants.jsm"], + ["AppConstants", "resource://gre/modules/AppConstants.jsm"], // Kept for extension compatibility ["BrowserUsageTelemetry", "resource:///modules/BrowserUsageTelemetry.jsm"], ["BrowserUtils", "resource://gre/modules/BrowserUtils.jsm"], ["CharsetMenu", "resource://gre/modules/CharsetMenu.jsm"], @@ -120,9 +120,7 @@ XPCOMUtils.defineLazyGetter(this, "PopupNotifications", function () { }); XPCOMUtils.defineLazyGetter(this, "Win7Features", function () { - if (AppConstants.platform != "win") - return null; - +#ifdef XP_WIN const WINTASKBAR_CONTRACTID = "@mozilla.org/windows-taskbar;1"; if (WINTASKBAR_CONTRACTID in Cc && Cc[WINTASKBAR_CONTRACTID].getService(Ci.nsIWinTaskbar).available) { @@ -136,6 +134,7 @@ XPCOMUtils.defineLazyGetter(this, "Win7Features", function () { } }; } +#endif return null; }); @@ -154,9 +153,9 @@ var gAppInfo = Cc["@mozilla.org/xre/app-info;1"] .getService(Ci.nsIXULAppInfo) .QueryInterface(Ci.nsIXULRuntime); -if (AppConstants.platform != "macosx") { - var gEditUIVisible = true; -} +#ifndef XP_MACOSX +var gEditUIVisible = true; +#endif /* globals gBrowser, gNavToolbox, gURLBar, gNavigatorBundle*/ [ @@ -1295,12 +1294,12 @@ var gBrowserInit = { // unless there are downloads to be displayed. DownloadsButton.initializeIndicator(); - if (AppConstants.platform != "macosx") { - updateEditUIVisibility(); - let placesContext = document.getElementById("placesContext"); - placesContext.addEventListener("popupshowing", updateEditUIVisibility, false); - placesContext.addEventListener("popuphiding", updateEditUIVisibility, false); - } +#ifndef XP_MACOSX + updateEditUIVisibility(); + let placesContext = document.getElementById("placesContext"); + placesContext.addEventListener("popupshowing", updateEditUIVisibility, false); + placesContext.addEventListener("popuphiding", updateEditUIVisibility, false); +#endif LightWeightThemeWebInstaller.init(); @@ -1311,9 +1310,9 @@ var gBrowserInit = { FullScreen.init(); PointerLock.init(); - if (AppConstants.MOZ_DATA_REPORTING) +#ifdef MOZ_DATA_REPORTING gDataNotificationInfoBar.init(); - +#endif #ifdef MOZ_SERVICES_SYNC // initialize the sync UI gSyncUI.init(); @@ -1542,106 +1541,106 @@ var gBrowserInit = { }, }; -if (AppConstants.platform == "macosx") { - // nonBrowserWindowStartup(), nonBrowserWindowDelayedStartup(), and - // nonBrowserWindowShutdown() are used for non-browser windows in - // macBrowserOverlay - gBrowserInit.nonBrowserWindowStartup = function() { - // Disable inappropriate commands / submenus - var disabledItems = ['Browser:SavePage', - 'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain', - 'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload', - 'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen', - 'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs', - 'View:PageInfo']; - var element; - - for (let disabledItem of disabledItems) { - element = document.getElementById(disabledItem); +#ifdef XP_MACOSX +// nonBrowserWindowStartup(), nonBrowserWindowDelayedStartup(), and +// nonBrowserWindowShutdown() are used for non-browser windows in +// macBrowserOverlay +gBrowserInit.nonBrowserWindowStartup = function() { + // Disable inappropriate commands / submenus + var disabledItems = ['Browser:SavePage', + 'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain', + 'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload', + 'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen', + 'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs', + 'View:PageInfo']; + var element; + + for (let disabledItem of disabledItems) { + element = document.getElementById(disabledItem); + if (element) + element.setAttribute("disabled", "true"); + } + + // If no windows are active (i.e. we're the hidden window), disable the close, minimize + // and zoom menu commands as well + if (window.location.href == "chrome://browser/content/hiddenWindow.xul") { + var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow']; + for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) { + element = document.getElementById(hiddenWindowDisabledItem); if (element) element.setAttribute("disabled", "true"); } - // If no windows are active (i.e. we're the hidden window), disable the close, minimize - // and zoom menu commands as well - if (window.location.href == "chrome://browser/content/hiddenWindow.xul") { - var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow']; - for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) { - element = document.getElementById(hiddenWindowDisabledItem); - if (element) - element.setAttribute("disabled", "true"); - } - - // also hide the window-list separator - element = document.getElementById("sep-window-list"); - element.setAttribute("hidden", "true"); + // also hide the window-list separator + element = document.getElementById("sep-window-list"); + element.setAttribute("hidden", "true"); - // Setup the dock menu. - let dockMenuElement = document.getElementById("menu_mac_dockmenu"); - if (dockMenuElement != null) { - let nativeMenu = Cc["@mozilla.org/widget/standalonenativemenu;1"] - .createInstance(Ci.nsIStandaloneNativeMenu); + // Setup the dock menu. + let dockMenuElement = document.getElementById("menu_mac_dockmenu"); + if (dockMenuElement != null) { + let nativeMenu = Cc["@mozilla.org/widget/standalonenativemenu;1"] + .createInstance(Ci.nsIStandaloneNativeMenu); - try { - nativeMenu.init(dockMenuElement); + try { + nativeMenu.init(dockMenuElement); - let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"] - .getService(Ci.nsIMacDockSupport); - dockSupport.dockMenu = nativeMenu; - } - catch (e) { - } + let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"] + .getService(Ci.nsIMacDockSupport); + dockSupport.dockMenu = nativeMenu; + } + catch (e) { } } + } - if (PrivateBrowsingUtils.permanentPrivateBrowsing) { - document.getElementById("macDockMenuNewWindow").hidden = true; - } + if (PrivateBrowsingUtils.permanentPrivateBrowsing) { + document.getElementById("macDockMenuNewWindow").hidden = true; + } - this._delayedStartupTimeoutId = setTimeout(this.nonBrowserWindowDelayedStartup.bind(this), 0); - }; + this._delayedStartupTimeoutId = setTimeout(this.nonBrowserWindowDelayedStartup.bind(this), 0); +}; - gBrowserInit.nonBrowserWindowDelayedStartup = function() { - this._delayedStartupTimeoutId = null; +gBrowserInit.nonBrowserWindowDelayedStartup = function() { + this._delayedStartupTimeoutId = null; - // initialise the offline listener - BrowserOffline.init(); + // initialise the offline listener + BrowserOffline.init(); - // initialize the private browsing UI - gPrivateBrowsingUI.init(); + // initialize the private browsing UI + gPrivateBrowsingUI.init(); #ifdef MOZ_SERVICES_SYNC - // initialize the sync UI - gSyncUI.init(); + // initialize the sync UI + gSyncUI.init(); #endif - }; +}; - gBrowserInit.nonBrowserWindowShutdown = function() { - let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"] - .getService(Ci.nsIMacDockSupport); - dockSupport.dockMenu = null; +gBrowserInit.nonBrowserWindowShutdown = function() { + let dockSupport = Cc["@mozilla.org/widget/macdocksupport;1"] + .getService(Ci.nsIMacDockSupport); + dockSupport.dockMenu = null; - // If nonBrowserWindowDelayedStartup hasn't run yet, we have no work to do - - // just cancel the pending timeout and return; - if (this._delayedStartupTimeoutId) { - clearTimeout(this._delayedStartupTimeoutId); - return; - } + // If nonBrowserWindowDelayedStartup hasn't run yet, we have no work to do - + // just cancel the pending timeout and return; + if (this._delayedStartupTimeoutId) { + clearTimeout(this._delayedStartupTimeoutId); + return; + } - BrowserOffline.uninit(); - }; -} + BrowserOffline.uninit(); +}; +#endif /* Legacy global init functions */ var BrowserStartup = gBrowserInit.onLoad.bind(gBrowserInit); var BrowserShutdown = gBrowserInit.onUnload.bind(gBrowserInit); -if (AppConstants.platform == "macosx") { - var nonBrowserWindowStartup = gBrowserInit.nonBrowserWindowStartup.bind(gBrowserInit); - var nonBrowserWindowDelayedStartup = gBrowserInit.nonBrowserWindowDelayedStartup.bind(gBrowserInit); - var nonBrowserWindowShutdown = gBrowserInit.nonBrowserWindowShutdown.bind(gBrowserInit); -} +#ifdef XP_MACOSX +var nonBrowserWindowStartup = gBrowserInit.nonBrowserWindowStartup.bind(gBrowserInit); +var nonBrowserWindowDelayedStartup = gBrowserInit.nonBrowserWindowDelayedStartup.bind(gBrowserInit); +var nonBrowserWindowShutdown = gBrowserInit.nonBrowserWindowShutdown.bind(gBrowserInit); +#endif function HandleAppCommandEvent(evt) { switch (evt.command) { @@ -1784,9 +1783,12 @@ function BrowserStop() { } function BrowserReloadOrDuplicate(aEvent) { - let metaKeyPressed = AppConstants.platform == "macosx" - ? aEvent.metaKey - : aEvent.ctrlKey; +#ifdef XP_MACOSX + let metaKeyPressed = aEvent.metaKey +#else + let metaKeyPressed = aEvent.ctrlKey +#endif + var backgroundTabModifier = aEvent.button == 1 || metaKeyPressed; if (aEvent.shiftKey && !backgroundTabModifier) { @@ -3810,9 +3812,9 @@ function BrowserCustomizeToolbar() { */ function updateEditUIVisibility() { - if (AppConstants.platform == "macosx") - return; - +#ifdef XP_MACOSX + return; +#else let editMenuPopupState = document.getElementById("menu_EditPopup").state; let contextMenuPopupState = document.getElementById("contentAreaContextMenu").state; let placesContextMenuPopupState = document.getElementById("placesContext").state; @@ -3846,6 +3848,7 @@ function updateEditUIVisibility() goSetCommandEnabled("cmd_delete", true); goSetCommandEnabled("cmd_switchTextDirection", true); } +#endif } /** @@ -4799,9 +4802,9 @@ function setToolbarVisibility(toolbar, isVisible, persist=true) { let hidingAttribute; if (toolbar.getAttribute("type") == "menubar") { hidingAttribute = "autohide"; - if (AppConstants.platform == "linux") { - Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", !isVisible); - } +#ifdef XP_LINUX + Services.prefs.setBoolPref("ui.key.menuAccessKeyFocuses", !isVisible); +#endif } else { hidingAttribute = "collapsed"; } @@ -4828,14 +4831,17 @@ function setToolbarVisibility(toolbar, isVisible, persist=true) { var TabletModeUpdater = { init() { - if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) { +#ifdef XP_WIN + if (Services.vc.compare(Services.sysinfo.getProperty("version"), "10") >= 0) { this.update(WindowsUIUtils.inTabletMode); Services.obs.addObserver(this, "tablet-mode-change", false); } +#endif }, uninit() { - if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) { +#ifdef XP_WIN + if (Services.vc.compare(Services.sysinfo.getProperty("version"), "10") >= 0) { Services.obs.removeObserver(this, "tablet-mode-change"); } }, @@ -4860,7 +4866,7 @@ var TabletModeUpdater = { var gTabletModePageCounter = { enabled: false, inc() { - this.enabled = AppConstants.isPlatformAndVersionAtLeast("win", "10.0"); + this.enabled = Services.vc.compare(Services.sysinfo.getProperty("version"), "10") >= 0; if (!this.enabled) { this.inc = () => {}; return; @@ -4952,10 +4958,10 @@ const nodeToShortcutMap = { "downloads-button": "key_openDownloads" }; -if (AppConstants.platform == "macosx") { - nodeToTooltipMap["print-button"] = "printButton.tooltip"; - nodeToShortcutMap["print-button"] = "printKb"; -} +#ifdef XP_MACOSX +nodeToTooltipMap["print-button"] = "printButton.tooltip"; +nodeToShortcutMap["print-button"] = "printKb"; +#endif const gDynamicTooltipCache = new Map(); function UpdateDynamicShortcutTooltipText(aTooltip) { @@ -5943,11 +5949,14 @@ function warnAboutClosingWindow() { os.notifyObservers(null, "browser-lastwindow-close-granted", null); +#ifdef XP_MACOSX // OS X doesn't quit the application when the last window is closed, but keeps // the session alive. Hence don't prompt users to save tabs, but warn about // closing multiple tabs. - return AppConstants.platform != "macosx" - || (isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL)); + return isPBWindow || gBrowser.warnAboutClosingTabs(gBrowser.closingTabsEnum.ALL); +#else + return true; +#endif } var MailIntegration = { @@ -7245,12 +7254,13 @@ var gRemoteTabsUI = { return; } - if (AppConstants.platform == "macosx" && - Services.prefs.getBoolPref("layers.acceleration.disabled")) { +#ifdef XP_MACOSX + if (!Services.prefs.getBoolPref("layers.acceleration.enabled")) { // On OS X, "Disable Hardware Acceleration" also disables OMTC and forces // a fallback to Basic Layers. This is incompatible with e10s. return; } +#endif let newNonRemoteWindow = document.getElementById("menu_newNonRemoteWindow"); let autostart = Services.appinfo.browserTabsRemoteAutostart; @@ -7675,8 +7685,9 @@ var ToolbarIconColor = { } let toolbarSelector = "#navigator-toolbox > toolbar:not([collapsed=true]):not(#addon-bar)"; - if (AppConstants.platform == "macosx") - toolbarSelector += ":not([type=menubar])"; +#ifdef XP_MACOSX + toolbarSelector += ":not([type=menubar])"; +#endif // The getComputedStyle calls and setting the brighttext are separated in // two loops to avoid flushing layout and making it dirty repeatedly. diff --git a/basilisk/base/content/sanitize.js b/basilisk/base/content/sanitize.js index 0a00def..9150433 100644 --- a/basilisk/base/content/sanitize.js +++ b/basilisk/base/content/sanitize.js @@ -5,8 +5,6 @@ Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); -XPCOMUtils.defineLazyModuleGetter(this, "AppConstants", - "resource://gre/modules/AppConstants.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "FormHistory", @@ -641,21 +639,21 @@ Sanitizer.prototype = { features, defaultArgs); let onFullScreen = null; - if (AppConstants.platform == "macosx") { - onFullScreen = function(e) { - newWindow.removeEventListener("fullscreen", onFullScreen); - let docEl = newWindow.document.documentElement; - let sizemode = docEl.getAttribute("sizemode"); - if (!newWindow.fullScreen && sizemode == "fullscreen") { - docEl.setAttribute("sizemode", "normal"); - e.preventDefault(); - e.stopPropagation(); - return false; - } - return undefined; +#ifdef XP_MACOSX + onFullScreen = function(e) { + newWindow.removeEventListener("fullscreen", onFullScreen); + let docEl = newWindow.document.documentElement; + let sizemode = docEl.getAttribute("sizemode"); + if (!newWindow.fullScreen && sizemode == "fullscreen") { + docEl.setAttribute("sizemode", "normal"); + e.preventDefault(); + e.stopPropagation(); + return false; } - newWindow.addEventListener("fullscreen", onFullScreen); + return undefined; } + newWindow.addEventListener("fullscreen", onFullScreen); +#endif let promiseReady = new Promise(resolve => { // Window creation and destruction is asynchronous. We need to wait @@ -670,9 +668,9 @@ Sanitizer.prototype = { return; Services.obs.removeObserver(onWindowOpened, "browser-delayed-startup-finished"); - if (AppConstants.platform == "macosx") { - newWindow.removeEventListener("fullscreen", onFullScreen); - } +#ifdef XP_MACOSX + newWindow.removeEventListener("fullscreen", onFullScreen); +#endif newWindowOpened = true; // If we're the last thing to happen, invoke callback. if (numWindowsClosing == 0) { @@ -784,9 +782,11 @@ Sanitizer.__defineGetter__("prefs", function() // Shows sanitization UI Sanitizer.showUI = function(aParentWindow) { - let win = AppConstants.platform == "macosx" ? - null: // make this an app-modal window on Mac - aParentWindow; +#ifdef XP_MACOSX + let win = null; +#else + let win = aParentWindow; +#endif Services.ww.openWindow(win, "chrome://browser/content/sanitize.xul", "Sanitize", diff --git a/basilisk/base/content/tabbrowser.xml b/basilisk/base/content/tabbrowser.xml index df83f67..10d6873 100644 --- a/basilisk/base/content/tabbrowser.xml +++ b/basilisk/base/content/tabbrowser.xml @@ -67,9 +67,6 @@ Components.classes["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"] .getService(Components.interfaces.mozIPlacesAutoComplete); - - (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants; - document.getAnonymousElementByAttribute(this, "anonid", "tabbox"); @@ -110,7 +107,11 @@ new Map(); - this.AppConstants.platform == "macosx"; +#ifdef XP_MACOSX + true +#else + false +#endif @@ -3716,9 +3717,9 @@ dump("Assertion failure\n" + Error().stack); // Don't break a user's browser if an assertion fails. - if (this.tabbrowser.AppConstants.DEBUG) { - throw new Error("Assertion failure"); - } +#ifdef DEBUG + throw new Error("Assertion failure"); +#endif } }, @@ -4380,8 +4381,9 @@ return; } - if (aEvent.altKey) + if (aEvent.altKey) { return; + } // Don't check if the event was already consumed because tab // navigation should always work for better user experience. @@ -4399,14 +4401,14 @@ } } - if (this.AppConstants.platform != "macosx") { - if (aEvent.ctrlKey && !aEvent.shiftKey && !aEvent.metaKey && - aEvent.keyCode == KeyEvent.DOM_VK_F4 && - !this.mCurrentTab.pinned) { - this.removeCurrentTab({animate: true}); - aEvent.preventDefault(); - } +#ifndef XP_MACOSX + if (aEvent.ctrlKey && !aEvent.shiftKey && !aEvent.metaKey && + aEvent.keyCode == KeyEvent.DOM_VK_F4 && + !this.mCurrentTab.pinned) { + this.removeCurrentTab({animate: true}); + aEvent.preventDefault(); } +#endif ]]> @@ -4418,24 +4420,25 @@ return; } - if (aEvent.altKey) + if (aEvent.altKey) { return; + } - if (this.AppConstants.platform == "macosx") { - if (!aEvent.metaKey) - return; +#ifdef XP_MACOSX + if (!aEvent.metaKey) + return; - var offset = 1; - switch (aEvent.charCode) { - case '}'.charCodeAt(0): - offset = -1; - case '{'.charCodeAt(0): - if (window.getComputedStyle(this, null).direction == "ltr") - offset *= -1; - this.tabContainer.advanceSelectedTab(offset, true); - aEvent.preventDefault(); - } + var offset = 1; + switch (aEvent.charCode) { + case '}'.charCodeAt(0): + offset = -1; + case '{'.charCodeAt(0): + if (window.getComputedStyle(this, null).direction == "ltr") + offset *= -1; + this.tabContainer.advanceSelectedTab(offset, true); + aEvent.preventDefault(); } +#endif ]]> @@ -4686,9 +4689,9 @@ let els = Components.classes["@mozilla.org/eventlistenerservice;1"] .getService(nsIEventListenerService); els.addSystemEventListener(document, "keydown", this, false); - if (this.AppConstants.platform == "macosx") { - els.addSystemEventListener(document, "keypress", this, false); - } +#ifdef XP_MACOSX + els.addSystemEventListener(document, "keypress", this, false); +#endif window.addEventListener("sizemodechange", this, false); var uniqueId = this._generateUniquePanelID(); @@ -4797,9 +4800,9 @@ let els = Components.classes["@mozilla.org/eventlistenerservice;1"] .getService(nsIEventListenerService); els.removeSystemEventListener(document, "keydown", this, false); - if (this.AppConstants.platform == "macosx") { - els.removeSystemEventListener(document, "keypress", this, false); - } +#ifdef XP_MACOSX + els.removeSystemEventListener(document, "keypress", this, false); +#endif window.removeEventListener("sizemodechange", this, false); if (gMultiProcessBrowser) { @@ -6059,11 +6062,11 @@ return; let wrongModifiers; - if (this.tabbrowser.AppConstants.platform == "macosx") { - wrongModifiers = !event.metaKey; - } else { - wrongModifiers = !event.ctrlKey || event.metaKey; - } +#ifdef XP_MACOSX + wrongModifiers = !event.metaKey; +#else + wrongModifiers = !event.ctrlKey || event.metaKey; +#endif if (wrongModifiers) return; @@ -6410,10 +6413,10 @@ window.focus(); } else { let props = { screenX: left, screenY: top }; - if (this.tabbrowser.AppConstants.platform != "win") { - props.outerWidth = winWidth; - props.outerHeight = winHeight; - } +#ifndef XP_WIN + props.outerWidth = winWidth; + props.outerHeight = winHeight; +#endif this.tabbrowser.replaceTabWithWindow(draggedTab, props); } event.stopPropagation(); diff --git a/basilisk/base/content/urlbarBindings.xml b/basilisk/base/content/urlbarBindings.xml index b9c1781..7fc2f91 100644 --- a/basilisk/base/content/urlbarBindings.xml +++ b/basilisk/base/content/urlbarBindings.xml @@ -53,10 +53,6 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. - - (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants; - - - - (Components.utils.import("resource://gre/modules/AppConstants.jsm", {})).AppConstants; - - @@ -1313,9 +1309,11 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. let params = {}; // But open ctrl/cmd clicks on autocomplete items in a new background tab. - let modifier = this.AppConstants.platform == "macosx" ? - aEvent.metaKey : - aEvent.ctrlKey; +#ifdef XP_MACOSX + let modifier = aEvent.metaKey; +#else + let modifier = aEvent.ctrlKey; +#endif if (where == "tab" && (aEvent instanceof MouseEvent) && (aEvent.button == 1 || modifier)) params.inBackground = true; diff --git a/basilisk/base/content/utilityOverlay.js b/basilisk/base/content/utilityOverlay.js index 3d27f7d..d71e1ca 100644 --- a/basilisk/base/content/utilityOverlay.js +++ b/basilisk/base/content/utilityOverlay.js @@ -4,7 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Services = object with smart getters for common XPCOM services -Components.utils.import("resource://gre/modules/AppConstants.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); @@ -140,7 +139,11 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt ) // Don't do anything special with right-mouse clicks. They're probably clicks on context menu items. - var metaKey = AppConstants.platform == "macosx" ? meta : ctrl; +#ifdef XP_MACOSX + var metaKey = meta; +#else + var metaKey = ctrl +#endif if (metaKey || (middle && middleUsesTabs)) return shift ? "tabshifted" : "tab"; @@ -513,7 +516,11 @@ function eventMatchesKey(aEvent, aKey) // Capitalize first letter of aKey's modifers to compare to aEvent's modifier keyModifiers.forEach(function(modifier, index) { if (modifier == "accel") { - keyModifiers[index] = AppConstants.platform == "macosx" ? "Meta" : "Control"; +#ifdef XP_MACOSX + keyModifiers[index] = "Meta"; +#else + keyModifiers[index] = "Control"; +#endif } else { keyModifiers[index] = modifier[0].toUpperCase() + modifier.slice(1); } @@ -618,13 +625,13 @@ function openAboutDialog() { } var features = "chrome,"; - if (AppConstants.platform == "win") { - features += "centerscreen,dependent"; - } else if (AppConstants.platform == "macosx") { - features += "resizable=no,minimizable=no"; - } else { - features += "centerscreen,dependent,dialog=no"; - } +#ifdef XP_WIN + features += "centerscreen,dependent"; +#elif XP_MACOSX + features += "resizable=no,minimizable=no"; +#else + features += "centerscreen,dependent,dialog=no"; +#endif window.openDialog("chrome://browser/content/aboutDialog.xul", "", features); } diff --git a/basilisk/base/jar.mn b/basilisk/base/jar.mn index 464032f..8c02da3 100644 --- a/basilisk/base/jar.mn +++ b/basilisk/base/jar.mn @@ -11,9 +11,11 @@ browser.jar: % overlay chrome://global/content/viewSource.xul chrome://browser/content/viewSourceOverlay.xul % overlay chrome://global/content/viewPartialSource.xul chrome://browser/content/viewSourceOverlay.xul +#ifdef MOZ_UPDATER content/browser/aboutDialog-appUpdater.js (content/aboutDialog-appUpdater.js) +#endif * content/browser/aboutDialog.xul (content/aboutDialog.xul) - content/browser/aboutDialog.js (content/aboutDialog.js) +* content/browser/aboutDialog.js (content/aboutDialog.js) content/browser/aboutDialog.css (content/aboutDialog.css) * content/browser/abouthome/aboutHome.xhtml (content/abouthome/aboutHome.xhtml) content/browser/abouthome/aboutHome.js (content/abouthome/aboutHome.js) @@ -61,12 +63,12 @@ browser.jar: content/browser/browser-addons.js (content/browser-addons.js) content/browser/browser-captivePortal.js (content/browser-captivePortal.js) content/browser/browser-ctrlTab.js (content/browser-ctrlTab.js) - content/browser/browser-customization.js (content/browser-customization.js) +* content/browser/browser-customization.js (content/browser-customization.js) content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js) - content/browser/browser-feeds.js (content/browser-feeds.js) - content/browser/browser-fullScreenAndPointerLock.js (content/browser-fullScreenAndPointerLock.js) +* content/browser/browser-feeds.js (content/browser-feeds.js) +* content/browser/browser-fullScreenAndPointerLock.js (content/browser-fullScreenAndPointerLock.js) content/browser/browser-fullZoom.js (content/browser-fullZoom.js) - content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js) +* content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js) * content/browser/browser-media.js (content/browser-media.js) * content/browser/browser-places.js (content/browser-places.js) content/browser/browser-plugins.js (content/browser-plugins.js) @@ -77,7 +79,7 @@ browser.jar: content/browser/browser-sidebar.js (content/browser-sidebar.js) * content/browser/browser-tabPreviews.xml (content/browser-tabPreviews.xml) #ifdef MOZ_CAN_DRAW_IN_TITLEBAR - content/browser/browser-tabsintitlebar.js (content/browser-tabsintitlebar.js) +* content/browser/browser-tabsintitlebar.js (content/browser-tabsintitlebar.js) #else content/browser/browser-tabsintitlebar.js (content/browser-tabsintitlebar-stub.js) #endif @@ -124,16 +126,16 @@ browser.jar: content/browser/safeMode.css (content/safeMode.css) content/browser/safeMode.js (content/safeMode.js) content/browser/safeMode.xul (content/safeMode.xul) - content/browser/sanitize.js (content/sanitize.js) +* content/browser/sanitize.js (content/sanitize.js) * content/browser/sanitize.xul (content/sanitize.xul) * content/browser/sanitizeDialog.js (content/sanitizeDialog.js) content/browser/sanitizeDialog.css (content/sanitizeDialog.css) content/browser/contentSearchUI.js (content/contentSearchUI.js) content/browser/contentSearchUI.css (content/contentSearchUI.css) content/browser/tabbrowser.css (content/tabbrowser.css) - content/browser/tabbrowser.xml (content/tabbrowser.xml) - content/browser/urlbarBindings.xml (content/urlbarBindings.xml) - content/browser/utilityOverlay.js (content/utilityOverlay.js) +* content/browser/tabbrowser.xml (content/tabbrowser.xml) +* content/browser/urlbarBindings.xml (content/urlbarBindings.xml) +* content/browser/utilityOverlay.js (content/utilityOverlay.js) content/browser/usercontext.svg (content/usercontext.svg) content/browser/web-panels.js (content/web-panels.js) * content/browser/web-panels.xul (content/web-panels.xul) diff --git a/basilisk/base/moz.build b/basilisk/base/moz.build index 2e5cde1..72266f0 100644 --- a/basilisk/base/moz.build +++ b/basilisk/base/moz.build @@ -4,6 +4,7 @@ # 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/. +DEFINES['MOZ_APP_NAME'] = CONFIG['MOZ_APP_NAME'] DEFINES['MOZ_APP_VERSION'] = CONFIG['MOZ_APP_VERSION'] DEFINES['MOZ_APP_VERSION_DISPLAY'] = CONFIG['MOZ_APP_VERSION_DISPLAY'] -- cgit v1.2.3