tor-browser

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

ContentProcessController.h (3346B)


      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_ContentProcessController_h
      8 #define mozilla_layers_ContentProcessController_h
      9 
     10 #include "mozilla/layers/GeckoContentController.h"
     11 
     12 class nsIObserver;
     13 
     14 namespace mozilla {
     15 
     16 namespace dom {
     17 class BrowserChild;
     18 }  // namespace dom
     19 
     20 namespace layers {
     21 
     22 class APZChild;
     23 struct DoubleTapToZoomMetrics;
     24 
     25 /**
     26 * ContentProcessController is a GeckoContentController for a BrowserChild, and
     27 * is always remoted using PAPZ/APZChild.
     28 *
     29 * ContentProcessController is created in ContentChild when a layer tree id has
     30 * been allocated for a PBrowser that lives in that content process, and is
     31 * destroyed when the Destroy message is received, or when the tab dies.
     32 *
     33 * If ContentProcessController needs to implement a new method on
     34 * GeckoContentController PAPZ, APZChild, and RemoteContentController must be
     35 * updated to handle it.
     36 */
     37 class ContentProcessController final : public GeckoContentController {
     38 public:
     39  explicit ContentProcessController(const RefPtr<dom::BrowserChild>& aBrowser);
     40 
     41  // GeckoContentController
     42 
     43  void NotifyLayerTransforms(nsTArray<MatrixMessage>&& aTransforms) override;
     44 
     45  void RequestContentRepaint(const RepaintRequest& aRequest) override;
     46 
     47  void HandleTap(TapType aType, const LayoutDevicePoint& aPoint,
     48                 Modifiers aModifiers, const ScrollableLayerGuid& aGuid,
     49                 uint64_t aInputBlockId,
     50                 const Maybe<DoubleTapToZoomMetrics>& aMetrics) override;
     51 
     52  void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
     53                          const ScrollableLayerGuid& aGuid,
     54                          const LayoutDevicePoint& aFocusPoint,
     55                          LayoutDeviceCoord aSpanChange,
     56                          Modifiers aModifiers) override;
     57 
     58  void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
     59                            APZStateChange aChange, int aArg,
     60                            Maybe<uint64_t> aInputBlockId) override;
     61 
     62  void NotifyMozMouseScrollEvent(const ScrollableLayerGuid::ViewID& aScrollId,
     63                                 const nsString& aEvent) override;
     64 
     65  void NotifyFlushComplete() override;
     66 
     67  void NotifyAsyncScrollbarDragInitiated(
     68      uint64_t aDragBlockId, const ScrollableLayerGuid::ViewID& aScrollId,
     69      ScrollDirection aDirection) override;
     70  void NotifyAsyncScrollbarDragRejected(
     71      const ScrollableLayerGuid::ViewID& aScrollId) override;
     72 
     73  void NotifyAsyncAutoscrollRejected(
     74      const ScrollableLayerGuid::ViewID& aScrollId) override;
     75 
     76  void CancelAutoscroll(const ScrollableLayerGuid& aGuid) override;
     77 
     78  void NotifyScaleGestureComplete(const ScrollableLayerGuid& aGuid,
     79                                  float aScale) override;
     80 
     81  bool IsRepaintThread() override;
     82 
     83  void DispatchToRepaintThread(already_AddRefed<Runnable> aTask) override;
     84 
     85  PresShell* GetTopLevelPresShell() const override;
     86 
     87 private:
     88  RefPtr<dom::BrowserChild> mBrowser;
     89 };
     90 
     91 }  // namespace layers
     92 
     93 }  // namespace mozilla
     94 
     95 #endif  // mozilla_layers_ContentProcessController_h