From 8aeaf5387b4c2472736492a277e590811d0c5abb Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Tue, 1 Dec 2015 20:05:36 -0200 Subject: [PATCH] Bug 1228655 - Remove ifdefs for gEditUIVisible. r=Gijs --- browser/base/content/browser-customization.js | 5 ++-- browser/base/content/browser.js | 23 ++++++++++--------- browser/base/jar.mn | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js index c7fe2f7d8f4..df3cbc2791a 100644 --- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -63,9 +63,8 @@ var CustomizationHandler = { gHomeButton.updateTooltip(); XULBrowserWindow.init(); -#ifndef XP_MACOSX - updateEditUIVisibility(); -#endif + if (AppConstants.platform != "macosx") + updateEditUIVisibility(); // 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/browser/base/content/browser.js b/browser/base/content/browser.js index 193a54aae5a..e09b1824f6d 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -104,9 +104,9 @@ var gAppInfo = Cc["@mozilla.org/xre/app-info;1"] .getService(Ci.nsIXULAppInfo) .QueryInterface(Ci.nsIXULRuntime); -#ifndef XP_MACOSX -var gEditUIVisible = true; -#endif +if (AppConstants.platform != "macosx") { + var gEditUIVisible = true; +} [ ["gBrowser", "content"], @@ -1309,12 +1309,12 @@ var gBrowserInit = { // unless there are downloads to be displayed. DownloadsButton.initializeIndicator(); -#ifndef XP_MACOSX - updateEditUIVisibility(); - let placesContext = document.getElementById("placesContext"); - placesContext.addEventListener("popupshowing", updateEditUIVisibility, false); - placesContext.addEventListener("popuphiding", updateEditUIVisibility, false); -#endif + if (AppConstants.platform != "macosx") { + updateEditUIVisibility(); + let placesContext = document.getElementById("placesContext"); + placesContext.addEventListener("popupshowing", updateEditUIVisibility, false); + placesContext.addEventListener("popuphiding", updateEditUIVisibility, false); + } LightWeightThemeWebInstaller.init(); @@ -3967,7 +3967,9 @@ function BrowserCustomizeToolbar() { */ function updateEditUIVisibility() { -#ifndef XP_MACOSX + if (AppConstants.platform == "macosx") + return; + let editMenuPopupState = document.getElementById("menu_EditPopup").state; let contextMenuPopupState = document.getElementById("contentAreaContextMenu").state; let placesContextMenuPopupState = document.getElementById("placesContext").state; @@ -4001,7 +4003,6 @@ function updateEditUIVisibility() goSetCommandEnabled("cmd_delete", true); goSetCommandEnabled("cmd_switchTextDirection", true); } -#endif } /** diff --git a/browser/base/jar.mn b/browser/base/jar.mn index 5629352e872..86a5f602702 100644 --- a/browser/base/jar.mn +++ b/browser/base/jar.mn @@ -79,7 +79,7 @@ browser.jar: * content/browser/browser.xul (content/browser.xul) content/browser/browser-addons.js (content/browser-addons.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-devedition.js (content/browser-devedition.js) content/browser/browser-eme.js (content/browser-eme.js)