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-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-03-05 05:15:58 +03:00
|
|
|
NS_INLINE_DECL_REFCOUNTING(BrowserBridgeChild);
|
2019-01-23 19:38:09 +03:00
|
|
|
|
2019-04-10 01:39:01 +03:00
|
|
|
BrowserChild* Manager() {
|
2019-01-23 19:38:09 +03:00
|
|
|
MOZ_ASSERT(mIPCOpen);
|
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; }
|
|
|
|
|
|
|
|
// XXX(nika): We should have a load context here. (bug 1532664)
|
|
|
|
nsILoadContext* GetLoadContext() { return nullptr; }
|
|
|
|
|
2019-03-05 22:33:09 +03:00
|
|
|
void NavigateByKey(bool aForward, bool aForDocumentNavigation);
|
|
|
|
|
2019-03-05 22:33:52 +03:00
|
|
|
void Activate();
|
|
|
|
|
2019-06-14 10:02:18 +03:00
|
|
|
void Deactivate(bool aWindowLowering);
|
2019-03-14 19:00:32 +03:00
|
|
|
|
2019-05-13 04:49:07 +03:00
|
|
|
void SetIsUnderHiddenEmbedderElement(bool aIsUnderHiddenEmbedderElement);
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2019-04-25 07:52:47 +03:00
|
|
|
BrowserBridgeChild(nsFrameLoader* aFrameLoader,
|
2019-06-02 20:42:03 +03:00
|
|
|
BrowsingContext* aBrowsingContext, TabId aId);
|
2019-04-25 07:52:47 +03:00
|
|
|
|
2019-01-23 20:04:26 +03:00
|
|
|
mozilla::ipc::IPCResult RecvSetLayersId(
|
|
|
|
const mozilla::layers::LayersId& aLayersId);
|
|
|
|
|
2019-03-14 19:20:51 +03:00
|
|
|
mozilla::ipc::IPCResult RecvRequestFocus(const bool& aCanRaise);
|
|
|
|
|
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-06-06 17:57:17 +03:00
|
|
|
mozilla::ipc::IPCResult RecvFireFrameLoadEvent(bool aIsTrusted);
|
|
|
|
|
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);
|
|
|
|
|
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-06-02 20:42:03 +03:00
|
|
|
TabId mId;
|
|
|
|
LayersId mLayersId;
|
2019-01-23 19:38:09 +03:00
|
|
|
bool mIPCOpen;
|
|
|
|
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)
|