2014-08-09 01:42:20 +04:00
|
|
|
/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
|
|
|
|
* 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/. */
|
|
|
|
|
2015-04-25 05:26:51 +03:00
|
|
|
#ifndef AndroidContentController_h__
|
|
|
|
#define AndroidContentController_h__
|
2014-08-09 01:42:20 +04:00
|
|
|
|
2015-03-27 22:18:19 +03:00
|
|
|
#include "mozilla/layers/ChromeProcessController.h"
|
2015-03-03 00:38:07 +03:00
|
|
|
#include "mozilla/EventForwards.h" // for Modifiers
|
2015-01-10 03:33:57 +03:00
|
|
|
#include "mozilla/StaticPtr.h"
|
2014-08-09 01:42:20 +04:00
|
|
|
#include "mozilla/TimeStamp.h"
|
|
|
|
#include "nsIDOMWindowUtils.h"
|
|
|
|
#include "nsTArray.h"
|
2016-01-26 04:32:33 +03:00
|
|
|
#include "nsWindow.h"
|
2014-08-09 01:42:20 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
2015-08-14 01:26:00 +03:00
|
|
|
namespace layers {
|
|
|
|
class APZEventState;
|
2016-07-20 14:37:00 +03:00
|
|
|
class IAPZCTreeManager;
|
2015-08-14 01:26:00 +03:00
|
|
|
}
|
2014-08-09 01:42:20 +04:00
|
|
|
namespace widget {
|
|
|
|
|
2016-01-15 21:05:45 +03:00
|
|
|
class AndroidContentController final
|
|
|
|
: public mozilla::layers::ChromeProcessController
|
2014-08-09 01:42:20 +04:00
|
|
|
{
|
2015-04-25 05:26:51 +03:00
|
|
|
public:
|
2016-01-26 04:32:33 +03:00
|
|
|
AndroidContentController(nsWindow* aWindow,
|
2015-08-14 01:26:00 +03:00
|
|
|
mozilla::layers::APZEventState* aAPZEventState,
|
2016-07-20 14:37:00 +03:00
|
|
|
mozilla::layers::IAPZCTreeManager* aAPZCTreeManager)
|
2016-01-26 04:32:33 +03:00
|
|
|
: mozilla::layers::ChromeProcessController(aWindow, aAPZEventState, aAPZCTreeManager)
|
|
|
|
, mAndroidWindow(aWindow)
|
2014-08-09 01:42:20 +04:00
|
|
|
{}
|
|
|
|
|
2015-04-25 05:26:51 +03:00
|
|
|
// ChromeProcessController methods
|
2016-01-26 04:32:33 +03:00
|
|
|
virtual void Destroy() override;
|
2016-07-29 21:44:29 +03:00
|
|
|
void HandleTap(TapType aType, const LayoutDevicePoint& aPoint, Modifiers aModifiers,
|
2016-07-05 20:24:54 +03:00
|
|
|
const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override;
|
2016-04-28 03:06:05 +03:00
|
|
|
void PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) override;
|
2016-08-19 21:37:23 +03:00
|
|
|
void UpdateOverscrollVelocity(const float aX, const float aY, const bool aIsRootContent) override;
|
|
|
|
void UpdateOverscrollOffset(const float aX, const float aY, const bool aIsRootContent) override;
|
2016-03-25 01:00:27 +03:00
|
|
|
void SetScrollingRootContent(const bool isRootContent) override;
|
2016-02-25 19:15:14 +03:00
|
|
|
void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
|
|
|
APZStateChange aChange,
|
|
|
|
int aArg) override;
|
2014-08-09 01:42:20 +04:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
static void NotifyDefaultPrevented(mozilla::layers::IAPZCTreeManager* aManager,
|
2016-01-15 21:05:45 +03:00
|
|
|
uint64_t aInputBlockId, bool aDefaultPrevented);
|
2016-01-26 04:32:33 +03:00
|
|
|
private:
|
|
|
|
nsWindow* mAndroidWindow;
|
2016-08-08 23:12:40 +03:00
|
|
|
|
|
|
|
void DispatchSingleTapToObservers(const LayoutDevicePoint& aPoint,
|
|
|
|
const ScrollableLayerGuid& aGuid) const;
|
2014-08-09 01:42:20 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace widget
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|