2017-10-28 02:10:06 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2014-12-15 12:49:48 +03:00
|
|
|
/* 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/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_layers_ChromeProcessController_h
|
|
|
|
#define mozilla_layers_ChromeProcessController_h
|
|
|
|
|
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2015-01-15 02:46:37 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2015-10-18 08:24:48 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2015-01-15 02:46:37 +03:00
|
|
|
|
2015-02-10 03:06:06 +03:00
|
|
|
class nsIDOMWindowUtils;
|
2015-03-06 21:06:25 +03:00
|
|
|
class nsIDocument;
|
2015-02-10 03:06:06 +03:00
|
|
|
class nsIPresShell;
|
2015-01-15 02:46:37 +03:00
|
|
|
class nsIWidget;
|
2014-12-15 12:49:48 +03:00
|
|
|
|
2015-01-15 02:03:43 +03:00
|
|
|
class MessageLoop;
|
|
|
|
|
2014-12-15 12:49:48 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
namespace layers {
|
2015-02-10 03:06:06 +03:00
|
|
|
|
2016-07-20 14:37:00 +03:00
|
|
|
class IAPZCTreeManager;
|
2015-02-10 03:06:06 +03:00
|
|
|
class APZEventState;
|
2014-12-15 12:49:48 +03:00
|
|
|
|
2016-08-26 02:42:55 +03:00
|
|
|
/**
|
|
|
|
* ChromeProcessController is a GeckoContentController attached to the root of
|
|
|
|
* a compositor's layer tree. It's used directly by APZ by default, and remoted
|
|
|
|
* using PAPZ if there is a gpu process.
|
|
|
|
*
|
|
|
|
* If ChromeProcessController needs to implement a new method on GeckoContentController
|
|
|
|
* PAPZ, APZChild, and RemoteContentController must be updated to handle it.
|
|
|
|
*/
|
2014-12-15 12:49:48 +03:00
|
|
|
class ChromeProcessController : public mozilla::layers::GeckoContentController
|
|
|
|
{
|
2015-11-13 23:10:52 +03:00
|
|
|
protected:
|
2014-12-15 12:49:48 +03:00
|
|
|
typedef mozilla::layers::FrameMetrics FrameMetrics;
|
|
|
|
typedef mozilla::layers::ScrollableLayerGuid ScrollableLayerGuid;
|
|
|
|
|
|
|
|
public:
|
2016-07-20 14:37:00 +03:00
|
|
|
explicit ChromeProcessController(nsIWidget* aWidget, APZEventState* aAPZEventState, IAPZCTreeManager* aAPZCTreeManager);
|
2015-08-14 01:26:00 +03:00
|
|
|
~ChromeProcessController();
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void Destroy() override;
|
2015-01-15 02:46:37 +03:00
|
|
|
|
2014-12-15 12:49:48 +03:00
|
|
|
// GeckoContentController interface
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void RequestContentRepaint(const FrameMetrics& aFrameMetrics) override;
|
2016-04-28 03:06:05 +03:00
|
|
|
virtual void PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) override;
|
2016-08-02 09:59:00 +03:00
|
|
|
virtual bool IsRepaintThread() override;
|
|
|
|
virtual void DispatchToRepaintThread(already_AddRefed<Runnable> aTask) override;
|
2016-07-05 20:24:54 +03:00
|
|
|
virtual void HandleTap(TapType aType,
|
2016-07-29 21:44:29 +03:00
|
|
|
const mozilla::LayoutDevicePoint& aPoint,
|
|
|
|
Modifiers aModifiers,
|
2016-07-05 20:24:54 +03:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
uint64_t aInputBlockId) override;
|
2016-09-24 16:46:02 +03:00
|
|
|
virtual void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
LayoutDeviceCoord aSpanChange,
|
|
|
|
Modifiers aModifiers) override;
|
2015-02-10 03:06:06 +03:00
|
|
|
virtual void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
|
|
|
|
APZStateChange aChange,
|
2015-03-21 19:28:04 +03:00
|
|
|
int aArg) override;
|
2015-03-22 10:42:26 +03:00
|
|
|
virtual void NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrollId,
|
|
|
|
const nsString& aEvent) override;
|
2015-06-19 15:25:41 +03:00
|
|
|
virtual void NotifyFlushComplete() override;
|
2017-01-28 02:02:22 +03:00
|
|
|
virtual void NotifyAsyncScrollbarDragRejected(const FrameMetrics::ViewID& aScrollId) override;
|
2017-10-19 01:18:13 +03:00
|
|
|
virtual void NotifyAsyncAutoscrollRejected(const FrameMetrics::ViewID& aScrollId) override;
|
2017-08-01 02:15:26 +03:00
|
|
|
virtual void CancelAutoscroll(const ScrollableLayerGuid& aGuid) override;
|
2015-01-15 02:46:37 +03:00
|
|
|
private:
|
|
|
|
nsCOMPtr<nsIWidget> mWidget;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<APZEventState> mAPZEventState;
|
2016-07-20 14:37:00 +03:00
|
|
|
RefPtr<IAPZCTreeManager> mAPZCTreeManager;
|
2015-01-15 02:03:43 +03:00
|
|
|
MessageLoop* mUILoop;
|
2015-01-28 21:25:53 +03:00
|
|
|
|
|
|
|
void InitializeRoot();
|
2015-02-10 03:06:06 +03:00
|
|
|
nsIPresShell* GetPresShell() const;
|
2015-08-14 01:26:00 +03:00
|
|
|
nsIDocument* GetRootDocument() const;
|
|
|
|
nsIDocument* GetRootContentDocument(const FrameMetrics::ViewID& aScrollId) const;
|
2016-07-05 20:24:54 +03:00
|
|
|
void HandleDoubleTap(const mozilla::CSSPoint& aPoint, Modifiers aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-12-15 12:49:48 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace layers
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif /* mozilla_layers_ChromeProcessController_h */
|