From 851909f27e3b0032751ca1527da80a4c175438d5 Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Fri, 22 May 2015 15:01:57 -0300 Subject: [PATCH] Bug 1164640 - Reset the flag for disabling e10s when an a11y tool is active. r=mconley There's now a blacklist in place for the tools that should be disabled, so we want to give another change for users with tools that are not blacklisted to test e10s. --- browser/components/nsBrowserGlue.js | 18 ++++++++++++++---- toolkit/xre/nsAppRunner.cpp | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 95c7aaa30938..d8cf249da2e8 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -2785,7 +2785,7 @@ let E10SUINotification = { let channelAuthorized = updateChannel == "nightly" || updateChannel == "aurora"; skipE10sChecks = !channelAuthorized || - UpdateServices.prefs.getBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y"); + Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y"); } catch(e) {} if (skipE10sChecks) { @@ -2869,7 +2869,9 @@ let E10SUINotification = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), observe: function(subject, topic, data) { - if (topic == "a11y-init-or-shutdown" && data == "1") { + if (topic == "a11y-init-or-shutdown" + && data == "1" && + Services.appinfo.accessibilityIsBlacklistedForE10S) { this._showE10sAccessibilityWarning(); } }, @@ -2959,7 +2961,15 @@ let E10SUINotification = { _warnedAboutAccessibility: false, _showE10sAccessibilityWarning: function() { - Services.prefs.setBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y", true); + try { + if (!Services.prefs.getBoolPref("browser.tabs.remote.disabled-for-a11y")) { + // Only return if the pref exists and was set to false, but not + // if the pref didn't exist (which will throw). + return; + } + } catch (e) { } + + Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", true); if (this._warnedAboutAccessibility) { return; @@ -2996,7 +3006,7 @@ let E10SUINotification = { label: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.label"), accessKey: win.gNavigatorBundle.getString("e10s.accessibilityNotice.dontDisable.accesskey"), callback: function () { - Services.prefs.setBoolPref("browser.tabs.remote.autostart.disabled-because-using-a11y", false); + Services.prefs.setBoolPref("browser.tabs.remote.disabled-for-a11y", false); } } ]; diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 0887683082dc..ace426822de7 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -4569,7 +4569,7 @@ mozilla::BrowserTabsRemoteAutostart() #else // Nightly builds, update gBrowserTabsRemoteAutostart based on all the // e10s remote relayed prefs we watch. - bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.autostart.disabled-because-using-a11y", false); + bool disabledForA11y = Preferences::GetBool("browser.tabs.remote.disabled-for-a11y", false); // Disable for VR bool disabledForVR = Preferences::GetBool("dom.vr.enabled", false);