2015-05-03 22:32:37 +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: */
|
2012-05-21 15:12:37 +04: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-07-01 00:39:22 +04:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
#ifndef mozilla_dom_TabChild_h
|
|
|
|
#define mozilla_dom_TabChild_h
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PBrowserChild.h"
|
2009-07-01 00:39:22 +04:00
|
|
|
#include "nsIWebNavigation.h"
|
|
|
|
#include "nsCOMPtr.h"
|
2009-11-05 21:14:22 +03:00
|
|
|
#include "nsAutoPtr.h"
|
|
|
|
#include "nsIWebBrowserChrome2.h"
|
2012-06-10 02:15:12 +04:00
|
|
|
#include "nsIEmbeddingSiteWindow.h"
|
2009-11-05 21:14:22 +03:00
|
|
|
#include "nsIWebBrowserChromeFocus.h"
|
2009-11-17 17:22:23 +03:00
|
|
|
#include "nsIDOMEventListener.h"
|
2010-01-01 04:34:06 +03:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsIWindowProvider.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsIDOMWindow.h"
|
2010-03-03 23:30:25 +03:00
|
|
|
#include "nsIDocShell.h"
|
2013-09-24 01:30:40 +04:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsFrameMessageManager.h"
|
2010-08-06 02:11:23 +04:00
|
|
|
#include "nsIPresShell.h"
|
2010-02-20 20:05:20 +03:00
|
|
|
#include "nsIScriptObjectPrincipal.h"
|
2010-03-26 21:39:39 +03:00
|
|
|
#include "nsWeakReference.h"
|
2010-05-13 21:44:51 +04:00
|
|
|
#include "nsITabChild.h"
|
2014-01-23 00:27:23 +04:00
|
|
|
#include "nsITooltipListener.h"
|
2012-06-15 06:31:55 +04: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 22:32:37 +04:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2014-04-01 10:13:50 +04:00
|
|
|
#include "mozilla/DOMEventTargetHelper.h"
|
2014-03-18 08:48:21 +04:00
|
|
|
#include "mozilla/EventDispatcher.h"
|
2013-09-25 15:21:16 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-10-19 00:57:55 +04:00
|
|
|
#include "mozilla/layers/CompositorTypes.h"
|
2015-09-11 19:27:49 +03:00
|
|
|
#include "mozilla/layers/APZCCallbackHelper.h"
|
2014-09-03 01:43:08 +04:00
|
|
|
#include "nsIWebBrowserChrome3.h"
|
2014-10-29 21:11:00 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2015-08-05 05:47:10 +03:00
|
|
|
#include "AudioChannelService.h"
|
2015-06-17 11:44:50 +03:00
|
|
|
#include "PuppetWidget.h"
|
2016-01-08 22:17:39 +03:00
|
|
|
#include "mozilla/layers/GeckoContentController.h"
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2013-02-16 02:27:21 +04:00
|
|
|
class nsICachedFileDescriptorListener;
|
2013-06-15 01:47:56 +04:00
|
|
|
class nsIDOMWindowUtils;
|
2010-03-24 13:47:18 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
namespace mozilla {
|
2010-08-21 03:24:41 +04:00
|
|
|
namespace layout {
|
|
|
|
class RenderFrameChild;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layout
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2014-04-17 15:54:25 +04:00
|
|
|
namespace layers {
|
2016-01-08 22:17:39 +03:00
|
|
|
class APZChild;
|
2015-02-09 22:05:18 +03:00
|
|
|
class APZEventState;
|
2016-01-08 22:17:39 +03:00
|
|
|
class AsyncDragMetrics;
|
2015-07-06 06:02:26 +03:00
|
|
|
class ImageCompositeNotification;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
2014-04-09 23:16:16 +04:00
|
|
|
|
2014-04-22 00:40:09 +04:00
|
|
|
namespace widget {
|
|
|
|
struct AutoCacheNativeKeyCommands;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace widget
|
2014-04-22 00:40:09 +04:00
|
|
|
|
2014-11-12 23:59:19 +03:00
|
|
|
namespace plugins {
|
|
|
|
class PluginWidgetChild;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace plugins
|
2014-11-12 23:59:19 +03:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2009-11-17 17:22:23 +03:00
|
|
|
class TabChild;
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2014-03-25 06:28:46 +04:00
|
|
|
class TabChildBase;
|
2009-11-17 17:22:23 +03:00
|
|
|
|
2014-04-01 10:13:50 +04:00
|
|
|
class TabChildGlobal : public DOMEventTargetHelper,
|
2010-02-20 20:05:20 +03:00
|
|
|
public nsIContentFrameMessageManager,
|
2013-12-12 05:51:56 +04:00
|
|
|
public nsIScriptObjectPrincipal,
|
2015-01-18 06:17:06 +03:00
|
|
|
public nsIGlobalObject,
|
|
|
|
public nsSupportsWeakReference
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 17:19:51 +04:00
|
|
|
explicit TabChildGlobal(TabChildBase* aTabChild);
|
2012-04-27 00:56:46 +04:00
|
|
|
void Init();
|
2010-02-20 20:05:20 +03:00
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-04-01 10:13:50 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal, DOMEventTargetHelper)
|
2012-08-27 18:13:02 +04:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager)
|
|
|
|
NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager)
|
2015-02-20 04:12:11 +03:00
|
|
|
NS_FORWARD_SAFE_NSIMESSAGEMANAGERGLOBAL(mMessageManager)
|
2011-10-01 20:14:36 +04:00
|
|
|
NS_IMETHOD SendSyncMessage(const nsAString& aMessageName,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2011-10-01 20:14:36 +04:00
|
|
|
JSContext* aCx,
|
2012-08-22 19:56:38 +04:00
|
|
|
uint8_t aArgc,
|
2015-03-21 19:28:04 +03:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
2011-10-01 20:14:36 +04:00
|
|
|
return mMessageManager
|
2013-11-06 21:21:15 +04:00
|
|
|
? mMessageManager->SendSyncMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2011-10-01 20:14:36 +04:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
2013-10-01 20:15:06 +04:00
|
|
|
NS_IMETHOD SendRpcMessage(const nsAString& aMessageName,
|
2014-01-09 21:39:36 +04:00
|
|
|
JS::Handle<JS::Value> aObject,
|
|
|
|
JS::Handle<JS::Value> aRemote,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2013-10-01 20:15:06 +04:00
|
|
|
JSContext* aCx,
|
|
|
|
uint8_t aArgc,
|
2015-03-21 19:28:04 +03:00
|
|
|
JS::MutableHandle<JS::Value> aRetval) override
|
2013-10-01 20:15:06 +04:00
|
|
|
{
|
|
|
|
return mMessageManager
|
2013-11-06 21:21:15 +04:00
|
|
|
? mMessageManager->SendRpcMessage(aMessageName, aObject, aRemote,
|
|
|
|
aPrincipal, aCx, aArgc, aRetval)
|
2013-10-01 20:15:06 +04:00
|
|
|
: NS_ERROR_NULL_POINTER;
|
|
|
|
}
|
2016-01-30 20:05:36 +03:00
|
|
|
NS_IMETHOD GetContent(mozIDOMWindowProxy** aContent) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
NS_IMETHOD GetDocShell(nsIDocShell** aDocShell) override;
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2015-01-06 23:14:41 +03:00
|
|
|
nsresult AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
|
|
|
bool aUseCapture)
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
|
|
|
// By default add listeners only for trusted events!
|
2014-04-01 10:13:50 +04:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture, false, 2);
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
2014-04-01 10:13:50 +04:00
|
|
|
using DOMEventTargetHelper::AddEventListener;
|
2010-02-20 20:05:20 +03:00
|
|
|
NS_IMETHOD AddEventListener(const nsAString& aType,
|
|
|
|
nsIDOMEventListener* aListener,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aUseCapture, bool aWantsUntrusted,
|
2015-03-21 19:28:04 +03:00
|
|
|
uint8_t optional_argc) override
|
2010-02-20 20:05:20 +03:00
|
|
|
{
|
2014-04-01 10:13:50 +04:00
|
|
|
return DOMEventTargetHelper::AddEventListener(aType, aListener,
|
|
|
|
aUseCapture,
|
|
|
|
aWantsUntrusted,
|
|
|
|
optional_argc);
|
2010-02-20 20:05:20 +03:00
|
|
|
}
|
|
|
|
|
2013-08-09 04:16:47 +04:00
|
|
|
nsresult
|
2015-03-21 19:28:04 +03:00
|
|
|
PreHandleEvent(EventChainPreVisitor& aVisitor) override
|
2013-08-09 04:16:47 +04:00
|
|
|
{
|
|
|
|
aVisitor.mForceContentDispatch = true;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSContext* GetJSContextForEventHandlers() override;
|
|
|
|
virtual nsIPrincipal* GetPrincipal() override;
|
|
|
|
virtual JSObject* GetGlobalJSObject() override;
|
2010-02-20 20:05:20 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) override
|
2014-10-07 13:44:48 +04:00
|
|
|
{
|
|
|
|
MOZ_CRASH("TabChildGlobal doesn't use DOM bindings!");
|
|
|
|
}
|
|
|
|
|
2010-02-20 20:05:20 +03:00
|
|
|
nsCOMPtr<nsIContentFrameMessageManager> mMessageManager;
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<TabChildBase> mTabChild;
|
2014-07-09 01:23:17 +04:00
|
|
|
|
|
|
|
protected:
|
|
|
|
~TabChildGlobal();
|
2010-02-20 20:05:20 +03:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class ContentListener final : public nsIDOMEventListener
|
2009-11-17 17:22:23 +03:00
|
|
|
{
|
|
|
|
public:
|
2014-08-05 17:19:51 +04:00
|
|
|
explicit ContentListener(TabChild* aTabChild) : mTabChild(aTabChild) {}
|
2009-11-17 17:22:23 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
|
|
|
protected:
|
2014-06-23 23:56:07 +04:00
|
|
|
~ContentListener() {}
|
2009-11-17 17:22:23 +03:00
|
|
|
TabChild* mTabChild;
|
|
|
|
};
|
|
|
|
|
2016-01-05 12:59:30 +03: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-23 01:26:45 +04:00
|
|
|
class TabChildBase : public nsISupports,
|
2015-02-20 04:10:44 +03:00
|
|
|
public nsMessageManagerScriptExecutor,
|
2014-03-25 06:28:46 +04:00
|
|
|
public ipc::MessageManagerCallback
|
|
|
|
{
|
2015-06-17 11:44:50 +03:00
|
|
|
protected:
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::widget::PuppetWidget PuppetWidget;
|
2015-06-17 11:44:50 +03:00
|
|
|
|
2014-03-25 06:28:46 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
TabChildBase();
|
2014-06-13 21:56:38 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase)
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03: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 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual ScreenIntSize GetInnerSize() = 0;
|
2015-06-08 08:39:28 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
// Get the Document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIDocument> GetDocument() const;
|
2015-09-21 15:54:00 +03:00
|
|
|
|
2014-03-25 06:28:46 +04:00
|
|
|
protected:
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual ~TabChildBase();
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
// Get the pres-shell of the document for the top-level window in this tab.
|
|
|
|
already_AddRefed<nsIPresShell> GetPresShell() const;
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03: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 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void ProcessUpdateFrame(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
2014-03-25 06:28:46 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
bool UpdateFrameHandler(const mozilla::layers::FrameMetrics& aFrameMetrics);
|
2014-03-25 06:28:46 +04:00
|
|
|
|
|
|
|
protected:
|
2016-01-05 12:59:30 +03:00
|
|
|
RefPtr<TabChildGlobal> mTabChildGlobal;
|
|
|
|
nsCOMPtr<nsIWebBrowserChrome3> mWebBrowserChrome;
|
2014-03-25 06:28:46 +04:00
|
|
|
};
|
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
class TabChild final : public TabChildBase,
|
2015-03-27 21:52:19 +03:00
|
|
|
public PBrowserChild,
|
|
|
|
public nsIWebBrowserChrome2,
|
|
|
|
public nsIEmbeddingSiteWindow,
|
|
|
|
public nsIWebBrowserChromeFocus,
|
|
|
|
public nsIInterfaceRequestor,
|
|
|
|
public nsIWindowProvider,
|
|
|
|
public nsSupportsWeakReference,
|
|
|
|
public nsITabChild,
|
|
|
|
public nsIObserver,
|
|
|
|
public TabContext,
|
|
|
|
public nsITooltipListener
|
2009-07-01 00:39:22 +04:00
|
|
|
{
|
2016-01-05 12:59:30 +03:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
|
|
|
typedef mozilla::layout::RenderFrameChild RenderFrameChild;
|
|
|
|
typedef mozilla::layers::APZEventState APZEventState;
|
|
|
|
typedef mozilla::layers::SetAllowedTouchBehaviorCallback SetAllowedTouchBehaviorCallback;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2014-06-11 09:44:36 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03:00
|
|
|
/**
|
|
|
|
* Find TabChild of aTabId in the same content process of the
|
|
|
|
* caller.
|
|
|
|
*/
|
|
|
|
static already_AddRefed<TabChild> FindTabChild(const TabId& aTabId);
|
2014-06-11 09:44:36 +04:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
public:
|
2016-01-05 12:59:30 +03: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);
|
|
|
|
|
|
|
|
// 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 19:10:00 +03:00
|
|
|
const bool& aParentIsActive,
|
|
|
|
const nsSizeMode& aSizeMode) override;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvUpdateDimensions(const CSSRect& aRect,
|
|
|
|
const CSSSize& aSize,
|
|
|
|
const ScreenOrientationInternal& aOrientation,
|
2016-03-08 22:14:43 +03:00
|
|
|
const LayoutDeviceIntPoint& aClientOffset,
|
2016-01-05 12:59:30 +03:00
|
|
|
const LayoutDeviceIntPoint& aChromeDisp) override;
|
2016-02-23 19:10:00 +03:00
|
|
|
virtual bool
|
|
|
|
RecvSizeModeChanged(const nsSizeMode& aSizeMode) override;
|
2016-01-05 12:59:30 +03: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 21:44:37 +03:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId) override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvRealDragEvent(const WidgetDragEvent& aEvent,
|
|
|
|
const uint32_t& aDragAction,
|
|
|
|
const uint32_t& aDropEffect) override;
|
2009-11-06 23:43:39 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent& aEvent,
|
|
|
|
const MaybeNativeKeyBinding& aBindings) override;
|
2012-08-29 19:26:18 +04:00
|
|
|
|
2016-01-05 12:59:30 +03: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 22:17:39 +03:00
|
|
|
virtual bool RecvMouseScrollTestEvent(const uint64_t& aLayersId,
|
|
|
|
const FrameMetrics::ViewID& aScrollId,
|
2016-01-05 12:59:30 +03:00
|
|
|
const nsString& aEvent) override;
|
2015-05-08 04:29:00 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvNativeSynthesisResponse(const uint64_t& aObserverId,
|
|
|
|
const nsCString& aResponse) override;
|
2012-11-22 06:40:57 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvPluginEvent(const WidgetPluginEvent& aEvent) override;
|
2012-07-18 03:59:45 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
RecvCompositionEvent(const mozilla::WidgetCompositionEvent& aEvent) override;
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
RecvSelectionEvent(const mozilla::WidgetSelectionEvent& aEvent) override;
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
RecvActivateFrameEvent(const nsString& aType, const bool& aCapture) override;
|
2012-11-08 07:51:55 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope) override;
|
2013-02-16 02:27:21 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2016-04-09 16:50:59 +03:00
|
|
|
const IPC::Principal& aPrincipal,
|
|
|
|
const ClonedMessageData& aData) override;
|
2013-02-16 02:27:21 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvAppOfflineStatus(const uint32_t& aId,
|
|
|
|
const bool& aOffline) override;
|
2013-07-10 21:07:51 +04:00
|
|
|
|
2016-04-29 01:04:52 +03:00
|
|
|
virtual bool
|
|
|
|
RecvSwappedWithOtherRemoteLoader(const IPCTabContext& aContext) override;
|
2013-08-13 11:56:57 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PDocAccessibleChild*
|
|
|
|
AllocPDocAccessibleChild(PDocAccessibleChild*, const uint64_t&) override;
|
2013-08-13 11:56:57 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPDocAccessibleChild(PDocAccessibleChild*) override;
|
2013-09-12 23:24:11 +04:00
|
|
|
|
2016-01-05 12:59:30 +03: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 07:24:32 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
DeallocPDocumentRendererChild(PDocumentRendererChild* aCctor) override;
|
2015-08-25 08:51:58 +03:00
|
|
|
|
2016-01-05 12:59:30 +03: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 23:24:11 +04:00
|
|
|
|
2016-01-30 20:05:36 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PColorPickerChild*
|
|
|
|
AllocPColorPickerChild(const nsString& aTitle,
|
|
|
|
const nsString& aInitialColor) override;
|
2013-09-12 23:24:11 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool DeallocPColorPickerChild(PColorPickerChild* aActor) override;
|
2014-05-23 18:36:50 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PFilePickerChild*
|
|
|
|
AllocPFilePickerChild(const nsString& aTitle, const int16_t& aMode) override;
|
2015-04-22 17:58:33 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool
|
|
|
|
DeallocPFilePickerChild(PFilePickerChild* aActor) override;
|
2015-09-18 15:19:13 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PIndexedDBPermissionRequestChild*
|
|
|
|
AllocPIndexedDBPermissionRequestChild(const Principal& aPrincipal) override;
|
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestChild(PIndexedDBPermissionRequestChild* aActor) override;
|
|
|
|
|
|
|
|
virtual nsIWebNavigation* WebNavigation() const override
|
|
|
|
{
|
|
|
|
return mWebNav;
|
|
|
|
}
|
2015-12-11 19:17:33 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual PuppetWidget* WebWidget() override { return mPuppetWidget; }
|
2014-11-12 23:59:19 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
/** Return the DPI of the widget this TabChild draws to. */
|
|
|
|
void GetDPI(float* aDPI);
|
2014-12-11 17:44:07 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void GetDefaultScale(double *aScale);
|
2015-01-07 08:42:00 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
void GetMaxTouchPoints(uint32_t* aTouchPoints);
|
2015-02-06 19:26:29 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
ScreenOrientationInternal GetOrientation() const { return mOrientation; }
|
2015-06-08 08:39:28 +03:00
|
|
|
|
2016-01-05 12:59:30 +03: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 22:18:38 +03:00
|
|
|
if (!aDocShell) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsITabChild> tc = aDocShell->GetTabChild();
|
2016-01-05 12:59:30 +03:00
|
|
|
return static_cast<TabChild*>(tc.get());
|
|
|
|
}
|
|
|
|
|
2016-01-30 20:05:36 +03: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 12:59:30 +03:00
|
|
|
static TabChild* GetFrom(nsIPresShell* aPresShell);
|
|
|
|
static TabChild* GetFrom(uint64_t aLayersId);
|
|
|
|
|
2016-03-19 04:38:57 +03:00
|
|
|
uint64_t LayersId() { return mLayersId; }
|
|
|
|
|
2016-01-05 12:59:30 +03: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 09:53:12 +03:00
|
|
|
void InvalidateLayers();
|
2016-02-29 09:53:15 +03:00
|
|
|
void CompositorUpdated(const TextureFactoryIdentifier& aNewIdentifier);
|
2016-01-05 12:59:30 +03: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;
|
|
|
|
|
2016-05-11 15:56:42 +03:00
|
|
|
virtual bool RecvHandleAccessKey(const WidgetKeyboardEvent& aEvent,
|
|
|
|
nsTArray<uint32_t>&& aCharCodes,
|
2016-01-05 12:59:30 +03:00
|
|
|
const int32_t& aModifierMask) override;
|
|
|
|
|
|
|
|
virtual bool RecvAudioChannelChangeNotification(const uint32_t& aAudioChannel,
|
|
|
|
const float& aVolume,
|
|
|
|
const bool& aMuted) override;
|
|
|
|
|
2016-03-23 21:39:28 +03:00
|
|
|
virtual bool RecvSetUseGlobalHistory(const bool& aUse) override;
|
|
|
|
|
Bug 1257759 part.5 PluginInstanceChild should post received native key event to chrome process if the key combination may be a shortcut key r=jimm
When PluginInstanceChild receives native key events, it should post the events to the chrome process first for checking if the key combination is reserved. However, posting all key events to the chrome process may make damage to the performance of text input. Therefore, this patch starts to post a key event whose key combination may be a shortcut key. However, for avoiding to shuffle the event order, it posts following key events until all posted key events are handled by the chrome process.
For receiving response from widget, this patch defines nsIKeyEventInPluginCallback. It's specified by nsIWidget::OnWindowedPluginKeyEvent() for ensuring the caller will receive the reply. Basically, the caller of nsIWidget::OnWindowedPluginKeyEvent() should reply to the child process. However, if the widget is a PuppetWidget, it cannot return the result synchronously. Therefore, PuppetWidget::OnWindowedPluginKeyEvent() returns NS_SUCCESS_EVENT_HANDLED_ASYNCHRONOUSLY and stores the callback to mKeyEventInPluginCallbacks. Then, TabParent::HandledWindowedPluginKeyEvent() will call PuppetWidget::HandledWindowedPluginKeyEvent().
MozReview-Commit-ID: G6brOU26NwQ
--HG--
extra : rebase_source : 8140456de278956d2d594e85c7b397ae366b4962
2016-04-19 14:09:37 +03:00
|
|
|
virtual bool RecvHandledWindowedPluginKeyEvent(
|
|
|
|
const mozilla::NativeEventData& aKeyEventData,
|
|
|
|
const bool& aIsConsumed) override;
|
|
|
|
|
2016-01-05 12:59:30 +03: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 22:14:43 +03:00
|
|
|
LayoutDeviceIntPoint GetClientOffset() const { return mClientOffset; }
|
2016-01-05 12:59:30 +03: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-30 02:30:57 +03:00
|
|
|
|
2016-01-08 22:17:39 +03: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-06 02:11:23 +04:00
|
|
|
protected:
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual ~TabChild();
|
|
|
|
|
|
|
|
virtual PRenderFrameChild* AllocPRenderFrameChild() override;
|
|
|
|
|
|
|
|
virtual bool DeallocPRenderFrameChild(PRenderFrameChild* aFrame) override;
|
|
|
|
|
|
|
|
virtual bool RecvDestroy() override;
|
2014-07-09 01:23:17 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvSetUpdateHitRegion(const bool& aEnabled) override;
|
2010-08-06 02:11:23 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvSetDocShellIsActive(const bool& aIsActive,
|
|
|
|
const bool& aIsHidden) override;
|
2014-05-23 22:19:00 +04:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvNavigateByKey(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation) override;
|
2015-08-20 00:08:41 +03:00
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
virtual bool RecvRequestNotifyAfterRemotePaint() override;
|
2014-11-27 16:28:26 +03:00
|
|
|
|
2016-01-05 12:59:30 +03: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 16:19:11 +03:00
|
|
|
|
2014-10-31 20:54:02 +03:00
|
|
|
#ifdef MOZ_WIDGET_GONK
|
2016-01-05 12:59:30 +03:00
|
|
|
void MaybeRequestPreinitCamera();
|
2014-10-31 20:54:02 +03:00
|
|
|
#endif
|
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
private:
|
2016-01-05 12:59:30 +03: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 18:36:30 +03:00
|
|
|
AutoTArray<nsAutoPtr<CachedFileDescriptorInfo>, 1>
|
2016-01-05 12:59:30 +03: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 22:14:43 +03:00
|
|
|
// Position of client area relative to the outer window
|
|
|
|
LayoutDeviceIntPoint mClientOffset;
|
2016-01-05 12:59:30 +03: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-12 01:31:55 +03:00
|
|
|
bool mDidLoadURLInit;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-02-02 18:36:30 +03:00
|
|
|
AutoTArray<bool, NUMBER_OF_AUDIO_CHANNELS> mAudioChannelsActive;
|
2016-01-05 12:59:30 +03:00
|
|
|
|
2016-01-08 22:17:39 +03:00
|
|
|
// APZChild clears this pointer from its destructor, so it shouldn't be a
|
|
|
|
// dangling pointer.
|
|
|
|
layers::APZChild* mAPZChild;
|
|
|
|
|
2016-01-05 12:59:30 +03:00
|
|
|
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
|
2009-07-01 00:39:22 +04:00
|
|
|
};
|
|
|
|
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2010-08-21 03:24:41 +04:00
|
|
|
#endif // mozilla_dom_TabChild_h
|