2019-01-23 19:38:09 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
#ifndef mozilla_dom_BrowserBridgeChild_h
|
|
|
|
#define mozilla_dom_BrowserBridgeChild_h
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
#include "mozilla/dom/PBrowserBridgeChild.h"
|
2019-04-10 01:39:01 +03:00
|
|
|
#include "mozilla/dom/BrowserChild.h"
|
2019-06-02 20:42:03 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2019-01-23 19:38:09 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
2019-05-24 21:49:31 +03:00
|
|
|
|
|
|
|
namespace a11y {
|
|
|
|
class RemoteIframeDocProxyAccessibleWrap;
|
|
|
|
}
|
|
|
|
|
2019-01-23 19:38:09 +03:00
|
|
|
namespace dom {
|
2019-03-14 21:50:47 +03:00
|
|
|
class BrowsingContext;
|
2019-04-25 07:52:47 +03:00
|
|
|
class ContentChild;
|
2019-10-15 19:19:13 +03:00
|
|
|
class BrowserBridgeHost;
|
2019-01-23 19:38:09 +03:00
|
|
|
|
|
|
|
/**
|
2019-05-06 17:47:56 +03:00
|
|
|
* BrowserBridgeChild implements the child actor part of the PBrowserBridge
|
|
|
|
* protocol. See PBrowserBridge for more information.
|
2019-01-23 19:38:09 +03:00
|
|
|
*/
|
2019-03-05 05:15:58 +03:00
|
|
|
class BrowserBridgeChild : public PBrowserBridgeChild {
|
2019-01-23 19:38:09 +03:00
|
|
|
public:
|
2019-06-02 20:42:03 +03:00
|
|
|
typedef mozilla::layers::LayersId LayersId;
|
|
|
|
|
2019-07-29 22:54:18 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(BrowserBridgeChild, final);
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
BrowserChild* Manager() {
|
2019-10-15 19:19:14 +03:00
|
|
|
MOZ_ASSERT(CanSend());
|
2019-04-10 01:39:01 +03:00
|
|
|
return static_cast<BrowserChild*>(PBrowserBridgeChild::Manager());
|
2019-01-23 19:38:09 +03:00
|
|
|
}
|
|
|
|
|
2019-06-02 20:42:03 +03:00
|
|
|
TabId GetTabId() { return mId; }
|
|
|
|
|
|
|
|
LayersId GetLayersId() { return mLayersId; }
|
|
|
|
|
2019-05-08 19:27:49 +03:00
|
|
|
nsFrameLoader* GetFrameLoader() const { return mFrameLoader; }
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-03-14 21:50:47 +03:00
|
|
|
BrowsingContext* GetBrowsingContext() { return mBrowsingContext; }
|
|
|
|
|
2020-05-08 01:18:50 +03:00
|
|
|
nsILoadContext* GetLoadContext();
|
2019-03-14 21:50:47 +03:00
|
|
|
|
2019-03-05 22:33:09 +03:00
|
|
|
void NavigateByKey(bool aForward, bool aForDocumentNavigation);
|
|
|
|
|
2020-11-16 22:16:20 +03:00
|
|
|
void Activate(uint64_t aActionId);
|
2019-03-05 22:33:52 +03:00
|
|
|
|
2020-11-16 22:16:20 +03:00
|
|
|
void Deactivate(bool aWindowLowering, uint64_t aActionId);
|
2019-03-14 19:00:32 +03:00
|
|
|
|
2019-05-13 04:49:07 +03:00
|
|
|
void SetIsUnderHiddenEmbedderElement(bool aIsUnderHiddenEmbedderElement);
|
|
|
|
|
2019-10-22 16:57:00 +03:00
|
|
|
already_AddRefed<BrowserBridgeHost> FinishInit(nsFrameLoader* aFrameLoader);
|
2019-10-15 19:19:13 +03:00
|
|
|
|
2019-05-24 21:49:31 +03:00
|
|
|
#if defined(ACCESSIBILITY) && defined(XP_WIN)
|
|
|
|
a11y::RemoteIframeDocProxyAccessibleWrap* GetEmbeddedDocAccessible() {
|
|
|
|
return mEmbeddedDocAccessible;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
static BrowserBridgeChild* GetFrom(nsFrameLoader* aFrameLoader);
|
2019-03-05 22:33:09 +03:00
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
static BrowserBridgeChild* GetFrom(nsIContent* aContent);
|
2019-03-05 22:33:09 +03:00
|
|
|
|
2020-05-25 09:06:30 +03:00
|
|
|
BrowserBridgeChild(BrowsingContext* aBrowsingContext, TabId aId,
|
|
|
|
const LayersId& aLayersId);
|
2019-10-15 19:19:16 +03:00
|
|
|
|
2019-01-23 19:38:09 +03:00
|
|
|
protected:
|
2019-04-25 07:52:47 +03:00
|
|
|
friend class ContentChild;
|
2019-03-05 05:15:58 +03:00
|
|
|
friend class PBrowserBridgeChild;
|
2019-01-23 20:04:26 +03:00
|
|
|
|
2020-01-16 17:38:40 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestFocus(const bool& aCanRaise,
|
|
|
|
const CallerType aCallerType);
|
2019-03-14 19:20:51 +03:00
|
|
|
|
2019-03-14 19:25:33 +03:00
|
|
|
mozilla::ipc::IPCResult RecvMoveFocus(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation);
|
|
|
|
|
2019-05-24 21:49:31 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetEmbeddedDocAccessibleCOMProxy(
|
|
|
|
const IDispatchHolder& aCOMProxy);
|
|
|
|
|
2019-09-19 03:00:44 +03:00
|
|
|
mozilla::ipc::IPCResult RecvMaybeFireEmbedderLoadEvents(
|
2020-04-16 01:30:13 +03:00
|
|
|
EmbedderElementEventType aFireEventAtEmbeddingElement);
|
2019-06-06 17:57:17 +03:00
|
|
|
|
2020-09-21 05:09:57 +03:00
|
|
|
mozilla::ipc::IPCResult RecvIntrinsicSizeOrRatioChanged(
|
|
|
|
const Maybe<IntrinsicSize>& aIntrinsicSize,
|
|
|
|
const Maybe<AspectRatio>& aIntrinsicRatio);
|
|
|
|
|
2019-07-09 08:34:27 +03:00
|
|
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY
|
|
|
|
mozilla::ipc::IPCResult RecvScrollRectIntoView(
|
|
|
|
const nsRect& aRect, const ScrollAxis& aVertical,
|
|
|
|
const ScrollAxis& aHorizontal, const ScrollFlags& aScrollFlags,
|
|
|
|
const int32_t& aAppUnitsPerDevPixel);
|
|
|
|
|
2020-04-29 12:58:50 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSubFrameCrashed();
|
2019-08-26 16:08:32 +03:00
|
|
|
|
2019-01-23 19:38:09 +03:00
|
|
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
|
|
|
|
|
|
|
private:
|
2019-03-05 05:15:58 +03:00
|
|
|
~BrowserBridgeChild();
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-09-19 03:00:44 +03:00
|
|
|
void UnblockOwnerDocsLoadEvent();
|
|
|
|
|
2019-06-02 20:42:03 +03:00
|
|
|
TabId mId;
|
|
|
|
LayersId mLayersId;
|
2019-09-19 03:00:44 +03:00
|
|
|
bool mHadInitialLoad = false;
|
2019-01-23 19:38:09 +03:00
|
|
|
RefPtr<nsFrameLoader> mFrameLoader;
|
2019-03-14 21:50:47 +03:00
|
|
|
RefPtr<BrowsingContext> mBrowsingContext;
|
2019-05-24 21:49:31 +03:00
|
|
|
#if defined(ACCESSIBILITY) && defined(XP_WIN)
|
|
|
|
RefPtr<a11y::RemoteIframeDocProxyAccessibleWrap> mEmbeddedDocAccessible;
|
|
|
|
#endif
|
2019-01-23 19:38:09 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2019-03-05 05:15:58 +03:00
|
|
|
#endif // !defined(mozilla_dom_BrowserBridgeParent_h)
|