tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

APZCTreeManagerChild.h (3256B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef mozilla_layers_APZCTreeManagerChild_h
      8 #define mozilla_layers_APZCTreeManagerChild_h
      9 
     10 #include "mozilla/layers/APZInputBridge.h"
     11 #include "mozilla/layers/IAPZCTreeManager.h"
     12 #include "mozilla/layers/PAPZCTreeManagerChild.h"
     13 
     14 namespace mozilla {
     15 namespace layers {
     16 
     17 class APZInputBridgeChild;
     18 class RemoteCompositorSession;
     19 
     20 class APZCTreeManagerChild : public IAPZCTreeManager,
     21                             public PAPZCTreeManagerChild {
     22  friend class PAPZCTreeManagerChild;
     23  using TapType = GeckoContentController_TapType;
     24 
     25 public:
     26  APZCTreeManagerChild();
     27 
     28  void SetCompositorSession(RemoteCompositorSession* aSession);
     29  void SetInputBridge(APZInputBridgeChild* aInputBridge);
     30  void Destroy();
     31 
     32  void SetKeyboardMap(const KeyboardMap& aKeyboardMap) override;
     33 
     34  void ZoomToRect(const ScrollableLayerGuid& aGuid,
     35                  const ZoomTarget& aZoomTarget,
     36                  const uint32_t aFlags = DEFAULT_BEHAVIOR) override;
     37 
     38  void ContentReceivedInputBlock(uint64_t aInputBlockId,
     39                                 bool aPreventDefault) override;
     40 
     41  void SetTargetAPZC(uint64_t aInputBlockId,
     42                     const nsTArray<ScrollableLayerGuid>& aTargets) override;
     43 
     44  void UpdateZoomConstraints(
     45      const ScrollableLayerGuid& aGuid,
     46      const Maybe<ZoomConstraints>& aConstraints) override;
     47 
     48  void SetDPI(float aDpiValue) override;
     49 
     50  void SetAllowedTouchBehavior(
     51      uint64_t aInputBlockId,
     52      const nsTArray<TouchBehaviorFlags>& aValues) override;
     53 
     54  void SetBrowserGestureResponse(uint64_t aInputBlockId,
     55                                 BrowserGestureResponse aResponse) override;
     56 
     57  void StartScrollbarDrag(const ScrollableLayerGuid& aGuid,
     58                          const AsyncDragMetrics& aDragMetrics) override;
     59 
     60  bool StartAutoscroll(const ScrollableLayerGuid& aGuid,
     61                       const ScreenPoint& aAnchorLocation) override;
     62 
     63  void StopAutoscroll(const ScrollableLayerGuid& aGuid) override;
     64 
     65  void SetLongTapEnabled(bool aTapGestureEnabled) override;
     66 
     67  APZInputBridge* InputBridge() override;
     68 
     69  void AddIPDLReference();
     70  void ReleaseIPDLReference();
     71  void ActorDestroy(ActorDestroyReason aWhy) override;
     72 
     73 protected:
     74  mozilla::ipc::IPCResult RecvNotifyPinchGesture(
     75      const PinchGestureType& aType, const ScrollableLayerGuid& aGuid,
     76      const LayoutDevicePoint& aFocusPoint,
     77      const LayoutDeviceCoord& aSpanChange, const Modifiers& aModifiers);
     78 
     79  mozilla::ipc::IPCResult RecvCancelAutoscroll(
     80      const ScrollableLayerGuid::ViewID& aScrollId);
     81 
     82  mozilla::ipc::IPCResult RecvNotifyScaleGestureComplete(
     83      const ScrollableLayerGuid::ViewID& aScrollId, float aScale);
     84 
     85  virtual ~APZCTreeManagerChild();
     86 
     87 private:
     88  MOZ_NON_OWNING_REF RemoteCompositorSession* mCompositorSession;
     89  RefPtr<APZInputBridgeChild> mInputBridge;
     90  bool mIPCOpen;
     91 };
     92 
     93 }  // namespace layers
     94 }  // namespace mozilla
     95 
     96 #endif  // mozilla_layers_APZCTreeManagerChild_h