Add helper for applying async transforms to widget input events. (bug 1143567 part 1, r=kats)

--HG--
extra : rebase_source : 98eece05d50dee335273b874d9f42aad949c658d
This commit is contained in:
David Anderson 2015-03-16 16:29:53 -07:00
parent 7fabed0618
commit acced07338
2 changed files with 19 additions and 0 deletions

View File

@ -1015,6 +1015,21 @@ nsBaseWidget::ProcessUntransformedAPZEvent(WidgetInputEvent* aEvent,
return status;
}
nsEventStatus
nsBaseWidget::DispatchInputEvent(WidgetInputEvent* aEvent)
{
if (mAPZC) {
nsEventStatus result = mAPZC->ReceiveInputEvent(*aEvent, nullptr, nullptr);
if (result == nsEventStatus_eConsumeNoDefault) {
return result;
}
}
nsEventStatus status;
DispatchEvent(aEvent, status);
return status;
}
nsEventStatus
nsBaseWidget::DispatchAPZAwareEvent(WidgetInputEvent* aEvent)
{

View File

@ -231,6 +231,10 @@ public:
NS_IMETHOD UnregisterTouchWindow() MOZ_OVERRIDE;
NS_IMETHOD_(TextEventDispatcher*) GetTextEventDispatcher() MOZ_OVERRIDE MOZ_FINAL;
// Helper function for dispatching events which are not processed by APZ,
// but need to be transformed by APZ.
nsEventStatus DispatchInputEvent(mozilla::WidgetInputEvent* aEvent);
// Dispatch an event that must be first be routed through APZ.
nsEventStatus DispatchAPZAwareEvent(mozilla::WidgetInputEvent* aEvent) MOZ_OVERRIDE;