From 69b36efd664063dafb07f733b0af5740b52dd3ae Mon Sep 17 00:00:00 2001 From: Botond Ballo Date: Mon, 9 Feb 2015 18:20:15 -0500 Subject: [PATCH] Bug 1127066 - Implement ChromeProcessController::HandleLongTapUp(). r=kats --- dom/ipc/TabChild.cpp | 4 +++- gfx/layers/apz/util/APZEventState.cpp | 10 ++++++++++ gfx/layers/apz/util/APZEventState.h | 3 +++ gfx/layers/apz/util/ChromeProcessController.cpp | 15 +++++++++++++++ gfx/layers/apz/util/ChromeProcessController.h | 2 +- 5 files changed, 32 insertions(+), 2 deletions(-) diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp index 2f3df054fbda..e1efc6b27bdd 100644 --- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -2102,7 +2102,9 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& a bool TabChild::RecvHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid) { - RecvHandleSingleTap(aPoint, aGuid); + if (mGlobal && mTabChildGlobal) { + mAPZEventState->ProcessLongTapUp(aPoint, aGuid, GetPresShellResolution()); + } return true; } diff --git a/gfx/layers/apz/util/APZEventState.cpp b/gfx/layers/apz/util/APZEventState.cpp index a6ad5c7de49e..841c7a78fc32 100644 --- a/gfx/layers/apz/util/APZEventState.cpp +++ b/gfx/layers/apz/util/APZEventState.cpp @@ -170,6 +170,16 @@ APZEventState::ProcessLongTap(const nsCOMPtr& aUtils, mContentReceivedInputBlockCallback->Run(aGuid, aInputBlockId, eventHandled); } +void +APZEventState::ProcessLongTapUp(const CSSPoint& aPoint, + const ScrollableLayerGuid& aGuid, + float aPresShellResolution) +{ + APZES_LOG("Handling long tap up at %s\n", Stringify(aPoint).c_str()); + + ProcessSingleTap(aPoint, aGuid, aPresShellResolution); +} + void APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid, diff --git a/gfx/layers/apz/util/APZEventState.h b/gfx/layers/apz/util/APZEventState.h index e8c28e6e0938..7320b7682230 100644 --- a/gfx/layers/apz/util/APZEventState.h +++ b/gfx/layers/apz/util/APZEventState.h @@ -57,6 +57,9 @@ public: const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId, float aPresShellResolution); + void ProcessLongTapUp(const CSSPoint& aPoint, + const ScrollableLayerGuid& aGuid, + float aPresShellResolution); void ProcessTouchEvent(const WidgetTouchEvent& aEvent, const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId); diff --git a/gfx/layers/apz/util/ChromeProcessController.cpp b/gfx/layers/apz/util/ChromeProcessController.cpp index 3348f004fb0b..3c33bc3eb7aa 100644 --- a/gfx/layers/apz/util/ChromeProcessController.cpp +++ b/gfx/layers/apz/util/ChromeProcessController.cpp @@ -160,6 +160,21 @@ ChromeProcessController::HandleLongTap(const mozilla::CSSPoint& aPoint, int32_t aInputBlockId, GetPresShellResolution()); } +void +ChromeProcessController::HandleLongTapUp(const CSSPoint& aPoint, int32_t aModifiers, + const ScrollableLayerGuid& aGuid) +{ + if (MessageLoop::current() != mUILoop) { + mUILoop->PostTask( + FROM_HERE, + NewRunnableMethod(this, &ChromeProcessController::HandleLongTapUp, + aPoint, aModifiers, aGuid)); + return; + } + + mAPZEventState->ProcessLongTapUp(aPoint, aGuid, GetPresShellResolution()); +} + void ChromeProcessController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid, APZStateChange aChange, diff --git a/gfx/layers/apz/util/ChromeProcessController.h b/gfx/layers/apz/util/ChromeProcessController.h index 270e985fa479..ee91ec6506eb 100644 --- a/gfx/layers/apz/util/ChromeProcessController.h +++ b/gfx/layers/apz/util/ChromeProcessController.h @@ -48,7 +48,7 @@ public: const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) MOZ_OVERRIDE; virtual void HandleLongTapUp(const CSSPoint& aPoint, int32_t aModifiers, - const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {} + const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE; virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize) MOZ_OVERRIDE {} virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,