2016-01-08 22:17:39 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et tw=80 : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#include "mozilla/layers/APZChild.h"
|
2016-08-11 02:51:45 +03:00
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2016-01-08 22:17:39 +03:00
|
|
|
|
|
|
|
#include "mozilla/dom/TabChild.h"
|
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
#include "InputData.h" // for InputData
|
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
namespace mozilla {
|
|
|
|
namespace layers {
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
APZChild::APZChild(RefPtr<GeckoContentController> aController)
|
|
|
|
: mController(aController)
|
2016-01-08 22:17:39 +03:00
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
MOZ_ASSERT(mController);
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
2016-08-25 00:15:35 +03:00
|
|
|
APZChild::~APZChild()
|
2016-08-11 02:51:45 +03:00
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
if (mController) {
|
|
|
|
mController->Destroy();
|
|
|
|
mController = nullptr;
|
2016-08-25 00:15:35 +03:00
|
|
|
}
|
2016-08-11 02:51:45 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
2016-07-31 22:39:00 +03:00
|
|
|
APZChild::RecvRequestContentRepaint(const FrameMetrics& aFrameMetrics)
|
2016-08-11 02:51:45 +03:00
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
MOZ_ASSERT(mController->IsRepaintThread());
|
|
|
|
|
|
|
|
mController->RequestContentRepaint(aFrameMetrics);
|
|
|
|
return true;
|
2016-01-08 22:17:39 +03:00
|
|
|
}
|
|
|
|
|
2016-08-11 02:51:45 +03:00
|
|
|
bool
|
|
|
|
APZChild::RecvUpdateOverscrollVelocity(const float& aX, const float& aY, const bool& aIsRootContent)
|
|
|
|
{
|
|
|
|
mController->UpdateOverscrollVelocity(aX, aY, aIsRootContent);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
APZChild::RecvUpdateOverscrollOffset(const float& aX, const float& aY, const bool& aIsRootContent)
|
|
|
|
{
|
|
|
|
mController->UpdateOverscrollOffset(aX, aY, aIsRootContent);
|
2016-08-11 02:51:45 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-08-02 09:59:00 +03:00
|
|
|
bool
|
2016-08-11 02:51:45 +03:00
|
|
|
APZChild::RecvSetScrollingRootContent(const bool& aIsRootContent)
|
|
|
|
{
|
|
|
|
mController->SetScrollingRootContent(aIsRootContent);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
APZChild::RecvNotifyMozMouseScrollEvent(const ViewID& aScrollId,
|
2016-08-02 09:59:00 +03:00
|
|
|
const nsString& aEvent)
|
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
mController->NotifyMozMouseScrollEvent(aScrollId, aEvent);
|
2016-08-02 09:59:00 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
bool
|
2016-08-11 02:51:45 +03:00
|
|
|
APZChild::RecvNotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
2016-01-08 22:17:39 +03:00
|
|
|
const APZStateChange& aChange,
|
|
|
|
const int& aArg)
|
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
mController->NotifyAPZStateChange(aGuid, aChange, aArg);
|
|
|
|
return true;
|
2016-01-08 22:17:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
APZChild::RecvNotifyFlushComplete()
|
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
MOZ_ASSERT(mController->IsRepaintThread());
|
|
|
|
|
|
|
|
mController->NotifyFlushComplete();
|
2016-01-08 22:17:39 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-04-19 00:25:25 +03:00
|
|
|
bool
|
|
|
|
APZChild::RecvDestroy()
|
|
|
|
{
|
2016-08-11 02:51:45 +03:00
|
|
|
// mController->Destroy will be called in the destructor
|
2016-08-22 03:43:08 +03:00
|
|
|
PAPZChild::Send__delete__(this);
|
2016-04-19 00:25:25 +03:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|