Bug 1310788: Modify ContentParent to initialize Windows a11y on e10s; r?jimm draft
authorAaron Klotz <aklotz@mozilla.com>
Mon, 17 Oct 2016 13:08:21 -0600
changeset 426080 d068075bb11ad94395ca7402a27309045f2f5942
parent 426079 cfe67e329dab4a5a4bb67fe2e3d8be6e3b33df0d
child 426081 e944a5f446d632fef5506268d81ff999f065d534
push id32611
push useraklotz@mozilla.com
push dateMon, 17 Oct 2016 19:13:08 +0000
reviewersjimm
bugs1310788
milestone52.0a1
Bug 1310788: Modify ContentParent to initialize Windows a11y on e10s; r?jimm MozReview-Commit-ID: Kz92scZsbh2
dom/ipc/ContentParent.cpp
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -31,16 +31,17 @@
 #include "DeviceStorageStatics.h"
 #include "GMPServiceParent.h"
 #include "HandlerServiceParent.h"
 #include "IHistory.h"
 #include "imgIContainer.h"
 #include "mozIApplication.h"
 #if defined(XP_WIN) && defined(ACCESSIBILITY)
 #include "mozilla/a11y/AccessibleWrap.h"
+#include "mozilla/WindowsVersion.h"
 #endif
 #include "mozilla/ClearOnShutdown.h"
 #include "mozilla/StyleSheetInlines.h"
 #include "mozilla/DataStorage.h"
 #include "mozilla/devtools/HeapSnapshotTempFileHelperParent.h"
 #include "mozilla/docshell/OfflineCacheUpdateParent.h"
 #include "mozilla/dom/DataTransfer.h"
 #include "mozilla/dom/DOMStorageIPC.h"
@@ -1356,24 +1357,22 @@ ContentParent::Init()
     cpId.AppendInt(static_cast<uint64_t>(this->ChildID()));
     obs->NotifyObservers(static_cast<nsIObserver*>(this), "ipc:content-created", cpId.get());
   }
 
 #ifdef ACCESSIBILITY
   // If accessibility is running in chrome process then start it in content
   // process.
   if (nsIPresShell::IsAccessibilityActive()) {
-#if !defined(XP_WIN)
-    Unused << SendActivateA11y();
-#else
-    // On Windows we currently only enable a11y in the content process
-    // for testing purposes.
-    if (Preferences::GetBool(kForceEnableE10sPref, false)) {
+#if defined(XP_WIN)
+    if (IsVistaOrLater()) {
       Unused << SendActivateA11y();
     }
+#else
+    Unused << SendActivateA11y();
 #endif
   }
 #endif
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
   nsCOMPtr<nsIProfiler> profiler(do_GetService("@mozilla.org/tools/profiler;1"));
   bool profilerActive = false;
   DebugOnly<nsresult> rv = profiler->IsActive(&profilerActive);
@@ -2787,24 +2786,22 @@ ContentParent::Observe(nsISupports* aSub
     Unused << SendVolumeRemoved(volName);
   }
 #endif
 #ifdef ACCESSIBILITY
   else if (aData && !strcmp(aTopic, "a11y-init-or-shutdown")) {
     if (*aData == '1') {
       // Make sure accessibility is running in content process when
       // accessibility gets initiated in chrome process.
-#if !defined(XP_WIN)
-      Unused << SendActivateA11y();
-#else
-      // On Windows we currently only enable a11y in the content process
-      // for testing purposes.
-      if (Preferences::GetBool(kForceEnableE10sPref, false)) {
+#if defined(XP_WIN)
+      if (IsVistaOrLater()) {
         Unused << SendActivateA11y();
       }
+#else
+      Unused << SendActivateA11y();
 #endif
     } else {
       // If possible, shut down accessibility in content process when
       // accessibility gets shutdown in chrome process.
       Unused << SendShutdownA11y();
     }
   }
 #endif