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"
17 class DocAccessibleParent
;
29 * BrowserBridgeParent implements the parent actor part of the PBrowserBridge
30 * protocol. See PBrowserBridge for more information.
32 class BrowserBridgeParent
: public PBrowserBridgeParent
{
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)
52 * Get the DocAccessibleParent which contains this iframe.
54 a11y::DocAccessibleParent
* GetEmbedderAccessibleDoc();
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
; }
64 * Get the DocAccessibleParent for the embedded document.
66 a11y::DocAccessibleParent
* GetDocAccessibleParent();
67 #endif // defined(ACCESSIBILITY)
69 // Tear down this BrowserBridgeParent.
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
,
100 mozilla::ipc::IPCResult
RecvUpdateRemoteStyle(
101 const StyleImageRendering
& aImageRendering
);
104 mozilla::ipc::IPCResult
RecvSetEmbedderAccessible(PDocAccessibleParent
* aDoc
,
108 void ActorDestroy(ActorDestroyReason aWhy
) override
;
111 ~BrowserBridgeParent();
113 RefPtr
<BrowserParent
> mBrowserParent
;
115 RefPtr
<a11y::DocAccessibleParent
> mEmbedderAccessibleDoc
;
116 uint64_t mEmbedderAccessibleID
= 0;
117 #endif // ACCESSIBILITY
121 } // namespace mozilla
123 #endif // !defined(mozilla_dom_BrowserBridgeParent_h)