Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / dom / ipc / BrowserBridgeHost.h
blob6d2a6a801b8f89f313733fe68a57325d6c2c1762
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_BrowserBridgeHost_h
8 #define mozilla_dom_BrowserBridgeHost_h
10 #include "mozilla/dom/RemoteBrowser.h"
11 #include "mozilla/dom/BrowserBridgeChild.h"
13 namespace mozilla::dom {
15 /**
16 * BrowserBridgeHost manages a remote browser from a content process.
18 * It is used via the RemoteBrowser interface in nsFrameLoader and proxies
19 * work to the chrome process via PBrowserBridge.
21 * See `dom/docs/Fission-IPC-Diagram.svg` for an overview of the DOM IPC
22 * actors.
24 class BrowserBridgeHost final : public RemoteBrowser {
25 public:
26 typedef mozilla::layers::LayersId LayersId;
28 explicit BrowserBridgeHost(BrowserBridgeChild* aChild);
30 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
31 NS_DECL_CYCLE_COLLECTION_CLASS(BrowserBridgeHost)
33 // Get the IPDL actor for the BrowserBridgeChild.
34 BrowserBridgeChild* GetActor() { return mBridge; }
36 BrowserHost* AsBrowserHost() override { return nullptr; }
37 BrowserBridgeHost* AsBrowserBridgeHost() override { return this; }
39 TabId GetTabId() const override;
40 LayersId GetLayersId() const override;
41 BrowsingContext* GetBrowsingContext() const override;
42 nsILoadContext* GetLoadContext() const override;
43 bool CanRecv() const override;
45 void LoadURL(nsDocShellLoadState* aLoadState) override;
46 void ResumeLoad(uint64_t aPendingSwitchId) override;
47 void DestroyStart() override;
48 void DestroyComplete() override;
50 bool Show(const OwnerShowInfo&) override;
51 void UpdateDimensions(const LayoutDeviceIntRect& aRect,
52 const LayoutDeviceIntSize& aSize) override;
54 void UpdateEffects(EffectsInfo aInfo) override;
56 private:
57 virtual ~BrowserBridgeHost() = default;
59 already_AddRefed<nsIWidget> GetWidget() const;
61 // The IPDL actor for proxying browser operations
62 RefPtr<BrowserBridgeChild> mBridge;
63 EffectsInfo mEffectsInfo;
66 } // namespace mozilla::dom
68 #endif // mozilla_dom_BrowserBridgeHost_h