From 9f7b943c1de5e9ae010ff839ee7e601a081d42e1 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 14 Aug 2019 17:19:40 +0200 Subject: Issue #1124: Remove Firefox Developer Edition code. Removes all occurrences of MOZ_DEV_EDITION code and some helpers. --- .../components/preferences/in-content/main.js | 77 ---------------------- .../components/preferences/in-content/main.xul | 11 ---- 2 files changed, 88 deletions(-) (limited to 'application/basilisk/components/preferences') diff --git a/application/basilisk/components/preferences/in-content/main.js b/application/basilisk/components/preferences/in-content/main.js index bac771bec..8f3dffa57 100644 --- a/application/basilisk/components/preferences/in-content/main.js +++ b/application/basilisk/components/preferences/in-content/main.js @@ -78,18 +78,6 @@ var gMainPane = { setEventListener("chooseFolder", "command", gMainPane.chooseFolder); - if (AppConstants.MOZ_DEV_EDITION) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - setEventListener("separateProfileMode", "command", gMainPane.separateProfileModeChange); - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - setEventListener("getStarted", "click", gMainPane.onGetStarted); - - OS.File.stat(ignoreSeparateProfile).then(() => separateProfileModeCheckbox.checked = false, - () => separateProfileModeCheckbox.checked = true); - } - // Notify observers that the UI is now ready Components.classes["@mozilla.org/observer-service;1"] .getService(Components.interfaces.nsIObserverService) @@ -101,71 +89,6 @@ var gMainPane = { // **STUB** }, - separateProfileModeChange: function () - { - if (AppConstants.MOZ_DEV_EDITION) { - function quitApp() { - Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestartNotSameProfile); - } - function revertCheckbox(error) { - separateProfileModeCheckbox.checked = !separateProfileModeCheckbox.checked; - if (error) { - Cu.reportError("Failed to toggle separate profile mode: " + error); - } - } - function createOrRemoveSpecialDevEditionFile(onSuccess) { - let uAppData = OS.Constants.Path.userApplicationDataDir; - let ignoreSeparateProfile = OS.Path.join(uAppData, "ignore-dev-edition-profile"); - - if (separateProfileModeCheckbox.checked) { - OS.File.remove(ignoreSeparateProfile).then(onSuccess, revertCheckbox); - } else { - OS.File.writeAtomic(ignoreSeparateProfile, new Uint8Array()).then(onSuccess, revertCheckbox); - } - } - - let separateProfileModeCheckbox = document.getElementById("separateProfileMode"); - let button_index = confirmRestartPrompt(separateProfileModeCheckbox.checked, - 0, false, true); - switch (button_index) { - case CONFIRM_RESTART_PROMPT_CANCEL: - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_NOW: - const Cc = Components.classes, Ci = Components.interfaces; - let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"] - .createInstance(Ci.nsISupportsPRBool); - Services.obs.notifyObservers(cancelQuit, "quit-application-requested", - "restart"); - if (!cancelQuit.data) { - createOrRemoveSpecialDevEditionFile(quitApp); - return; - } - - // Revert the checkbox in case we didn't quit - revertCheckbox(); - return; - case CONFIRM_RESTART_PROMPT_RESTART_LATER: - createOrRemoveSpecialDevEditionFile(); - return; - } - } - }, - - onGetStarted: function (aEvent) { - if (AppConstants.MOZ_DEV_EDITION) { - const Cc = Components.classes, Ci = Components.interfaces; - let wm = Cc["@mozilla.org/appshell/window-mediator;1"] - .getService(Ci.nsIWindowMediator); - let win = wm.getMostRecentWindow("navigator:browser"); - - if (win) { - let accountsTab = win.gBrowser.addTab("about:accounts?action=signin&entrypoint=dev-edition-setup"); - win.gBrowser.selectedTab = accountsTab; - } - } - }, - // HOME PAGE /* diff --git a/application/basilisk/components/preferences/in-content/main.xul b/application/basilisk/components/preferences/in-content/main.xul index 8eca11877..f695b308b 100644 --- a/application/basilisk/components/preferences/in-content/main.xul +++ b/application/basilisk/components/preferences/in-content/main.xul @@ -112,17 +112,6 @@ hidden="true"> -#ifdef MOZ_DEV_EDITION - - - - - - - -#endif - #ifdef HAVE_SHELL_SERVICE -- cgit v1.2.3