mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 981029 - Change the GeckoContentController interface to take CSSPoint instead of CSSIntPoint. r=botond
This commit is contained in:
parent
eefe857895
commit
f53f829010
@ -47,7 +47,7 @@ using class mozilla::WidgetTouchEvent from "ipc/nsGUIEventIPC.h";
|
||||
using struct mozilla::dom::RemoteDOMEvent from "mozilla/dom/TabMessageUtils.h";
|
||||
using mozilla::dom::ScreenOrientation from "mozilla/dom/ScreenOrientation.h";
|
||||
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
|
||||
using mozilla::CSSIntPoint from "Units.h";
|
||||
using mozilla::CSSPoint from "Units.h";
|
||||
using mozilla::CSSToScreenScale from "Units.h";
|
||||
|
||||
namespace mozilla {
|
||||
@ -366,21 +366,21 @@ child:
|
||||
* the scroll offset. This message is expected to round-trip back to
|
||||
* ZoomToRect() with a rect indicating where we should zoom to.
|
||||
*/
|
||||
HandleDoubleTap(CSSIntPoint point, ScrollableLayerGuid aGuid);
|
||||
HandleDoubleTap(CSSPoint point, ScrollableLayerGuid aGuid);
|
||||
|
||||
/**
|
||||
* Requests handling of a single tap. |point| is in CSS pixels, relative to
|
||||
* the scroll offset. This message is expected to send a "mousedown" and
|
||||
* "mouseup" series of events at this point.
|
||||
*/
|
||||
HandleSingleTap(CSSIntPoint point, ScrollableLayerGuid aGuid);
|
||||
HandleSingleTap(CSSPoint point, ScrollableLayerGuid aGuid);
|
||||
|
||||
/**
|
||||
* Requests handling of a long tap. |point| is in CSS pixels, relative to
|
||||
* the scroll offset. This message is expected to send a "contextmenu"
|
||||
* events at this point.
|
||||
*/
|
||||
HandleLongTap(CSSIntPoint point, ScrollableLayerGuid aGuid);
|
||||
HandleLongTap(CSSPoint point, ScrollableLayerGuid aGuid);
|
||||
|
||||
/**
|
||||
* Requests handling of releasing a long tap. |aPoint| is in CSS pixels,
|
||||
@ -389,7 +389,7 @@ child:
|
||||
* this message is expected to generate a "mousedown" and "mouseup"
|
||||
* series of events
|
||||
*/
|
||||
HandleLongTapUp(CSSIntPoint point, ScrollableLayerGuid aGuid);
|
||||
HandleLongTapUp(CSSPoint point, ScrollableLayerGuid aGuid);
|
||||
|
||||
/**
|
||||
* Notifies the child that the parent has begun or finished transforming
|
||||
|
@ -1555,15 +1555,15 @@ TabChild::ProcessUpdateFrame(const FrameMetrics& aFrameMetrics)
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvHandleDoubleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
TabChild::RecvHandleDoubleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (!mGlobal || !mTabChildGlobal) {
|
||||
return true;
|
||||
}
|
||||
|
||||
nsCString data;
|
||||
data += nsPrintfCString("{ \"x\" : %d", aPoint.x);
|
||||
data += nsPrintfCString(", \"y\" : %d", aPoint.y);
|
||||
data += nsPrintfCString("{ \"x\" : %f", aPoint.x);
|
||||
data += nsPrintfCString(", \"y\" : %f", aPoint.y);
|
||||
data += nsPrintfCString(" }");
|
||||
|
||||
DispatchMessageManagerMessage(NS_LITERAL_STRING("Gesture:DoubleTap"), data);
|
||||
@ -1572,13 +1572,13 @@ TabChild::RecvHandleDoubleTap(const CSSIntPoint& aPoint, const ScrollableLayerGu
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvHandleSingleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
TabChild::RecvHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (!mGlobal || !mTabChildGlobal) {
|
||||
return true;
|
||||
}
|
||||
|
||||
LayoutDevicePoint currentPoint = CSSPoint(aPoint) * mWidget->GetDefaultScale();;
|
||||
LayoutDevicePoint currentPoint = aPoint * mWidget->GetDefaultScale();;
|
||||
|
||||
MessageLoop::current()->PostDelayedTask(
|
||||
FROM_HERE,
|
||||
@ -1597,7 +1597,7 @@ TabChild::FireSingleTapEvent(LayoutDevicePoint aPoint)
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvHandleLongTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (!mGlobal || !mTabChildGlobal) {
|
||||
return true;
|
||||
@ -1613,7 +1613,7 @@ TabChild::RecvHandleLongTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid
|
||||
}
|
||||
|
||||
bool
|
||||
TabChild::RecvHandleLongTapUp(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
TabChild::RecvHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (mContextMenuHandled) {
|
||||
mContextMenuHandled = false;
|
||||
|
@ -218,13 +218,13 @@ public:
|
||||
virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
||||
virtual bool RecvAcknowledgeScrollUpdate(const ViewID& aScrollId,
|
||||
const uint32_t& aScrollGeneration) MOZ_OVERRIDE;
|
||||
virtual bool RecvHandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
virtual bool RecvHandleDoubleTap(const CSSPoint& aPoint,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
virtual bool RecvHandleSingleTap(const CSSIntPoint& aPoint,
|
||||
virtual bool RecvHandleSingleTap(const CSSPoint& aPoint,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
virtual bool RecvHandleLongTap(const CSSIntPoint& aPoint,
|
||||
virtual bool RecvHandleLongTap(const CSSPoint& aPoint,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
virtual bool RecvHandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
virtual bool RecvHandleLongTapUp(const CSSPoint& aPoint,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
virtual bool RecvNotifyTransformBegin(const ViewID& aViewId) MOZ_OVERRIDE;
|
||||
virtual bool RecvNotifyTransformEnd(const ViewID& aViewId) MOZ_OVERRIDE;
|
||||
|
@ -516,7 +516,7 @@ TabParent::AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScr
|
||||
}
|
||||
}
|
||||
|
||||
void TabParent::HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
void TabParent::HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid &aGuid)
|
||||
{
|
||||
@ -525,7 +525,7 @@ void TabParent::HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
}
|
||||
}
|
||||
|
||||
void TabParent::HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
void TabParent::HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid &aGuid)
|
||||
{
|
||||
@ -535,7 +535,7 @@ void TabParent::HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
}
|
||||
}
|
||||
|
||||
void TabParent::HandleLongTap(const CSSIntPoint& aPoint,
|
||||
void TabParent::HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid &aGuid)
|
||||
{
|
||||
@ -544,7 +544,7 @@ void TabParent::HandleLongTap(const CSSIntPoint& aPoint,
|
||||
}
|
||||
}
|
||||
|
||||
void TabParent::HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
void TabParent::HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid &aGuid)
|
||||
{
|
||||
@ -721,7 +721,7 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
|
||||
return PBrowserParent::SendRealMouseEvent(event);
|
||||
}
|
||||
|
||||
CSSIntPoint TabParent::AdjustTapToChildWidget(const CSSIntPoint& aPoint)
|
||||
CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)
|
||||
{
|
||||
nsCOMPtr<nsIContent> content = do_QueryInterface(mFrameElement);
|
||||
|
||||
@ -735,12 +735,12 @@ CSSIntPoint TabParent::AdjustTapToChildWidget(const CSSIntPoint& aPoint)
|
||||
}
|
||||
nsPresContext* presContext = doc->GetShell()->GetPresContext();
|
||||
|
||||
return CSSIntPoint(
|
||||
aPoint.x + presContext->DevPixelsToIntCSSPixels(mChildProcessOffsetAtTouchStart.x),
|
||||
aPoint.y + presContext->DevPixelsToIntCSSPixels(mChildProcessOffsetAtTouchStart.y));
|
||||
return aPoint + CSSPoint(
|
||||
presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.x),
|
||||
presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.y));
|
||||
}
|
||||
|
||||
bool TabParent::SendHandleSingleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
bool TabParent::SendHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return false;
|
||||
@ -749,7 +749,7 @@ bool TabParent::SendHandleSingleTap(const CSSIntPoint& aPoint, const ScrollableL
|
||||
return PBrowserParent::SendHandleSingleTap(AdjustTapToChildWidget(aPoint), aGuid);
|
||||
}
|
||||
|
||||
bool TabParent::SendHandleLongTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
bool TabParent::SendHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return false;
|
||||
@ -758,7 +758,7 @@ bool TabParent::SendHandleLongTap(const CSSIntPoint& aPoint, const ScrollableLay
|
||||
return PBrowserParent::SendHandleLongTap(AdjustTapToChildWidget(aPoint), aGuid);
|
||||
}
|
||||
|
||||
bool TabParent::SendHandleLongTapUp(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
bool TabParent::SendHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return false;
|
||||
@ -767,7 +767,7 @@ bool TabParent::SendHandleLongTapUp(const CSSIntPoint& aPoint, const ScrollableL
|
||||
return PBrowserParent::SendHandleLongTapUp(AdjustTapToChildWidget(aPoint), aGuid);
|
||||
}
|
||||
|
||||
bool TabParent::SendHandleDoubleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
bool TabParent::SendHandleDoubleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
if (mIsDestroyed) {
|
||||
return false;
|
||||
|
@ -198,16 +198,16 @@ public:
|
||||
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
|
||||
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
|
||||
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
|
||||
void HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
void HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid);
|
||||
void HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
void HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid);
|
||||
void HandleLongTap(const CSSIntPoint& aPoint,
|
||||
void HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid);
|
||||
void HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid);
|
||||
void NotifyTransformBegin(ViewID aViewId);
|
||||
@ -229,10 +229,10 @@ public:
|
||||
bool SendMouseWheelEvent(mozilla::WidgetWheelEvent& event);
|
||||
bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event);
|
||||
bool SendRealTouchEvent(WidgetTouchEvent& event);
|
||||
bool SendHandleSingleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleLongTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleLongTapUp(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleDoubleTap(const CSSIntPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
bool SendHandleDoubleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
||||
|
||||
virtual PDocumentRendererParent*
|
||||
AllocPDocumentRendererParent(const nsRect& documentRect,
|
||||
@ -360,7 +360,7 @@ private:
|
||||
nsRefPtr<ContentParent> mManager;
|
||||
void TryCacheDPIAndScale();
|
||||
|
||||
CSSIntPoint AdjustTapToChildWidget(const CSSIntPoint& aPoint);
|
||||
CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
|
||||
|
||||
// When true, we create a pan/zoom controller for our frame and
|
||||
// notify it of input events targeting us.
|
||||
|
@ -904,7 +904,7 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(const PinchGestureInput& aEvent
|
||||
}
|
||||
|
||||
bool
|
||||
AsyncPanZoomController::ConvertToGecko(const ScreenPoint& aPoint, CSSIntPoint* aOut)
|
||||
AsyncPanZoomController::ConvertToGecko(const ScreenPoint& aPoint, CSSPoint* aOut)
|
||||
{
|
||||
APZCTreeManager* treeManagerLocal = mTreeManager;
|
||||
if (treeManagerLocal) {
|
||||
@ -917,8 +917,7 @@ AsyncPanZoomController::ConvertToGecko(const ScreenPoint& aPoint, CSSIntPoint* a
|
||||
LayoutDevicePoint layoutPoint = LayoutDevicePoint(result.x, result.y);
|
||||
{ // scoped lock to access mFrameMetrics
|
||||
ReentrantMonitorAutoEnter lock(mMonitor);
|
||||
CSSPoint cssPoint = layoutPoint / mFrameMetrics.mDevPixelsPerCSSPixel;
|
||||
*aOut = gfx::RoundedToInt(cssPoint);
|
||||
*aOut = layoutPoint / mFrameMetrics.mDevPixelsPerCSSPixel;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -930,7 +929,7 @@ nsEventStatus AsyncPanZoomController::OnLongPress(const TapGestureInput& aEvent)
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
if (controller) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
SetState(WAITING_CONTENT_RESPONSE);
|
||||
SetContentResponseTimer();
|
||||
@ -946,7 +945,7 @@ nsEventStatus AsyncPanZoomController::OnLongPressUp(const TapGestureInput& aEven
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
if (controller) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
controller->HandleLongTapUp(geckoScreenPoint, modifiers, GetGuid());
|
||||
return nsEventStatus_eConsumeNoDefault;
|
||||
@ -962,7 +961,7 @@ nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEven
|
||||
// sending event to content
|
||||
if (controller && !mZoomConstraints.mAllowDoubleTapZoom) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
// Because this may be being running as part of APZCTreeManager::ReceiveInputEvent,
|
||||
// calling controller->HandleSingleTap directly might mean that content receives
|
||||
@ -984,7 +983,7 @@ nsEventStatus AsyncPanZoomController::OnSingleTapConfirmed(const TapGestureInput
|
||||
nsRefPtr<GeckoContentController> controller = GetGeckoContentController();
|
||||
if (controller) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
// See comment in OnSingleTapUp as to why we do this in PostDelayedTask.
|
||||
controller->PostDelayedTask(
|
||||
@ -1003,7 +1002,7 @@ nsEventStatus AsyncPanZoomController::OnDoubleTap(const TapGestureInput& aEvent)
|
||||
if (controller) {
|
||||
if (mZoomConstraints.mAllowDoubleTapZoom) {
|
||||
int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers);
|
||||
CSSIntPoint geckoScreenPoint;
|
||||
CSSPoint geckoScreenPoint;
|
||||
if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) {
|
||||
controller->HandleDoubleTap(geckoScreenPoint, modifiers, GetGuid());
|
||||
}
|
||||
|
@ -601,12 +601,12 @@ private:
|
||||
void SetState(PanZoomState aState);
|
||||
|
||||
/**
|
||||
* Convert ScreenPoint relative to this APZC to CSSIntPoint relative
|
||||
* Convert ScreenPoint relative to this APZC to CSSPoint relative
|
||||
* to the parent document. This excludes the transient compositor transform.
|
||||
* NOTE: This must be converted to CSSIntPoint relative to the child
|
||||
* NOTE: This must be converted to CSSPoint relative to the child
|
||||
* document before sending over IPC.
|
||||
*/
|
||||
bool ConvertToGecko(const ScreenPoint& aPoint, CSSIntPoint* aOut);
|
||||
bool ConvertToGecko(const ScreenPoint& aPoint, CSSPoint* aOut);
|
||||
|
||||
/**
|
||||
* Internal helpers for checking general state of this apzc.
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define mozilla_layers_GeckoContentController_h
|
||||
|
||||
#include "FrameMetrics.h" // for FrameMetrics, etc
|
||||
#include "Units.h" // for CSSIntPoint, CSSRect, etc
|
||||
#include "Units.h" // for CSSPoint, CSSRect, etc
|
||||
#include "mozilla/Assertions.h" // for MOZ_ASSERT_HELPER2
|
||||
#include "nsISupportsImpl.h"
|
||||
|
||||
@ -42,7 +42,7 @@ public:
|
||||
* AsyncPanZoomController::ZoomToRect with the dimensions that we want to zoom
|
||||
* to.
|
||||
*/
|
||||
virtual void HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) = 0;
|
||||
|
||||
@ -51,7 +51,7 @@ public:
|
||||
* current scroll offset. This should simulate and send to content a mouse
|
||||
* button down, then mouse button up at |aPoint|.
|
||||
*/
|
||||
virtual void HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) = 0;
|
||||
|
||||
@ -59,7 +59,7 @@ public:
|
||||
* Requests handling a long tap. |aPoint| is in CSS pixels, relative to the
|
||||
* current scroll offset.
|
||||
*/
|
||||
virtual void HandleLongTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) = 0;
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
* relative to the current scroll offset. HandleLongTapUp will always be
|
||||
* preceeded by HandleLongTap
|
||||
*/
|
||||
virtual void HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) = 0;
|
||||
|
||||
|
@ -54,10 +54,10 @@ class MockContentController : public GeckoContentController {
|
||||
public:
|
||||
MOCK_METHOD1(RequestContentRepaint, void(const FrameMetrics&));
|
||||
MOCK_METHOD2(AcknowledgeScrollUpdate, void(const FrameMetrics::ViewID&, const uint32_t& aScrollGeneration));
|
||||
MOCK_METHOD3(HandleDoubleTap, void(const CSSIntPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleSingleTap, void(const CSSIntPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleLongTap, void(const CSSIntPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleLongTapUp, void(const CSSIntPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleDoubleTap, void(const CSSPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleSingleTap, void(const CSSPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleLongTap, void(const CSSPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(HandleLongTapUp, void(const CSSPoint&, int32_t, const ScrollableLayerGuid&));
|
||||
MOCK_METHOD3(SendAsyncScrollDOMEvent, void(bool aIsRoot, const CSSRect &aContentRect, const CSSSize &aScrollableSize));
|
||||
MOCK_METHOD2(PostDelayedTask, void(Task* aTask, int aDelayMs));
|
||||
};
|
||||
@ -704,7 +704,7 @@ TEST_F(AsyncPanZoomControllerTester, ShortPress) {
|
||||
// touchdown is fully processed. The ordering here is important.
|
||||
mcc->CheckHasDelayedTask();
|
||||
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSIntPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
mcc->RunDelayedTask();
|
||||
|
||||
apzc->Destroy();
|
||||
@ -728,7 +728,7 @@ TEST_F(AsyncPanZoomControllerTester, MediumPress) {
|
||||
// touchdown is fully processed. The ordering here is important.
|
||||
mcc->CheckHasDelayedTask();
|
||||
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSIntPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(*mcc, HandleSingleTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
mcc->RunDelayedTask();
|
||||
|
||||
apzc->Destroy();
|
||||
@ -761,11 +761,11 @@ DoLongPressTest(bool aShouldUseTouchAction, uint32_t aBehavior) {
|
||||
InSequence s;
|
||||
|
||||
EXPECT_CALL(check, Call("preHandleLongTap"));
|
||||
EXPECT_CALL(*mcc, HandleLongTap(CSSIntPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(*mcc, HandleLongTap(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(check, Call("postHandleLongTap"));
|
||||
|
||||
EXPECT_CALL(check, Call("preHandleLongTapUp"));
|
||||
EXPECT_CALL(*mcc, HandleLongTapUp(CSSIntPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(*mcc, HandleLongTapUp(CSSPoint(10, 10), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(check, Call("postHandleLongTapUp"));
|
||||
}
|
||||
|
||||
@ -824,7 +824,7 @@ TEST_F(AsyncPanZoomControllerTester, LongPressPreventDefault) {
|
||||
InSequence s;
|
||||
|
||||
EXPECT_CALL(check, Call("preHandleLongTap"));
|
||||
EXPECT_CALL(*mcc, HandleLongTap(CSSIntPoint(touchX, touchStartY), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(*mcc, HandleLongTap(CSSPoint(touchX, touchStartY), 0, apzc->GetGuid())).Times(1);
|
||||
EXPECT_CALL(check, Call("postHandleLongTap"));
|
||||
}
|
||||
|
||||
|
@ -539,7 +539,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE
|
||||
{
|
||||
@ -558,7 +558,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE
|
||||
{
|
||||
@ -577,7 +577,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void HandleLongTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE
|
||||
{
|
||||
@ -596,7 +596,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE
|
||||
{
|
||||
|
@ -1894,38 +1894,38 @@ AndroidBridge::AcknowledgeScrollUpdate(const mozilla::layers::FrameMetrics::View
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
AndroidBridge::HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:DoubleTap"), data));
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
AndroidBridge::HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
// TODO Send the modifier data to Gecko for use in mouse events.
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:SingleTap"), data));
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleLongTap(const CSSIntPoint& aPoint,
|
||||
AndroidBridge::HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
nsCString data = nsPrintfCString("{ \"x\": %d, \"y\": %d }", aPoint.x, aPoint.y);
|
||||
nsCString data = nsPrintfCString("{ \"x\": %f, \"y\": %f }", aPoint.x, aPoint.y);
|
||||
nsAppShell::gAppShell->PostEvent(AndroidGeckoEvent::MakeBroadcastEvent(
|
||||
NS_LITERAL_CSTRING("Gesture:LongPress"), data));
|
||||
}
|
||||
|
||||
void
|
||||
AndroidBridge::HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
AndroidBridge::HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
|
@ -433,16 +433,16 @@ public:
|
||||
void RequestContentRepaint(const mozilla::layers::FrameMetrics& aFrameMetrics) MOZ_OVERRIDE;
|
||||
void AcknowledgeScrollUpdate(const mozilla::layers::FrameMetrics::ViewID& aScrollId,
|
||||
const uint32_t& aScrollGeneration) MOZ_OVERRIDE;
|
||||
void HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
void HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
void HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
void HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
void HandleLongTap(const CSSIntPoint& aPoint,
|
||||
void HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
void HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
|
||||
void SendAsyncScrollDOMEvent(bool aIsRoot,
|
||||
|
@ -23,16 +23,16 @@ public:
|
||||
virtual void PostDelayedTask(Task* aTask, int aDelayMs) MOZ_OVERRIDE;
|
||||
|
||||
// No-ops
|
||||
virtual void HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
|
||||
virtual void HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
|
||||
virtual void HandleLongTap(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
|
||||
virtual void HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
|
||||
|
||||
|
@ -228,28 +228,28 @@ APZController::AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId,
|
||||
}
|
||||
|
||||
void
|
||||
APZController::HandleDoubleTap(const CSSIntPoint& aPoint,
|
||||
APZController::HandleDoubleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
APZController::HandleSingleTap(const CSSIntPoint& aPoint,
|
||||
APZController::HandleSingleTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
APZController::HandleLongTap(const CSSIntPoint& aPoint,
|
||||
APZController::HandleLongTap(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
APZController::HandleLongTapUp(const CSSIntPoint& aPoint,
|
||||
APZController::HandleLongTapUp(const CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const ScrollableLayerGuid& aGuid)
|
||||
{
|
||||
|
@ -34,16 +34,16 @@ public:
|
||||
// GeckoContentController interface
|
||||
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics);
|
||||
virtual void AcknowledgeScrollUpdate(const FrameMetrics::ViewID& aScrollId, const uint32_t& aScrollGeneration);
|
||||
virtual void HandleDoubleTap(const mozilla::CSSIntPoint& aPoint,
|
||||
virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid);
|
||||
virtual void HandleSingleTap(const mozilla::CSSIntPoint& aPoint,
|
||||
virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid);
|
||||
virtual void HandleLongTap(const mozilla::CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTap(const mozilla::CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid);
|
||||
virtual void HandleLongTapUp(const mozilla::CSSIntPoint& aPoint,
|
||||
virtual void HandleLongTapUp(const mozilla::CSSPoint& aPoint,
|
||||
int32_t aModifiers,
|
||||
const mozilla::layers::ScrollableLayerGuid& aGuid);
|
||||
virtual void SendAsyncScrollDOMEvent(bool aIsRoot, const mozilla::CSSRect &aContentRect, const mozilla::CSSSize &aScrollableSize);
|
||||
|
Loading…
Reference in New Issue
Block a user