Issue #1124: Remove Firefox Developer Edition code.

Removes all occurrences of MOZ_DEV_EDITION code and some helpers.
This commit is contained in:
wolfbeast 2019-08-14 17:19:40 +02:00 • committed by Roy Tam
commit 1f68992bee
12 changed files with 5 additions and 223 deletions

View file

@ -1009,12 +1009,7 @@ pref("services.sync.syncedTabs.showRemoteIcons", true);
pref("services.sync.sendTabToDevice.enabled", true);
// Developer edition preferences
#ifdef MOZ_DEV_EDITION
sticky_pref("lightweightThemes.selectedThemeID", "firefox-devedition@mozilla.org");
#else
sticky_pref("lightweightThemes.selectedThemeID", "");
#endif
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.

View file

@ -198,9 +198,7 @@ var CustomizableUIInternal = {
"add-ons-button",
];
if (!AppConstants.MOZ_DEV_EDITION) {
panelPlacements.splice(-1, 0, "developer-button");
}
panelPlacements.splice(-1, 0, "developer-button");
let showCharacterEncoding = Services.prefs.getComplexValue(
"browser.menu.showCharacterEncoding",
@ -225,10 +223,6 @@ var CustomizableUIInternal = {
"home-button",
];
if (AppConstants.MOZ_DEV_EDITION) {
navbarPlacements.splice(2, 0, "developer-button");
}
// Place this last, when createWidget is called for pocket, it will
// append to the toolbar.
if (Services.prefs.getPrefType("extensions.pocket.enabled") != Services.prefs.PREF_INVALID &&

View file

@ -1054,10 +1054,6 @@ BrowserGlue.prototype = {
// All initial windows have opened.
_onWindowsRestored: function BG__onWindowsRestored() {
if (AppConstants.MOZ_DEV_EDITION) {
this._createExtraDefaultProfile();
}
this._initServiceDiscovery();
// Show update notification, if needed.
@ -1193,40 +1189,6 @@ BrowserGlue.prototype = {
E10SAccessibilityCheck.onWindowsRestored();
},
_createExtraDefaultProfile: function () {
if (!AppConstants.MOZ_DEV_EDITION) {
return;
}
// If Developer Edition is the only installed Firefox version and no other
// profiles are present, create a second one for use by other versions.
// This helps Firefox versions earlier than 35 avoid accidentally using the
// unsuitable Developer Edition profile.
let profileService = Cc["@mozilla.org/toolkit/profile-service;1"]
.getService(Ci.nsIToolkitProfileService);
let profileCount = profileService.profileCount;
if (profileCount == 1 && profileService.selectedProfile.name != "default") {
let newProfile;
try {
newProfile = profileService.createProfile(null, "default");
profileService.defaultProfile = newProfile;
profileService.flush();
} catch (e) {
Cu.reportError("Could not create profile 'default': " + e);
}
if (newProfile) {
// We don't want a default profile with Developer Edition settings, an
// empty profile directory will do. The profile service of the other
// Firefox will populate it with its own stuff.
let newProfilePath = newProfile.rootDir.path;
OS.File.removeDir(newProfilePath).then(() => {
return OS.File.makeDir(newProfilePath);
}).then(null, e => {
Cu.reportError("Could not empty profile 'default': " + e);
});
}
}
},
_onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
// If user has already dismissed quit request, then do nothing
if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data)

View file

@ -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
/*

View file

@ -112,17 +112,6 @@
hidden="true">
<caption><label>&startup.label;</label></caption>
#ifdef MOZ_DEV_EDITION
<vbox id="separateProfileBox">
<checkbox id="separateProfileMode"
label="&separateProfileMode.label;"/>
<hbox align="center" class="indent">
<label id="useFirefoxSync">&useFirefoxSync.label;</label>
<label id="getStarted" class="text-link">&getStarted.label;</label>
</hbox>
</vbox>
#endif
#ifdef HAVE_SHELL_SERVICE
<vbox id="defaultBrowserBox">
<hbox align="center">

View file

@ -304,16 +304,6 @@ var ProcessHangMonitor = {
}
}];
if (AppConstants.MOZ_DEV_EDITION && report.hangType == report.SLOW_SCRIPT) {
buttons.push({
label: bundle.getString("processHang.button_debug.label"),
accessKey: bundle.getString("processHang.button_debug.accessKey"),
callback: function() {
ProcessHangMonitor.debugScript(win);
}
});
}
nb.appendNotification(bundle.getString("processHang.label"),
"process-hang",
"chrome://browser/skin/slowStartup-16.png",