Bug 1144831 - Remove the HandleLongTapUp callback and just use HandleSingleTap instead. r=botond

This commit is contained in:
Kartikaya Gupta 2015-03-20 14:26:52 -04:00
Родитель c7ad8fb6d0
Коммит bd98be2c55
17 изменённых файлов: 8 добавлений и 134 удалений

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

@ -528,7 +528,6 @@ child:
HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid); HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid); HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
HandleLongTap(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId); HandleLongTap(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
HandleLongTapUp(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid);
NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg); NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);

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

@ -2113,15 +2113,6 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers,
return true; return true;
} }
bool
TabChild::RecvHandleLongTapUp(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid)
{
if (mGlobal && mTabChildGlobal) {
mAPZEventState->ProcessLongTapUp(aPoint, aModifiers, aGuid, GetPresShellResolution());
}
return true;
}
bool bool
TabChild::RecvNotifyAPZStateChange(const ViewID& aViewId, TabChild::RecvNotifyAPZStateChange(const ViewID& aViewId,
const APZStateChange& aChange, const APZStateChange& aChange,

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

@ -335,9 +335,6 @@ public:
const Modifiers& aModifiers, const Modifiers& aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid, const mozilla::layers::ScrollableLayerGuid& aGuid,
const uint64_t& aInputBlockId) MOZ_OVERRIDE; const uint64_t& aInputBlockId) MOZ_OVERRIDE;
virtual bool RecvHandleLongTapUp(const CSSPoint& aPoint,
const Modifiers& aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId, virtual bool RecvNotifyAPZStateChange(const ViewID& aViewId,
const APZStateChange& aChange, const APZStateChange& aChange,
const int& aArg) MOZ_OVERRIDE; const int& aArg) MOZ_OVERRIDE;

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

@ -964,15 +964,6 @@ void TabParent::HandleLongTap(const CSSPoint& aPoint,
} }
} }
void TabParent::HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid &aGuid)
{
if (!mIsDestroyed) {
unused << SendHandleLongTapUp(aPoint, aModifiers, aGuid);
}
}
void TabParent::NotifyAPZStateChange(ViewID aViewId, void TabParent::NotifyAPZStateChange(ViewID aViewId,
APZStateChange aChange, APZStateChange aChange,
int aArg) int aArg)
@ -1198,15 +1189,6 @@ bool TabParent::SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModi
return PBrowserParent::SendHandleLongTap(AdjustTapToChildWidget(aPoint), aModifiers, aGuid, aInputBlockId); return PBrowserParent::SendHandleLongTap(AdjustTapToChildWidget(aPoint), aModifiers, aGuid, aInputBlockId);
} }
bool TabParent::SendHandleLongTapUp(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid)
{
if (mIsDestroyed) {
return false;
}
return PBrowserParent::SendHandleLongTapUp(AdjustTapToChildWidget(aPoint), aModifiers, aGuid);
}
bool TabParent::SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid) bool TabParent::SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid)
{ {
if (mIsDestroyed) { if (mIsDestroyed) {

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

@ -239,9 +239,6 @@ public:
Modifiers aModifiers, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId); uint64_t aInputBlockId);
void HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid);
void NotifyAPZStateChange(ViewID aViewId, void NotifyAPZStateChange(ViewID aViewId,
APZStateChange aChange, APZStateChange aChange,
int aArg); int aArg);
@ -268,7 +265,6 @@ public:
bool SendRealTouchEvent(WidgetTouchEvent& event); bool SendRealTouchEvent(WidgetTouchEvent& event);
bool SendHandleSingleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid); bool SendHandleSingleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
bool SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId); bool SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId);
bool SendHandleLongTapUp(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
bool SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid); bool SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
virtual PDocumentRendererParent* virtual PDocumentRendererParent*

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

