2015-05-03 19:32:37 +00: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: */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* 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/. */
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2010-08-20 23:24:41 +00:00
|
|
|
#ifndef mozilla_dom_TabChild_h
|
|
|
|
#define mozilla_dom_TabChild_h
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2010-07-19 18:33:33 +00:00
|
|
|
#include "mozilla/dom/PBrowserChild.h"
|
2009-06-30 20:39:22 +00:00
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2009-11-05 18:14:22 +00:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWebBrowserChrome2.h"
|
2012-06-09 22:15:12 +00:00
|
|
|
#include "nsIEmbeddingSiteWindow.h"
|
2009-11-05 18:14:22 +00:00
|
|
|
#include "nsIWebBrowserChromeFocus.h"
|
2009-11-17 14:22:23 +00:00
|
|
|
#include "nsIDOMEventListener.h"
|
2010-01-01 01:34:06 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2010-01-01 01:35:55 +00:00
|
|
|
#include "nsIWindowProvider.h"
|
2010-02-20 17:05:20 +00:00
|
|
|
#include "nsIDOMWindow.h"
|
2010-03-03 20:30:25 +00:00
|
|
|
#include "nsIDocShell.h"
|
2013-09-23 21:30:40 +00:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2010-02-20 17:05:20 +00:00
|
|
|
#include "nsFrameMessageManager.h"
|
2010-08-05 22:11:23 +00:00
|
|
|
#include "nsIPresShell.h"
|
2010-02-20 17:05:20 +00:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2010-03-26 18:39:39 +00:00
|
|
|
#include "nsWeakReference.h"
|
2010-05-13 17:44:51 +00:00
|
|
|
#include "nsITabChild.h"
|
2014-01-22 20:27:23 +00:00
|
|
|
#include "nsITooltipListener.h"
|
2012-06-15 02:31:55 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
Bug 802366 - The main event: Let a browser process inherit its app's id. r=bz,cjones
The main bug fixed here is that in half of our interfaces, we use "is browser frame/element" to mean "browser or app", and in the other half, we use it to mean "is browser not app".
There's a related, functional bug also fixed here, which is that a browser process doesn't inherit its parent's app-id. This causes problems e.g. for IndexedDB: If a browser inside an app uses IndexedDB, the DB should have the app's app-id.
I also modified Tab{Parent,Child} and nsFrameLoader to call "app" "ownOrContainingApp", to emphasize that we might have inherited the app from a parent process. I left nsIDocShell::appId alone, because changing that would have necessitated changing nsILoadGroup and therefore a /lot/ of users in Necko; it's also not clear it would have clarified anything in those cases.
2012-11-10 18:32:37 +00:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2014-04-01 06:13:50 +00:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-03-18 04:48:21 +00:00
|
|
|
#include "mozilla/EventDispatcher.h"
|
2013-09-25 11:21:16 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-10-18 20:57:55 +00:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2015-09-11 16:27:49 +00:00
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
2014-09-02 21:43:08 +00:00
|
|
|
#include "nsIWebBrowserChrome3.h"
|
2014-10-29 18:11:00 +00:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2015-08-05 02:47:10 +00:00
|
|
|
#include "AudioChannelService.h"
|
2015-06-17 08:44:50 +00:00
|
|
|
#include "PuppetWidget.h"
|
2016-01-08 19:17:39 +00:00
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2013-02-15 22:27:21 +00:00
|
|
|
class nsICachedFileDescriptorListener;
|
2013-06-14 21:47:56 +00:00
|
|
|
class nsIDOMWindowUtils;
|
2010-03-24 10:47:18 +00:00
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
namespace mozilla {
|
2010-08-20 23:24:41 +00:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layout
|
2010-08-20 23:24:41 +00:00
|
|
|
|
2014-04-17 11:54:25 +00:00
|
|
|
namespace layers {
|
2016-01-08 19:17:39 +00:00
|
|
|
class APZChild;
|
2015-02-09 19:05:18 +00:00
|
|
|
class APZEventState;
|
2016-01-08 19:17:39 +00:00
|
|
|
class AsyncDragMetrics;
|
2015-07-06 03:02:26 +00:00
|
|
|
class ImageCompositeNotification;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace layers
|
2014-04-09 19:16:16 +00:00
|
|
|
|
2014-04-21 20:40:09 +00:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace widget
|
2014-04-21 20:40:09 +00:00
|
|
|
|
2014-11-12 20:59:19 +00:00
|
|
|
namespace plugins {
|
|
|
|
class PluginWidgetChild;
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace plugins
|
2014-11-12 20:59:19 +00:00
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
namespace dom {
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2009-11-17 14:22:23 +00:00
|
|
|
class TabChild;
|
2012-08-02 06:02:29 +00:00
|
|
|
class ClonedMessageData;
|
2014-03-25 02:28:46 +00:00
|
|
|
class TabChildBase;
|
2009-11-17 14:22:23 +00:00
|
|
|
|
2014-04-01 06:13:50 +00:00
|
|
|
class TabChildGlobal : public DOMEventTargetHelper,
|
2010-02-20 17:05:20 +00:00
|
|
|
public nsIContentFrameMessageManager,
|
2013-12-12 01:51:56 +00:00
|
|
|
public nsIScriptObjectPrincipal,
|
2015-01-18 03:17:06 +00:00
|
|
|
public nsIGlobalObject,
|
|
|
|
public nsSupportsWeakReference
|
2010-02-20 17:05:20 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 13:19:51 +00:00
|
|
|
explicit TabChildGlobal(TabChildBase* aTabChild);
|
2012-04-26 20:56:46 +00:00
|
|
|
void Init();
|
2010-02-20 17:05:20 +00:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-04-01 06:13:50 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, DOMEventTargetHelper)
|
2012-08-27 14:13:02 +00:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2015-02-20 01:12:11 +00:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGEMANAGERGLOBAL(mMessageManager)
|
2011-10-01 16:14:36 +00:00
|
|
|
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 17:21:15 +00:00
|
|
|
nsIPrincipal* aPrincipal,
|
2011-10-01 16:14:36 +00:00
|
|
|
JSContext* aCx,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aArgc,
|
2015-03-21 16:28:04 +00:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2010-02-20 17:05:20 +00:00
|
|
|
{
|
2011-10-01 16:14:36 +00:00
|
|
|
return mMessageManager
|
2013-11-06 17:21:15 +00:00
|
|
|
? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2011-10-01 16:14:36 +00:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
2010-02-20 17:05:20 +00:00
|
|
|
}
|
2013-10-01 16:15:06 +00:00
|
|
|
NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
|
2014-01-09 17:39:36 +00:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 17:21:15 +00:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 16:15:06 +00:00
|
|
|
JSContext* aCx,
|
|
|
|
uint8_t aArgc,
|
2015-03-21 16:28:04 +00:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2013-10-01 16:15:06 +00:00
|
|
|
{
|
|
|
|
return mMessageManager
|
2013-11-06 17:21:15 +00:00
|
|
|
? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2013-10-01 16:15:06 +00:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2016-01-30 17:05:36 +00:00
|
|
|
NS_IMETHOD GetContent(mozIDOMWindowProxy** aContent) override;
|
2015-03-21 16:28:04 +00:00
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) override;
|
2010-02-20 17:05:20 +00:00
|
|
|
|
2015-01-06 20:14:41 +00:00
|
|
|
nsresult AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
bool aUseCapture)
|
2010-02-20 17:05:20 +00:00
|
|
|
{
|
|
|
|
// By default add listeners only for trusted events!
|
2014-04-01 06:13:50 +00:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture, false, 2);
|
2010-02-20 17:05:20 +00:00
|
|
|
}
|
2014-04-01 06:13:50 +00:00
|
|
|
using DOMEventTargetHelper::AddEventListener;
|
2010-02-20 17:05:20 +00:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aUseCapture, bool aWantsUntrusted,
|
2015-03-21 16:28:04 +00:00
|
|
|
uint8_t optional_argc) override
|
2010-02-20 17:05:20 +00:00
|
|
|
{
|
2014-04-01 06:13:50 +00:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture,
|
|
|
|
aWantsUntrusted,
|
|
|
|
optional_argc);
|
2010-02-20 17:05:20 +00:00
|
|
|
}
|
|
|
|
|
2013-08-09 00:16:47 +00:00
|
|
|
nsresult
|
2015-03-21 16:28:04 +00:00
|
|
|
PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
2013-08-09 00:16:47 +00:00
|
|
|
{
|
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSContext* GetJSContextForEventHandlers() override;
|
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
|
|
|
virtual JSObject* GetGlobalJSObject() override;
|
2010-02-20 17:05:20 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override
|
2014-10-07 09:44:48 +00:00
|
|
|
{
|
|
|
|
MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
|
|
|
|
}
|
|
|
|
|
2010-02-20 17:05:20 +00:00
|
|
|
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
2015-10-18 05:24:48 +00:00
|
|
|
RefPtr<TabChildBase> mTabChild;
|
2014-07-08 21:23:17 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~TabChildGlobal();
|
2010-02-20 17:05:20 +00:00
|
|
|
};
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class ContentListener final : public nsIDOMEventListener
|
2009-11-17 14:22:23 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 13:19:51 +00:00
|
|
|
explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
|
2009-11-17 14:22:23 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2014-06-23 19:56:07 +00:00
|
|
|
~ContentListener() {}
|
2009-11-17 14:22:23 +00:00
|
|
|
TabChild* mTabChild;
|
|
|
|
};
|
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
// This is base clase which helps to share Viewport and touch related
|
|
|
|
// functionality between b2g/android FF/embedlite clients implementation.
|
|
|
|
// It make sense to place in this class all helper functions, and functionality
|
|
|
|
// which could be shared between Cross-process/Cross-thread implmentations.
|
2014-04-22 21:26:45 +00:00
|
|
|
class TabChildBase : public nsISupports,
|
2015-02-20 01:10:44 +00:00
|
|
|
public nsMessageManagerScriptExecutor,
|
2014-03-25 02:28:46 +00:00
|
|
|
public ipc::MessageManagerCallback
|
|
|
|
{
|
2015-06-17 08:44:50 +00:00
|
|
|
protected:
|
2016-01-05 09:59:30 +00:00
|
|
|
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
2015-06-17 08:44:50 +00:00
|
|
|
|
2014-03-25 02:28:46 +00:00
|
|
|
public:
|
2016-01-05 09:59:30 +00:00
|
|
|
TabChildBase();
|
2014-06-13 17:56:38 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual nsIWebNavigation* WebNavigation() const = 0;
|
|
|
|
virtual PuppetWidget* WebWidget() = 0;
|
|
|
|
nsIPrincipal* GetPrincipal() { return mPrincipal; }
|
|
|
|
virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const mozilla::layers::FrameMetrics::ViewID& aViewId,
|
|
|
|
const Maybe<mozilla::layers::ZoomConstraints>& aConstraints) = 0;
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual ScreenIntSize GetInnerSize() = 0;
|
2015-06-08 05:39:28 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
// Get the Document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIDocument> GetDocument() const;
|
2015-09-21 12:54:00 +00:00
|
|
|
|
2014-03-25 02:28:46 +00:00
|
|
|
protected:
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual ~TabChildBase();
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
// Get the pres-shell of the document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIPresShell> GetPresShell() const;
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
// Wraps up a JSON object as a structured clone and sends it to the browser
|
|
|
|
// chrome script.
|
|
|
|
//
|
|
|
|
// XXX/bug 780335: Do the work the browser chrome script does in C++ instead
|
|
|
|
// so we don't need things like this.
|
|
|
|
void DispatchMessageManagerMessage(const nsAString& aMessageName,
|
|
|
|
const nsAString& aJSONData);
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
void ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
2014-03-25 02:28:46 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
2014-03-25 02:28:46 +00:00
|
|
|
|
|
|
|
protected:
|
2016-01-05 09:59:30 +00:00
|
|
|
RefPtr<TabChildGlobal> mTabChildGlobal;
|
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2014-03-25 02:28:46 +00:00
|
|
|
};
|
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
class TabChild final : public TabChildBase,
|
2015-03-27 18:52:19 +00:00
|
|
|
public PBrowserChild,
|
|
|
|
public nsIWebBrowserChrome2,
|
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsITabChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener
|
2009-06-30 20:39:22 +00:00
|
|
|
{
|
2016-01-05 09:59:30 +00:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
|
|
|
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
|
|
|
typedef mozilla::layers::APZEventState APZEventState;
|
|
|
|
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
2010-08-20 23:24:41 +00:00
|
|
|
|
2014-06-11 05:44:36 +00:00
|
|
|
public:
|
2016-01-05 09:59:30 +00:00
|
|
|
/**
|
|
|
|
* Find TabChild of aTabId in the same content process of the
|
|
|
|
* caller.
|
|
|
|
*/
|
|
|
|
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
2014-06-11 05:44:36 +00:00
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
public:
|
2016-01-05 09:59:30 +00:00
|
|
|
/**
|
|
|
|
* Create a new TabChild object.
|
|
|
|
*/
|
|
|
|
TabChild(nsIContentChild* aManager,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
uint32_t aChromeFlags);
|
|
|
|
|
|
|
|
nsresult Init();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is expected to be called off the critical path to content
|
|
|
|
* startup. This is an opportunity to load things that are slow
|
|
|
|
* on the critical path.
|
|
|
|
*/
|
|
|
|
static void PreloadSlowThings();
|
|
|
|
|
|
|
|
/** Return a TabChild with the given attributes. */
|
|
|
|
static already_AddRefed<TabChild>
|
|
|
|
Create(nsIContentChild* aManager, const TabId& aTabId,
|
|
|
|
const TabContext& aContext, uint32_t aChromeFlags);
|
|
|
|
|
|
|
|
bool IsRootContentDocument() const;
|
|
|
|
|
|
|
|
// Let managees query if it is safe to send messages.
|
|
|
|
bool IsDestroyed() const{ return mDestroyed; }
|
|
|
|
|
|
|
|
const TabId GetTabId() const
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(mUniqueId != 0);
|
|
|
|
return mUniqueId;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROME
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROME2
|
|
|
|
NS_DECL_NSIEMBEDDINGSITEWINDOW
|
|
|
|
NS_DECL_NSIWEBBROWSERCHROMEFOCUS
|
|
|
|
NS_DECL_NSIINTERFACEREQUESTOR
|
|
|
|
NS_DECL_NSIWINDOWPROVIDER
|
|
|
|
NS_DECL_NSITABCHILD
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
NS_DECL_NSITOOLTIPLISTENER
|
|
|
|
|
|
|
|
/**
|
|
|
|
* MessageManagerCallback methods that we override.
|
|
|
|
*/
|
|
|
|
virtual bool DoSendBlockingMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject *> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal,
|
|
|
|
nsTArray<StructuredCloneData>* aRetVal,
|
|
|
|
bool aIsSync) override;
|
|
|
|
|
|
|
|
virtual nsresult DoSendAsyncMessage(JSContext* aCx,
|
|
|
|
const nsAString& aMessage,
|
|
|
|
StructuredCloneData& aData,
|
|
|
|
JS::Handle<JSObject *> aCpows,
|
|
|
|
nsIPrincipal* aPrincipal) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DoUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
|
|
|
const Maybe<ZoomConstraints>& aConstraints) override;
|
|
|
|
|
|
|
|
virtual bool RecvLoadURL(const nsCString& aURI,
|
|
|
|
const BrowserConfiguration& aConfiguration,
|
|
|
|
const ShowInfo& aInfo) override;
|
|
|
|
|
|
|
|
virtual bool RecvCacheFileDescriptor(const nsString& aPath,
|
|
|
|
const FileDescriptor& aFileDescriptor)
|
|
|
|
override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvShow(const ScreenIntSize& aSize,
|
|
|
|
const ShowInfo& aInfo,
|
|
|
|
const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame,
|
2016-02-23 16:10:00 +00:00
|
|
|
const bool& aParentIsActive,
|
|
|
|
const nsSizeMode& aSizeMode) override;
|
2016-01-05 09:59:30 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvUpdateDimensions(const CSSRect& aRect,
|
|
|
|
const CSSSize& aSize,
|
|
|
|
const ScreenOrientationInternal& aOrientation,
|
2016-03-08 19:14:43 +00:00
|
|
|
const LayoutDeviceIntPoint& aClientOffset,
|
2016-01-05 09:59:30 +00:00
|
|
|
const LayoutDeviceIntPoint& aChromeDisp) override;
|
2016-02-23 16:10:00 +00:00
|
|
|
virtual bool
|
|
|
|
RecvSizeModeChanged(const nsSizeMode& aSizeMode) override;
|
2016-01-05 09:59:30 +00:00
|
|
|
|
|
|
|
virtual bool RecvActivate() override;
|
|
|
|
|
|
|
|
virtual bool RecvDeactivate() override;
|
|
|
|
|
|
|
|
virtual bool RecvMouseEvent(const nsString& aType,
|
|
|
|
const float& aX,
|
|
|
|
const float& aY,
|
|
|
|
const int32_t& aButton,
|
|
|
|
const int32_t& aClickCount,
|
|
|
|
const int32_t& aModifiers,
|
|
|
|
const bool& aIgnoreRootScrollFrame) override;
|
|
|
|
|
|
|
|
virtual bool RecvRealMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) override;
|
|
|
|
|
|
|
|
virtual bool RecvSynthMouseMoveEvent(const mozilla::WidgetMouseEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) override;
|
|
|
|
|
|
|
|
virtual bool RecvRealMouseButtonEvent(const mozilla::WidgetMouseEvent& aEvent,
|
2015-09-28 18:44:37 +00:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) override;
|
2014-09-26 23:21:57 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
|
|
|
const uint32_t& aDragAction,
|
|
|
|
const uint32_t& aDropEffect) override;
|
2009-11-06 20:43:39 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
const MaybeNativeKeyBinding& aBindings) override;
|
2012-08-29 15:26:18 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) override;
|
|
|
|
|
|
|
|
virtual bool RecvRealTouchEvent(const WidgetTouchEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvRealTouchMoveEvent(const WidgetTouchEvent& aEvent,
|
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
|
|
|
const nsEventStatus& aApzResponse) override;
|
|
|
|
|
|
|
|
virtual bool RecvKeyEvent(const nsString& aType,
|
|
|
|
const int32_t& aKeyCode,
|
|
|
|
const int32_t& aCharCode,
|
|
|
|
const int32_t& aModifiers,
|
|
|
|
const bool& aPreventDefault) override;
|
|
|
|
|
2016-01-08 19:17:39 +00:00
|
|
|
virtual bool RecvMouseScrollTestEvent(const uint64_t& aLayersId,
|
|
|
|
const FrameMetrics::ViewID& aScrollId,
|
2016-01-05 09:59:30 +00:00
|
|
|
const nsString& aEvent) override;
|
2015-05-08 01:29:00 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
|
|
|
const nsCString& aResponse) override;
|
2012-11-22 02:40:57 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
|
2012-07-17 23:59:45 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
RecvCompositionEvent(const mozilla::WidgetCompositionEvent& aEvent) override;
|
2012-07-20 06:48:27 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
RecvSelectionEvent(const mozilla::WidgetSelectionEvent& aEvent) override;
|
2012-07-20 06:48:27 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
RecvActivateFrameEvent(const nsString& aType, const bool& aCapture) override;
|
2012-11-08 03:51:55 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope) override;
|
2013-02-15 22:27:21 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
|
|
|
const ClonedMessageData& aData,
|
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
|
|
|
const IPC::Principal& aPrincipal) override;
|
2013-02-15 22:27:21 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvAppOfflineStatus(const uint32_t& aId,
|
|
|
|
const bool& aOffline) override;
|
2013-07-10 17:07:51 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvSwappedWithOtherRemoteLoader() override;
|
2013-08-13 07:56:57 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PDocAccessibleChild*
|
|
|
|
AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) override;
|
2013-08-13 07:56:57 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
2013-09-12 19:24:11 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PDocumentRendererChild*
|
|
|
|
AllocPDocumentRendererChild(const nsRect& aDocumentRect,
|
|
|
|
const gfx::Matrix& aTransform,
|
|
|
|
const nsString& aBggcolor,
|
|
|
|
const uint32_t& aRenderFlags,
|
|
|
|
const bool& aFlushLayout,
|
|
|
|
const nsIntSize& arenderSize) override;
|
2014-03-07 03:24:32 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
DeallocPDocumentRendererChild(PDocumentRendererChild* aCctor) override;
|
2015-08-25 05:51:58 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
RecvPDocumentRendererConstructor(PDocumentRendererChild* aActor,
|
|
|
|
const nsRect& aDocumentRect,
|
|
|
|
const gfx::Matrix& aTransform,
|
|
|
|
const nsString& aBgcolor,
|
|
|
|
const uint32_t& aRenderFlags,
|
|
|
|
const bool& aFlushLayout,
|
|
|
|
const nsIntSize& aRenderSize) override;
|
2013-09-12 19:24:11 +00:00
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PColorPickerChild*
|
|
|
|
AllocPColorPickerChild(const nsString& aTitle,
|
|
|
|
const nsString& aInitialColor) override;
|
2013-09-12 19:24:11 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
|
2014-05-23 14:36:50 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PFilePickerChild*
|
|
|
|
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
2015-04-22 14:58:33 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool
|
|
|
|
DeallocPFilePickerChild(PFilePickerChild* aActor) override;
|
2015-09-18 12:19:13 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PIndexedDBPermissionRequestChild*
|
|
|
|
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestChild(PIndexedDBPermissionRequestChild* aActor) override;
|
|
|
|
|
|
|
|
virtual nsIWebNavigation* WebNavigation() const override
|
|
|
|
{
|
|
|
|
return mWebNav;
|
|
|
|
}
|
2015-12-11 16:17:33 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
2014-11-12 20:59:19 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
/** Return the DPI of the widget this TabChild draws to. */
|
|
|
|
void GetDPI(float* aDPI);
|
2014-12-11 14:44:07 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
void GetDefaultScale(double *aScale);
|
2015-01-07 05:42:00 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
2015-02-06 16:26:29 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
ScreenOrientationInternal GetOrientation() const { return mOrientation; }
|
2015-06-08 05:39:28 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
void SetBackgroundColor(const nscolor& aColor);
|
|
|
|
|
|
|
|
void NotifyPainted();
|
|
|
|
|
|
|
|
void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands* aAutoCache,
|
|
|
|
WidgetKeyboardEvent* aEvent);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Signal to this TabChild that it should be made visible:
|
|
|
|
* activated widget, retained layer tree, etc. (Respectively,
|
|
|
|
* made not visible.)
|
|
|
|
*/
|
|
|
|
void MakeVisible();
|
|
|
|
void MakeHidden();
|
|
|
|
|
|
|
|
// Returns true if the file descriptor was found in the cache, false
|
|
|
|
// otherwise.
|
|
|
|
bool GetCachedFileDescriptor(const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
|
|
|
void CancelCachedFileDescriptorCallback(
|
|
|
|
const nsAString& aPath,
|
|
|
|
nsICachedFileDescriptorListener* aCallback);
|
|
|
|
|
|
|
|
nsIContentChild* Manager() const { return mManager; }
|
|
|
|
|
|
|
|
bool GetUpdateHitRegion() const { return mUpdateHitRegion; }
|
|
|
|
|
|
|
|
void UpdateHitRegion(const nsRegion& aRegion);
|
|
|
|
|
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(nsIDocShell* aDocShell)
|
|
|
|
{
|
2016-03-16 19:18:38 +00:00
|
|
|
if (!aDocShell) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsITabChild> tc = aDocShell->GetTabChild();
|
2016-01-05 09:59:30 +00:00
|
|
|
return static_cast<TabChild*>(tc.get());
|
|
|
|
}
|
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(mozIDOMWindow* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline TabChild*
|
|
|
|
GetFrom(mozIDOMWindowProxy* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
|
|
|
static TabChild* GetFrom(uint64_t aLayersId);
|
|
|
|
|
2016-03-19 01:38:57 +00:00
|
|
|
uint64_t LayersId() { return mLayersId; }
|
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
void DidComposite(uint64_t aTransactionId,
|
|
|
|
const TimeStamp& aCompositeStart,
|
|
|
|
const TimeStamp& aCompositeEnd);
|
|
|
|
|
|
|
|
void DidRequestComposite(const TimeStamp& aCompositeReqStart,
|
|
|
|
const TimeStamp& aCompositeReqEnd);
|
|
|
|
|
|
|
|
void ClearCachedResources();
|
2016-02-29 06:53:12 +00:00
|
|
|
void InvalidateLayers();
|
2016-02-29 06:53:15 +00:00
|
|
|
void CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier);
|
2016-01-05 09:59:30 +00:00
|
|
|
|
|
|
|
static inline TabChild* GetFrom(nsIDOMWindow* aWindow)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow);
|
|
|
|
nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav);
|
|
|
|
return GetFrom(docShell);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual bool RecvUIResolutionChanged(const float& aDpi,
|
|
|
|
const double& aScale) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvThemeChanged(nsTArray<LookAndFeelInt>&& aLookAndFeelIntCache) override;
|
|
|
|
|
|
|
|
virtual bool RecvHandleAccessKey(nsTArray<uint32_t>&& aCharCodes,
|
|
|
|
const bool& aIsTrusted,
|
|
|
|
const int32_t& aModifierMask) override;
|
|
|
|
|
|
|
|
virtual bool RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
|
|
|
|
const float& aVolume,
|
|
|
|
const bool& aMuted) override;
|
|
|
|
|
2016-03-23 18:39:28 +00:00
|
|
|
virtual bool RecvSetUseGlobalHistory(const bool& aUse) override;
|
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
|
|
|
PPluginWidgetChild* AllocPPluginWidgetChild() override;
|
|
|
|
|
|
|
|
bool DeallocPPluginWidgetChild(PPluginWidgetChild* aActor) override;
|
|
|
|
|
|
|
|
nsresult CreatePluginWidget(nsIWidget* aParent, nsIWidget** aOut);
|
|
|
|
|
2016-03-08 19:14:43 +00:00
|
|
|
LayoutDeviceIntPoint GetClientOffset() const { return mClientOffset; }
|
2016-01-05 09:59:30 +00:00
|
|
|
LayoutDeviceIntPoint GetChromeDisplacement() const { return mChromeDisp; };
|
|
|
|
|
|
|
|
bool IPCOpen() const { return mIPCOpen; }
|
|
|
|
|
|
|
|
bool ParentIsActive() const
|
|
|
|
{
|
|
|
|
return mParentIsActive;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool AsyncPanZoomEnabled() const { return mAsyncPanZoomEnabled; }
|
|
|
|
|
|
|
|
virtual ScreenIntSize GetInnerSize() override;
|
|
|
|
|
|
|
|
// Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
|
|
|
|
void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame,
|
|
|
|
const ShowInfo& aShowInfo);
|
2015-10-29 23:30:57 +00:00
|
|
|
|
2016-01-08 19:17:39 +00:00
|
|
|
void ContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
|
|
|
uint64_t aInputBlockId,
|
|
|
|
bool aPreventDefault) const;
|
|
|
|
void SetTargetAPZC(uint64_t aInputBlockId,
|
|
|
|
const nsTArray<ScrollableLayerGuid>& aTargets) const;
|
|
|
|
void HandleDoubleTap(const CSSPoint& aPoint,
|
|
|
|
const Modifiers& aModifiers,
|
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid);
|
|
|
|
void HandleSingleTap(const CSSPoint& aPoint,
|
|
|
|
const Modifiers& aModifiers,
|
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
|
|
|
bool aCallTakeFocusForClickFromTap);
|
|
|
|
void HandleLongTap(const CSSPoint& aPoint,
|
|
|
|
const Modifiers& aModifiers,
|
|
|
|
const mozilla::layers::ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId);
|
|
|
|
void SetAllowedTouchBehavior(uint64_t aInputBlockId,
|
|
|
|
const nsTArray<TouchBehaviorFlags>& aFlags) const;
|
|
|
|
|
|
|
|
bool UpdateFrame(const FrameMetrics& aFrameMetrics);
|
|
|
|
bool NotifyAPZStateChange(const ViewID& aViewId,
|
|
|
|
const layers::GeckoContentController::APZStateChange& aChange,
|
|
|
|
const int& aArg);
|
|
|
|
void StartScrollbarDrag(const layers::AsyncDragMetrics& aDragMetrics);
|
|
|
|
void ZoomToRect(const uint32_t& aPresShellId,
|
|
|
|
const FrameMetrics::ViewID& aViewId,
|
|
|
|
const CSSRect& aRect,
|
|
|
|
const uint32_t& aFlags);
|
|
|
|
|
|
|
|
void SetAPZChild(layers::APZChild* aAPZChild)
|
|
|
|
{
|
|
|
|
mAPZChild = aAPZChild;
|
|
|
|
}
|
|
|
|
|
2010-08-05 22:11:23 +00:00
|
|
|
protected:
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual ~TabChild();
|
|
|
|
|
|
|
|
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
|
|
|
|
|
|
|
virtual bool RecvDestroy() override;
|
2014-07-08 21:23:17 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
2010-08-05 22:11:23 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvSetDocShellIsActive(const bool& aIsActive,
|
|
|
|
const bool& aIsHidden) override;
|
2014-05-23 18:19:00 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvNavigateByKey(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation) override;
|
2015-08-19 21:08:41 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
2014-11-27 13:28:26 +00:00
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
virtual bool RecvSuppressDisplayport(const bool& aEnabled) override;
|
|
|
|
|
|
|
|
virtual bool RecvParentActivated(const bool& aActivated) override;
|
|
|
|
|
|
|
|
virtual bool RecvStopIMEStateManagement() override;
|
|
|
|
|
|
|
|
virtual bool RecvMenuKeyboardListenerInstalled(
|
|
|
|
const bool& aInstalled) override;
|
2015-07-01 13:19:11 +00:00
|
|
|
|
2014-10-31 17:54:02 +00:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2016-01-05 09:59:30 +00:00
|
|
|
void MaybeRequestPreinitCamera();
|
2014-10-31 17:54:02 +00:00
|
|
|
#endif
|
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
private:
|
2016-01-05 09:59:30 +00:00
|
|
|
// Notify others that our TabContext has been updated. (At the moment, this
|
|
|
|
// sets the appropriate app-id and is-browser flags on our docshell.)
|
|
|
|
//
|
|
|
|
// You should call this after calling TabContext::SetTabContext(). We also
|
|
|
|
// call this during Init().
|
|
|
|
void NotifyTabContextUpdated();
|
|
|
|
|
|
|
|
void ActorDestroy(ActorDestroyReason why) override;
|
|
|
|
|
|
|
|
enum FrameScriptLoading { DONT_LOAD_SCRIPTS, DEFAULT_LOAD_SCRIPTS };
|
|
|
|
|
|
|
|
bool InitTabChildGlobal(FrameScriptLoading aScriptLoading = DEFAULT_LOAD_SCRIPTS);
|
|
|
|
|
|
|
|
bool InitRenderingState(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
|
|
|
|
const uint64_t& aLayersId,
|
|
|
|
PRenderFrameChild* aRenderFrame);
|
|
|
|
|
|
|
|
void DestroyWindow();
|
|
|
|
|
|
|
|
void SetProcessNameToAppName();
|
|
|
|
|
|
|
|
void ApplyShowInfo(const ShowInfo& aInfo);
|
|
|
|
|
|
|
|
bool HasValidInnerSize();
|
|
|
|
|
|
|
|
void SetTabId(const TabId& aTabId);
|
|
|
|
|
|
|
|
ScreenIntRect GetOuterRect();
|
|
|
|
|
|
|
|
void SetUnscaledInnerSize(const CSSSize& aSize)
|
|
|
|
{
|
|
|
|
mUnscaledInnerSize = aSize;
|
|
|
|
}
|
|
|
|
|
|
|
|
class CachedFileDescriptorInfo;
|
|
|
|
class CachedFileDescriptorCallbackRunnable;
|
|
|
|
class DelayedDeleteRunnable;
|
|
|
|
|
|
|
|
TextureFactoryIdentifier mTextureFactoryIdentifier;
|
|
|
|
nsCOMPtr<nsIWebNavigation> mWebNav;
|
|
|
|
RefPtr<PuppetWidget> mPuppetWidget;
|
|
|
|
nsCOMPtr<nsIURI> mLastURI;
|
|
|
|
RenderFrameChild* mRemoteFrame;
|
|
|
|
RefPtr<nsIContentChild> mManager;
|
|
|
|
uint32_t mChromeFlags;
|
|
|
|
int32_t mActiveSuppressDisplayport;
|
|
|
|
uint64_t mLayersId;
|
|
|
|
CSSRect mUnscaledOuterRect;
|
|
|
|
// Whether we have already received a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorRecved;
|
|
|
|
// At present only 1 of these is really expected.
|
2016-02-02 15:36:30 +00:00
|
|
|
AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
2016-01-05 09:59:30 +00:00
|
|
|
mCachedFileDescriptorInfos;
|
|
|
|
nscolor mLastBackgroundColor;
|
|
|
|
bool mDidFakeShow;
|
|
|
|
bool mNotified;
|
|
|
|
bool mTriedBrowserInit;
|
|
|
|
ScreenOrientationInternal mOrientation;
|
|
|
|
bool mUpdateHitRegion;
|
|
|
|
|
|
|
|
bool mIgnoreKeyPressEvent;
|
|
|
|
RefPtr<APZEventState> mAPZEventState;
|
|
|
|
SetAllowedTouchBehaviorCallback mSetAllowedTouchBehaviorCallback;
|
|
|
|
bool mHasValidInnerSize;
|
|
|
|
bool mDestroyed;
|
2016-03-08 19:14:43 +00:00
|
|
|
// Position of client area relative to the outer window
|
|
|
|
LayoutDeviceIntPoint mClientOffset;
|
2016-01-05 09:59:30 +00:00
|
|
|
// Position of tab, relative to parent widget (typically the window)
|
|
|
|
LayoutDeviceIntPoint mChromeDisp;
|
|
|
|
TabId mUniqueId;
|
|
|
|
|
|
|
|
friend class ContentChild;
|
|
|
|
float mDPI;
|
|
|
|
double mDefaultScale;
|
|
|
|
|
|
|
|
bool mIPCOpen;
|
|
|
|
bool mParentIsActive;
|
|
|
|
bool mAsyncPanZoomEnabled;
|
|
|
|
CSSSize mUnscaledInnerSize;
|
|
|
|
bool mDidSetRealShowInfo;
|
2016-03-11 22:31:55 +00:00
|
|
|
bool mDidLoadURLInit;
|
2016-01-05 09:59:30 +00:00
|
|
|
|
2016-02-02 15:36:30 +00:00
|
|
|
AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
2016-01-05 09:59:30 +00:00
|
|
|
|
2016-01-08 19:17:39 +00:00
|
|
|
// APZChild clears this pointer from its destructor, so it shouldn't be a
|
|
|
|
// dangling pointer.
|
|
|
|
layers::APZChild* mAPZChild;
|
|
|
|
|
2016-01-05 09:59:30 +00:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
2009-06-30 20:39:22 +00:00
|
|
|
};
|
|
|
|
|
2015-07-13 15:25:42 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2010-08-20 23:24:41 +00:00
|
|
|
#endif // mozilla_dom_TabChild_h
|