Bug 1795172 [wpt PR 36447] - Disallow culled inlines in repeated content., a=testonly
[gecko.git] / dom / ipc / BrowserBridgeParent.h
blob2b6fc88117ce4878c16d3cd2d3b7139e3a33a572
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/. */
7 #ifndef mozilla_dom_BrowserBridgeParent_h
8 #define mozilla_dom_BrowserBridgeParent_h
10 #include "mozilla/dom/PBrowserBridgeParent.h"
11 #include "mozilla/dom/ipc/IdType.h"
12 #include "mozilla/dom/WindowGlobalTypes.h"
14 namespace mozilla {
16 namespace a11y {
17 class DocAccessibleParent;
20 namespace embedding {
21 class PrintData;
24 namespace dom {
26 class BrowserParent;
28 /**
29 * BrowserBridgeParent implements the parent actor part of the PBrowserBridge
30 * protocol. See PBrowserBridge for more information.
32 class BrowserBridgeParent : public PBrowserBridgeParent {
33 public:
34 NS_INLINE_DECL_REFCOUNTING(BrowserBridgeParent, final);
36 BrowserBridgeParent();
38 nsresult InitWithProcess(BrowserParent* aParentBrowser,
39 ContentParent* aContentParent,
40 const WindowGlobalInit& aWindowInit,
41 uint32_t aChromeFlags, TabId aTabId);
43 BrowserParent* GetBrowserParent() { return mBrowserParent; }
45 CanonicalBrowsingContext* GetBrowsingContext();
47 // Get our manager actor.
48 BrowserParent* Manager();
50 #if defined(ACCESSIBILITY)
51 /**
52 * Get the DocAccessibleParent which contains this iframe.
54 a11y::DocAccessibleParent* GetEmbedderAccessibleDoc();
56 /**
57 * Get the unique id of the OuterDocAccessible associated with this iframe.
58 * This is the id of the RemoteAccessible inside the document returned by
59 * GetEmbedderAccessibleDoc.
61 uint64_t GetEmbedderAccessibleId() { return mEmbedderAccessibleID; }
63 /**
64 * Get the DocAccessibleParent for the embedded document.
66 a11y::DocAccessibleParent* GetDocAccessibleParent();
67 #endif // defined(ACCESSIBILITY)
69 // Tear down this BrowserBridgeParent.
70 void Destroy();
72 protected:
73 friend class PBrowserBridgeParent;
75 mozilla::ipc::IPCResult RecvShow(const OwnerShowInfo&);
76 mozilla::ipc::IPCResult RecvScrollbarPreferenceChanged(ScrollbarPreference);
77 mozilla::ipc::IPCResult RecvLoadURL(nsDocShellLoadState* aLoadState);
78 mozilla::ipc::IPCResult RecvResumeLoad(uint64_t aPendingSwitchID);
79 mozilla::ipc::IPCResult RecvUpdateDimensions(const nsIntRect& aRect,
80 const ScreenIntSize& aSize);
81 mozilla::ipc::IPCResult RecvUpdateEffects(const EffectsInfo& aEffects);
82 mozilla::ipc::IPCResult RecvUpdateRemotePrintSettings(
83 const embedding::PrintData&);
84 mozilla::ipc::IPCResult RecvRenderLayers(const bool& aEnabled,
85 const LayersObserverEpoch& aEpoch);
87 mozilla::ipc::IPCResult RecvNavigateByKey(const bool& aForward,
88 const bool& aForDocumentNavigation);
89 mozilla::ipc::IPCResult RecvBeginDestroy();
91 mozilla::ipc::IPCResult RecvDispatchSynthesizedMouseEvent(
92 const WidgetMouseEvent& aEvent);
94 mozilla::ipc::IPCResult RecvWillChangeProcess();
96 mozilla::ipc::IPCResult RecvActivate(uint64_t aActionId);
98 mozilla::ipc::IPCResult RecvDeactivate(const bool& aWindowLowering,
99 uint64_t aActionId);
101 mozilla::ipc::IPCResult RecvSetIsUnderHiddenEmbedderElement(
102 const bool& aIsUnderHiddenEmbedderElement);
104 mozilla::ipc::IPCResult RecvUpdateRemoteStyle(
105 const StyleImageRendering& aImageRendering);
107 #ifdef ACCESSIBILITY
108 mozilla::ipc::IPCResult RecvSetEmbedderAccessible(PDocAccessibleParent* aDoc,
109 uint64_t aID);
110 #endif
112 void ActorDestroy(ActorDestroyReason aWhy) override;
114 private:
115 ~BrowserBridgeParent();
117 RefPtr<BrowserParent> mBrowserParent;
118 #ifdef ACCESSIBILITY
119 RefPtr<a11y::DocAccessibleParent> mEmbedderAccessibleDoc;
120 uint64_t mEmbedderAccessibleID = 0;
121 #endif // ACCESSIBILITY
124 } // namespace dom
125 } // namespace mozilla
127 #endif // !defined(mozilla_dom_BrowserBridgeParent_h)