Bug 1297549: Part 3 - Modify Windows AccessibleWrap to get hwnd from TabChild under e10s; r=tbsaunde

MozReview-Commit-ID: Jn2f9EAtT8O

--HG--
extra : rebase_source : 6ee62ec6b18d22f76ce6f2b60de9b0f408a5ec92
This commit is contained in:
Aaron Klotz 2016-09-06 11:27:24 -06:00
Родитель cd649a45e3
Коммит 52624b56b2
1 изменённых файлов: 17 добавлений и 0 удалений

Просмотреть файл

@ -9,6 +9,7 @@
#include "Compatibility.h"
#include "DocAccessible-inl.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/a11y/DocAccessibleChild.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "EnumVariant.h"
@ -1295,6 +1296,22 @@ AccessibleWrap::GetHWNDFor(Accessible* aAccessible)
return nullptr;
}
if (XRE_IsContentProcess()) {
DocAccessible* doc = aAccessible->Document();
if (!doc) {
return nullptr;
}
DocAccessibleChild* ipcDoc = doc->IPCDoc();
if (!ipcDoc) {
return nullptr;
}
auto tab = static_cast<dom::TabChild*>(ipcDoc->Manager());
MOZ_ASSERT(tab);
return reinterpret_cast<HWND>(tab->GetNativeWindowHandle());
}
// Accessibles in child processes are said to have the HWND of the window
// their tab is within. Popups are always in the parent process, and so
// never proxied, which means this is basically correct.