Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / ipc / BrowserBridgeParent.h
blob35dfd7636fe56ad44d5d0093a006e955acf04a1c
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);
86 mozilla::ipc::IPCResult RecvNavigateByKey(const bool& aForward,
87 const bool& aForDocumentNavigation);
88 mozilla::ipc::IPCResult RecvBeginDestroy();
90 mozilla::ipc::IPCResult RecvDispatchSynthesizedMouseEvent(
91 const WidgetMouseEvent& aEvent);
93 mozilla::ipc::IPCResult RecvWillChangeProcess();
95 mozilla::ipc::IPCResult RecvActivate(uint64_t aActionId);
97 mozilla::ipc::IPCResult RecvDeactivate(const bool& aWindowLowering,
98 uint64_t aActionId);
100 mozilla::ipc::IPCResult RecvUpdateRemoteStyle(
101 const StyleImageRendering& aImageRendering);
103 #ifdef ACCESSIBILITY
104 mozilla::ipc::IPCResult RecvSetEmbedderAccessible(PDocAccessibleParent* aDoc,
105 uint64_t aID);
106 #endif
108 void ActorDestroy(ActorDestroyReason aWhy) override;
110 private:
111 ~BrowserBridgeParent();
113 RefPtr<BrowserParent> mBrowserParent;
114 #ifdef ACCESSIBILITY
115 RefPtr<a11y::DocAccessibleParent> mEmbedderAccessibleDoc;
116 uint64_t mEmbedderAccessibleID = 0;
117 #endif // ACCESSIBILITY
120 } // namespace dom
121 } // namespace mozilla
123 #endif // !defined(mozilla_dom_BrowserBridgeParent_h)