@ -74,18 +74,6 @@ public:
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) = 0; uint64_t aInputBlockId) = 0;
/**
* Requests handling of releasing a long tap. |aPoint| is in CSS pixels,
* relative to the current scroll offset. HandleLongTapUp will always be
* preceeded by HandleLongTap. However not all calls to HandleLongTap will
* be followed by a HandleLongTapUp (for example, if the user drags
* around between the long-tap and lifting their finger, or if content
* notifies the APZ that the long-tap event was prevent-defaulted).
*/
virtual void HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid) = 0;
/** /**
* Requests sending a mozbrowserasyncscroll domevent to embedder. * Requests sending a mozbrowserasyncscroll domevent to embedder.
* |aContentRect| is in CSS pixels, relative to the current cssPage. * |aContentRect| is in CSS pixels, relative to the current cssPage.

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

@ -1637,15 +1637,7 @@ nsEventStatus AsyncPanZoomController::OnLongPress(const TapGestureInput& aEvent)
nsEventStatus AsyncPanZoomController::OnLongPressUp(const TapGestureInput& aEvent) { nsEventStatus AsyncPanZoomController::OnLongPressUp(const TapGestureInput& aEvent) {
APZC_LOG("%p got a long-tap-up in state %d\n", this, mState); APZC_LOG("%p got a long-tap-up in state %d\n", this, mState);
nsRefPtr<GeckoContentController> controller = GetGeckoContentController(); return GenerateSingleTap(aEvent.mLocalPoint, aEvent.modifiers);
if (controller) {
CSSPoint geckoScreenPoint;
if (ConvertToGecko(aEvent.mLocalPoint, &geckoScreenPoint)) {
controller->HandleLongTapUp(geckoScreenPoint, aEvent.modifiers, GetGuid());
return nsEventStatus_eConsumeNoDefault;
}
}
return nsEventStatus_eIgnore;
} }
nsEventStatus AsyncPanZoomController::GenerateSingleTap(const ParentLayerPoint& aPoint, mozilla::Modifiers aModifiers) { nsEventStatus AsyncPanZoomController::GenerateSingleTap(const ParentLayerPoint& aPoint, mozilla::Modifiers aModifiers) {

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

@ -233,17 +233,6 @@ APZEventState::ProcessLongTap(const nsCOMPtr<nsIDOMWindowUtils>& aUtils,
mContentReceivedInputBlockCallback->Run(aGuid, aInputBlockId, eventHandled); mContentReceivedInputBlockCallback->Run(aGuid, aInputBlockId, eventHandled);
} }
void
APZEventState::ProcessLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid,
float aPresShellResolution)
{
APZES_LOG("Handling long tap up at %s\n", Stringify(aPoint).c_str());
ProcessSingleTap(aPoint, aModifiers, aGuid, aPresShellResolution);
}
void void
APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent, APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,

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

@ -59,10 +59,6 @@ public:
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId, uint64_t aInputBlockId,
float aPresShellResolution); float aPresShellResolution);
void ProcessLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid,
float aPresShellResolution);
void ProcessTouchEvent(const WidgetTouchEvent& aEvent, void ProcessTouchEvent(const WidgetTouchEvent& aEvent,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId); uint64_t aInputBlockId);

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

@ -183,21 +183,6 @@ ChromeProcessController::HandleLongTap(const mozilla::CSSPoint& aPoint, Modifier
aInputBlockId, GetPresShellResolution()); aInputBlockId, GetPresShellResolution());
} }
void
ChromeProcessController::HandleLongTapUp(const CSSPoint& aPoint, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid)
{
if (MessageLoop::current() != mUILoop) {
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &ChromeProcessController::HandleLongTapUp,
aPoint, aModifiers, aGuid));
return;
}
mAPZEventState->ProcessLongTapUp(aPoint, aModifiers, aGuid, GetPresShellResolution());
}
void void
ChromeProcessController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid, ChromeProcessController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
APZStateChange aChange, APZStateChange aChange,

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

@ -50,8 +50,6 @@ public:
virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers, virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid, const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) MOZ_OVERRIDE; uint64_t aInputBlockId) MOZ_OVERRIDE;
virtual void HandleLongTapUp(const CSSPoint& aPoint, Modifiers aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect,
const mozilla::CSSSize &aScrollableSize) MOZ_OVERRIDE {} const mozilla::CSSSize &aScrollableSize) MOZ_OVERRIDE {}
virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid, virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,

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

@ -66,7 +66,6 @@ public:
MOCK_METHOD3(HandleDoubleTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&)); MOCK_METHOD3(HandleDoubleTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&));
MOCK_METHOD3(HandleSingleTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&)); MOCK_METHOD3(HandleSingleTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&));
MOCK_METHOD4(HandleLongTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&, uint64_t)); MOCK_METHOD4(HandleLongTap, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&, uint64_t));
MOCK_METHOD3(HandleLongTapUp, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&));
MOCK_METHOD3(SendAsyncScrollDOMEvent, void(bool aIsRoot, const CSSRect &aContentRect, const CSSSize &aScrollableSize)); MOCK_METHOD3(SendAsyncScrollDOMEvent, void(bool aIsRoot, const CSSRect &aContentRect, const CSSSize &aScrollableSize));
MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs)); MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs));
MOCK_METHOD3(NotifyAPZStateChange, void(const ScrollableLayerGuid& aGuid, APZStateChange aChange, int aArg)); MOCK_METHOD3(NotifyAPZStateChange, void(const ScrollableLayerGuid& aGuid, APZStateChange aChange, int aArg));
@ -1390,9 +1389,9 @@ protected:
EXPECT_CALL(*mcc, HandleLongTap(CSSPoint(10, 10), 0, apzc->GetGuid(), blockId)).Times(1); EXPECT_CALL(*mcc, HandleLongTap(CSSPoint(10, 10), 0, apzc->GetGuid(), blockId)).Times(1);
EXPECT_CALL(check, Call("postHandleLongTap")); EXPECT_CALL(check, Call("postHandleLongTap"));
EXPECT_CALL(check, Call("preHandleLongTapUp")); EXPECT_CALL(check, Call("preHandleSingleTap"));
EXPECT_CALL(*mcc, HandleLongTapUp(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1); EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
EXPECT_CALL(check, Call("postHandleLongTapUp")); EXPECT_CALL(check, Call("postHandleSingleTap"));
} }
// There is a longpress event scheduled on a timeout // There is a longpress event scheduled on a timeout
@ -1419,10 +1418,11 @@ protected:
// Finally, simulate lifting the finger. Since the long-press wasn't // Finally, simulate lifting the finger. Since the long-press wasn't
// prevent-defaulted, we should get a long-tap-up event. // prevent-defaulted, we should get a long-tap-up event.
check.Call("preHandleLongTapUp"); check.Call("preHandleSingleTap");
status = TouchUp(apzc, 10, 10, time); status = TouchUp(apzc, 10, 10, time);
mcc->RunDelayedTask();
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status); EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
check.Call("postHandleLongTapUp"); check.Call("postHandleSingleTap");
apzc->AssertStateIsReset(); apzc->AssertStateIsReset();
} }
@ -1488,7 +1488,7 @@ protected:
status = apzc->ReceiveInputEvent(mti, nullptr); status = apzc->ReceiveInputEvent(mti, nullptr);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status); EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
EXPECT_CALL(*mcc, HandleLongTapUp(CSSPoint(touchX, touchEndY), 0, apzc->GetGuid())).Times(0); EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(touchX, touchEndY), 0, apzc->GetGuid())).Times(0);
status = TouchUp(apzc, touchX, touchEndY, time); status = TouchUp(apzc, touchX, touchEndY, time);
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status); EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);

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

@ -196,25 +196,6 @@ public:
} }
} }
virtual void HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE
{
if (MessageLoop::current() != mUILoop) {
// We have to send this message from the "UI thread" (main
// thread).
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &RemoteContentController::HandleLongTapUp,
aPoint, aModifiers, aGuid));
return;
}
if (mRenderFrame) {
TabParent* browser = TabParent::GetFrom(mRenderFrame->Manager());
browser->HandleLongTapUp(aPoint, aModifiers, aGuid);
}
}
void ClearRenderFrame() { mRenderFrame = nullptr; } void ClearRenderFrame() { mRenderFrame = nullptr; }
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, virtual void SendAsyncScrollDOMEvent(bool aIsRoot,

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

@ -152,14 +152,6 @@ APZCCallbackHandler::HandleLongTap(const CSSPoint& aPoint,
NS_LITERAL_CSTRING("Gesture:LongPress"), data)); NS_LITERAL_CSTRING("Gesture:LongPress"), data));
} }
void
APZCCallbackHandler::HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid)
{
HandleSingleTap(aPoint, aModifiers, aGuid);
}
void void
APZCCallbackHandler::SendAsyncScrollDOMEvent(bool aIsRoot, APZCCallbackHandler::SendAsyncScrollDOMEvent(bool aIsRoot,
const CSSRect& aContentRect, const CSSRect& aContentRect,

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

@ -55,8 +55,6 @@ public: // GeckoContentController methods
void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers, void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid, const mozilla::layers::ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) MOZ_OVERRIDE; uint64_t aInputBlockId) MOZ_OVERRIDE;
void HandleLongTapUp(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect& aContentRect, void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect& aContentRect,
const mozilla::CSSSize& aScrollableSize) MOZ_OVERRIDE; const mozilla::CSSSize& aScrollableSize) MOZ_OVERRIDE;
void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE; void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;

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

@ -235,13 +235,6 @@ APZController::HandleLongTap(const CSSPoint& aPoint,
ContentReceivedInputBlock(aInputBlockId, false); ContentReceivedInputBlock(aInputBlockId, false);
} }
void
APZController::HandleLongTapUp(const CSSPoint& aPoint,
Modifiers aModifiers,
const ScrollableLayerGuid& aGuid)
{
}
// requests that we send a mozbrowserasyncscroll domevent. not in use. // requests that we send a mozbrowserasyncscroll domevent. not in use.
void void
APZController::SendAsyncScrollDOMEvent(bool aIsRoot, APZController::SendAsyncScrollDOMEvent(bool aIsRoot,

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

@ -50,9 +50,6 @@ public:
Modifiers aModifiers, Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid, const mozilla::layers::ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId); uint64_t aInputBlockId);
virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint,
Modifiers aModifiers,
const mozilla::layers::ScrollableLayerGuid& aGuid);
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize); virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
virtual void PostDelayedTask(Task* aTask, int aDelayMs); virtual void PostDelayedTask(Task* aTask, int aDelayMs);
virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints); virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);