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

MozReview-Commit-ID: DjnzVn0K5n1
This commit is contained in:
Aaron Klotz 2016-09-06 11:27:24 -06:00
parent 6775220daf
commit e9a3ff5953

View File

@ -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"
@ -1303,6 +1304,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.