Bug 1058358 - Add a new opt-out mechanism for each time we enable e10s on Nightly for testing. r=gavin

This commit is contained in:
Felipe Gomes 2014-09-16 13:25:46 -03:00
parent d39fd52fca
commit 235f9a1bff
3 changed files with 24 additions and 4 deletions

View File

@ -93,7 +93,8 @@ var gMainPane = {
gMainPane.enableE10SChange);
let e10sCheckbox = document.getElementById("e10sAutoStart");
let e10sPref = document.getElementById("browser.tabs.remote.autostart");
e10sCheckbox.checked = e10sPref.value;
let e10sTempPref = document.getElementById("e10sTempPref");
e10sCheckbox.checked = e10sPref.value || e10sTempPref.value;
#endif
// Notify observers that the UI is now ready
@ -107,6 +108,19 @@ var gMainPane = {
{
let e10sCheckbox = document.getElementById("e10sAutoStart");
let e10sPref = document.getElementById("browser.tabs.remote.autostart");
let e10sTempPref = document.getElementById("e10sTempPref");
let prefsToChange;
if (e10sCheckbox.checked) {
// Enabling e10s autostart
prefsToChange = [e10sPref];
} else {
// Disabling e10s autostart
prefsToChange = [e10sPref];
if (e10sTempPref.value) {
prefsToChange.push(e10sTempPref);
}
}
const Cc = Components.classes, Ci = Components.interfaces;
let brandName = document.getElementById("bundleBrand").getString("brandShortName");
@ -124,13 +138,15 @@ var gMainPane = {
shouldProceed = !cancelQuit.data;
if (shouldProceed) {
e10sPref.value = e10sCheckbox.checked;
for (let prefToChange of prefsToChange) {
prefToChange.value = e10sCheckbox.checked;
}
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
}
}
// Revert the checkbox in case we didn't quit
e10sCheckbox.checked = e10sPref.value;
e10sCheckbox.checked = e10sPref.value || e10sTempPref.value;
},
#endif

View File

@ -13,6 +13,9 @@
<preference id="browser.tabs.remote.autostart"
name="browser.tabs.remote.autostart"
type="bool"/>
<preference id="e10sTempPref"
name="browser.tabs.remote.autostart.1"
type="bool"/>
#endif
<!-- Startup -->

View File

@ -4539,7 +4539,8 @@ bool
mozilla::BrowserTabsRemoteAutostart()
{
if (!gBrowserTabsRemoteAutostartInitialized) {
bool prefEnabled = Preferences::GetBool("browser.tabs.remote.autostart", false);
bool prefEnabled = Preferences::GetBool("browser.tabs.remote.autostart", false) ||
Preferences::GetBool("browser.tabs.remote.autostart.1", false);
bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.autostart.disabled-because-using-a11y", false);
gBrowserTabsRemoteAutostart = !gSafeMode && !disabledForA11y && prefEnabled;
gBrowserTabsRemoteAutostartInitialized = true;