зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1144831 - Remove the HandleLongTapUp callback and just use HandleSingleTap instead. r=botond
This commit is contained in:
Родитель
c7ad8fb6d0
Коммит
bd98be2c55
|
@ -528,7 +528,6 @@ child:
|
|||
HandleDoubleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
|
||||
HandleSingleTap(CSSPoint aPoint, Modifiers aModifiers, ScrollableLayerGuid aGuid);
|
||||
HandleLongTap(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid, uint64_t aInputBlockId);
|
||||
HandleLongTapUp(CSSPoint point, Modifiers aModifiers, ScrollableLayerGuid aGuid);
|
||||
NotifyAPZStateChange(ViewID aViewId, APZStateChange aChange, int aArg);
|
||||
|
||||
|
||||
|
|
|
@ -2113,15 +2113,6 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers,
|
|||
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
|
||||
TabChild::RecvNotifyAPZStateChange(const ViewID& aViewId,
|
||||
const APZStateChange& aChange,
|
||||
|
|
|
@ -335,9 +335,6 @@ public:
|
|||
const Modifiers& aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
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,
|
||||
const APZStateChange& aChange,
|
||||
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,
|
||||
APZStateChange aChange,
|
||||
int aArg)
|
||||
|
@ -1198,15 +1189,6 @@ bool TabParent::SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModi
|
|||
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)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
|
|
|
@ -239,9 +239,6 @@ public:
|
|||
Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId);
|
||||
void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid);
|
||||
void NotifyAPZStateChange(ViewID aViewId,
|
||||
APZStateChange aChange,
|
||||
int aArg);
|
||||
|
@ -268,7 +265,6 @@ public:
|
|||
bool SendRealTouchEvent(WidgetTouchEvent& event);
|
||||
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 SendHandleLongTapUp(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
|
||||
|
||||
virtual PDocumentRendererParent*
|
||||
|
|
|
@ -74,18 +74,6 @@ public:
|
|||
const ScrollableLayerGuid& aGuid,
|
||||
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.
|
||||
* |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) {
|
||||
APZC_LOG("%p got a long-tap-up in state %d\n", this, mState);
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
if (controller) {
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mLocalPoint, &geckoScreenPoint)) {
|
||||
controller->HandleLongTapUp(geckoScreenPoint, aEvent.modifiers, GetGuid());
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
}
|
||||
return nsEventStatus_eIgnore;
|
||||
return GenerateSingleTap(aEvent.mLocalPoint, aEvent.modifiers);
|
||||
}
|
||||
|
||||
nsEventStatus AsyncPanZoomController::GenerateSingleTap(const ParentLayerPoint& aPoint, mozilla::Modifiers aModifiers) {
|
||||
|
|
|
@ -233,17 +233,6 @@ APZEventState::ProcessLongTap(const nsCOMPtr<nsIDOMWindowUtils>& aUtils,
|
|||
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
|
||||
APZEventState::ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
|
|
|
@ -59,10 +59,6 @@ public:
|
|||
const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId,
|
||||
float aPresShellResolution);
|
||||
void ProcessLongTapUp(const CSSPoint& aPoint,
|
||||
Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
float aPresShellResolution);
|
||||
void ProcessTouchEvent(const WidgetTouchEvent& aEvent,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
uint64_t aInputBlockId);
|
||||
|
|
|
@ -183,21 +183,6 @@ ChromeProcessController::HandleLongTap(const mozilla::CSSPoint& aPoint, Modifier
|
|||
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
|
||||
ChromeProcessController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
||||
APZStateChange aChange,
|
||||
|
|
|
@ -50,8 +50,6 @@ public:
|
|||
virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid,
|
||||
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,
|
||||
const mozilla::CSSSize &aScrollableSize) MOZ_OVERRIDE {}
|
||||
virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
||||
|
|
|
@ -66,7 +66,6 @@ public:
|
|||
MOCK_METHOD3(HandleDoubleTap, 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_METHOD3(HandleLongTapUp, void(const CSSPoint&, Modifiers, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(SendAsyncScrollDOMEvent, void(bool aIsRoot, const CSSRect &aContentRect, const CSSSize &aScrollableSize));
|
||||
MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs));
|
||||
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(check, Call("postHandleLongTap"));
|
||||
|
||||
EXPECT_CALL(check, Call("preHandleLongTapUp"));
|
||||
EXPECT_CALL(*mcc, HandleLongTapUp(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(check, Call("postHandleLongTapUp"));
|
||||
EXPECT_CALL(check, Call("preHandleSingleTap"));
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(check, Call("postHandleSingleTap"));
|
||||
}
|
||||
|
||||
// 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
|
||||
// prevent-defaulted, we should get a long-tap-up event.
|
||||
check.Call("preHandleLongTapUp");
|
||||
check.Call("preHandleSingleTap");
|
||||
status = TouchUp(apzc, 10, 10, time);
|
||||
mcc->RunDelayedTask();
|
||||
EXPECT_EQ(nsEventStatus_eConsumeDoDefault, status);
|
||||
check.Call("postHandleLongTapUp");
|
||||
check.Call("postHandleSingleTap");
|
||||
|
||||
apzc->AssertStateIsReset();
|
||||
}
|
||||
|
@ -1488,7 +1488,7 @@ protected:
|
|||
status = apzc->ReceiveInputEvent(mti, nullptr);
|
||||
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);
|
||||
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; }
|
||||
|
||||
virtual void SendAsyncScrollDOMEvent(bool aIsRoot,
|
||||
|
|
|
@ -152,14 +152,6 @@ APZCCallbackHandler::HandleLongTap(const CSSPoint& aPoint,
|
|||
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
||||
}
|
||||
|
||||
void
|
||||
APZCCallbackHandler::HandleLongTapUp(const CSSPoint& aPoint,
|
||||
Modifiers aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
HandleSingleTap(aPoint, aModifiers, aGuid);
|
||||
}
|
||||
|
||||
void
|
||||
APZCCallbackHandler::SendAsyncScrollDOMEvent(bool aIsRoot,
|
||||
const CSSRect& aContentRect,
|
||||
|
|
|
@ -55,8 +55,6 @@ public: // GeckoContentController methods
|
|||
void HandleLongTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
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,
|
||||
const mozilla::CSSSize& aScrollableSize) MOZ_OVERRIDE;
|
||||
void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;
|
||||
|
|
|
@ -235,13 +235,6 @@ APZController::HandleLongTap(const CSSPoint& aPoint,
|
|||
ContentReceivedInputBlock(aInputBlockId, false);
|
||||
}
|
||||
|
||||
void
|
||||
APZController::HandleLongTapUp(const CSSPoint& aPoint,
|
||||
Modifiers aModifiers,
|
||||
const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
}
|
||||
|
||||
// requests that we send a mozbrowserasyncscroll domevent. not in use.
|
||||
void
|
||||
APZController::SendAsyncScrollDOMEvent(bool aIsRoot,
|
||||
|
|
|
@ -50,9 +50,6 @@ public:
|
|||
Modifiers aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
||||
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 PostDelayedTask(Task* aTask, int aDelayMs);
|
||||
virtual bool GetRootZoomConstraints(ZoomConstraints* aOutConstraints);
|
||||
|
|
Загрузка…
Ссылка в новой задаче