Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set sw=4 ts=8 et 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 TabChild;
18 : } // namespace dom
19 :
20 : namespace layers {
21 :
22 : class APZChild;
23 :
24 : /**
25 : * ContentProcessController is a GeckoContentController for a TabChild, and is always
26 : * remoted using PAPZ/APZChild.
27 : *
28 : * ContentProcessController is created in ContentChild when a layer tree id has
29 : * been allocated for a PBrowser that lives in that content process, and is destroyed
30 : * when the Destroy message is received, or when the tab dies.
31 : *
32 : * If ContentProcessController needs to implement a new method on GeckoContentController
33 : * PAPZ, APZChild, and RemoteContentController must be updated to handle it.
34 : */
35 0 : class ContentProcessController final
36 : : public GeckoContentController
37 : {
38 : public:
39 : explicit ContentProcessController(const RefPtr<dom::TabChild>& aBrowser);
40 :
41 : // GeckoContentController
42 :
43 : void RequestContentRepaint(const FrameMetrics& frame) override;
44 :
45 : void HandleTap(TapType aType,
46 : const LayoutDevicePoint& aPoint,
47 : Modifiers aModifiers,
48 : const ScrollableLayerGuid& aGuid,
49 : uint64_t aInputBlockId) override;
50 :
51 : void NotifyPinchGesture(PinchGestureInput::PinchGestureType aType,
52 : const ScrollableLayerGuid& aGuid,
53 : LayoutDeviceCoord aSpanChange,
54 : Modifiers aModifiers) override;
55 :
56 : void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
57 : APZStateChange aChange,
58 : int aArg) override;
59 :
60 : void NotifyMozMouseScrollEvent(const FrameMetrics::ViewID& aScrollId,
61 : const nsString& aEvent) override;
62 :
63 : void NotifyFlushComplete() override;
64 :
65 : void NotifyAsyncScrollbarDragRejected(const FrameMetrics::ViewID& aScrollId) override;
66 :
67 : void PostDelayedTask(already_AddRefed<Runnable> aRunnable, int aDelayMs) override;
68 :
69 : bool IsRepaintThread() override;
70 :
71 : void DispatchToRepaintThread(already_AddRefed<Runnable> aTask) override;
72 :
73 : private:
74 : RefPtr<dom::TabChild> mBrowser;
75 : };
76 :
77 : } // namespace layers
78 :
79 : } // namespace mozilla
80 :
81 : #endif // mozilla_layers_ContentProcessController_h
|