зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1297549: Part 2 - Propagate changes in tab native window down to content for a11y; r=jimm
MozReview-Commit-ID: 4akhzCtYciq
This commit is contained in:
Родитель
6eb5eabb31
Коммит
b9b9c1ca1f
|
@ -837,6 +837,14 @@ child:
|
|||
*/
|
||||
async Print(uint64_t aOuterWindowID, PrintData aPrintData);
|
||||
|
||||
/**
|
||||
* Update the child with the tab's current top-level native window handle.
|
||||
* This is used by a11y objects who must expose their native window.
|
||||
*
|
||||
* @param aNewHandle The native window handle of the tab's top-level window.
|
||||
*/
|
||||
async UpdateNativeWindowHandle(uintptr_t aNewHandle);
|
||||
|
||||
/*
|
||||
* FIXME: write protocol!
|
||||
|
||||
|
|
|
@ -549,6 +549,9 @@ TabChild::TabChild(nsIContentChild* aManager,
|
|||
, mDidLoadURLInit(false)
|
||||
, mAPZChild(nullptr)
|
||||
, mLayerObserverEpoch(0)
|
||||
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||
, mNativeWindowHandle(0)
|
||||
#endif
|
||||
{
|
||||
// In the general case having the TabParent tell us if APZ is enabled or not
|
||||
// doesn't really work because the TabParent itself may not have a reference
|
||||
|
@ -2534,6 +2537,17 @@ TabChild::RecvPrint(const uint64_t& aOuterWindowID, const PrintData& aPrintData)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvUpdateNativeWindowHandle(const uintptr_t& aNewHandle)
|
||||
{
|
||||
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||
mNativeWindowHandle = aNewHandle;
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvDestroy()
|
||||
{
|
||||
|
|
|
@ -590,6 +590,8 @@ public:
|
|||
virtual bool RecvPrint(const uint64_t& aOuterWindowID,
|
||||
const PrintData& aPrintData) override;
|
||||
|
||||
virtual bool RecvUpdateNativeWindowHandle(const uintptr_t& aNewHandle) override;
|
||||
|
||||
/**
|
||||
* Native widget remoting protocol for use with windowed plugins with e10s.
|
||||
*/
|
||||
|
@ -651,6 +653,10 @@ public:
|
|||
// Request that the docshell be marked as active.
|
||||
void ForcePaint(uint64_t aLayerObserverEpoch);
|
||||
|
||||
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||
uintptr_t GetNativeWindowHandle() const { return mNativeWindowHandle; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
virtual ~TabChild();
|
||||
|
||||
|
@ -789,6 +795,11 @@ private:
|
|||
// The most recently seen layer observer epoch in RecvSetDocShellIsActive.
|
||||
uint64_t mLayerObserverEpoch;
|
||||
|
||||
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||
// The handle associated with the native window that contains this tab
|
||||
uintptr_t mNativeWindowHandle;
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
||||
};
|
||||
|
||||
|
|
|
@ -400,6 +400,17 @@ TabParent::SetOwnerElement(Element* aElement)
|
|||
Unused << SendSetUseGlobalHistory(useGlobalHistory);
|
||||
}
|
||||
|
||||
#if defined(XP_WIN) && defined(ACCESSIBILITY)
|
||||
if (!mIsDestroyed) {
|
||||
uintptr_t newWindowHandle = 0;
|
||||
if (nsCOMPtr<nsIWidget> widget = GetWidget()) {
|
||||
newWindowHandle =
|
||||
reinterpret_cast<uintptr_t>(widget->GetNativeData(NS_NATIVE_WINDOW));
|
||||
}
|
||||
Unused << SendUpdateNativeWindowHandle(newWindowHandle);
|
||||
}
|
||||
#endif
|
||||
|
||||
AddWindowListeners();
|
||||
TryCacheDPIAndScale();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче