Bug 1005815 - Basic implementation of ChromeProcessController::HandleSingleTap. r=kats

This commit is contained in:
Botond Ballo 2015-01-21 19:47:05 -05:00
Родитель fe4c9e99d2
Коммит 5560fcf705
2 изменённых файлов: 30 добавлений и 1 удалений

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

@ -97,3 +97,31 @@ ChromeProcessController::Destroy()
MOZ_ASSERT(MessageLoop::current() == mUILoop);
mWidget = nullptr;
}
float
ChromeProcessController::GetPresShellResolution() const
{
// The document in the chrome process cannot be zoomed, so its pres shell
// resolution is 1.
return 1.0f;
}
void
ChromeProcessController::HandleSingleTap(const CSSPoint& aPoint,
int32_t aModifiers,
const ScrollableLayerGuid& aGuid)
{
if (MessageLoop::current() != mUILoop) {
mUILoop->PostTask(
FROM_HERE,
NewRunnableMethod(this, &ChromeProcessController::HandleSingleTap,
aPoint, aModifiers, aGuid));
return;
}
LayoutDevicePoint point =
APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid, GetPresShellResolution())
* mWidget->GetDefaultScale();
APZCCallbackHelper::FireSingleTapEvent(point, mWidget);
}

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

@ -38,7 +38,7 @@ public:
virtual void HandleDoubleTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
virtual void HandleSingleTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers,
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE {}
const ScrollableLayerGuid& aGuid) MOZ_OVERRIDE;
virtual void HandleLongTap(const mozilla::CSSPoint& aPoint, int32_t aModifiers,
const ScrollableLayerGuid& aGuid,
uint64_t aInputBlockId) MOZ_OVERRIDE {}
@ -52,6 +52,7 @@ private:
MessageLoop* mUILoop;
void InitializeRoot();
float GetPresShellResolution() const;
};
} // namespace layers