2009-08-18 23:05:15 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
|
|
/* vim: set sw=4 ts=8 et 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
|
|
|
|
|
|
|
#ifndef mozilla_tabs_TabParent_h
|
|
|
|
#define mozilla_tabs_TabParent_h
|
|
|
|
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "js/TypeDecls.h"
|
2015-06-05 12:28:18 +03:00
|
|
|
#include "mozilla/ContentCache.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/dom/ipc/IdType.h"
|
2010-07-19 22:33:33 +04:00
|
|
|
#include "mozilla/dom/PBrowserParent.h"
|
2014-02-18 04:30:06 +04:00
|
|
|
#include "mozilla/dom/PFilePickerParent.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"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/EventForwards.h"
|
2015-04-08 21:48:11 +03:00
|
|
|
#include "mozilla/dom/File.h"
|
|
|
|
#include "mozilla/RefPtr.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsCOMPtr.h"
|
2012-06-23 05:27:30 +04:00
|
|
|
#include "nsIAuthPromptProvider.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
#include "nsIBrowserDOMWindow.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "nsIDOMEventListener.h"
|
2010-08-13 12:06:40 +04:00
|
|
|
#include "nsISecureBrowserUI.h"
|
2012-06-23 05:27:30 +04:00
|
|
|
#include "nsITabParent.h"
|
2015-08-06 00:25:39 +03:00
|
|
|
#include "nsIWebBrowserPersistable.h"
|
2014-01-23 00:27:23 +04:00
|
|
|
#include "nsIXULBrowserWindow.h"
|
2015-04-21 17:33:56 +03:00
|
|
|
#include "nsRefreshDriver.h"
|
2014-06-06 06:49:43 +04:00
|
|
|
#include "nsWeakReference.h"
|
2013-07-11 18:43:35 +04:00
|
|
|
#include "Units.h"
|
2015-04-15 02:29:10 +03:00
|
|
|
#include "nsIWidget.h"
|
2010-01-01 04:35:55 +03:00
|
|
|
|
2012-06-23 05:27:30 +04:00
|
|
|
class nsFrameLoader;
|
2015-02-06 00:47:32 +03:00
|
|
|
class nsIFrameLoader;
|
2013-10-19 00:57:55 +04:00
|
|
|
class nsIContent;
|
2013-11-06 21:21:15 +04:00
|
|
|
class nsIPrincipal;
|
2012-06-23 05:27:30 +04:00
|
|
|
class nsIURI;
|
2014-01-11 05:10:57 +04:00
|
|
|
class nsILoadContext;
|
2014-10-29 21:11:00 +03:00
|
|
|
class nsIDocShell;
|
2009-11-06 23:43:39 +03:00
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
namespace mozilla {
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2015-01-27 00:32:18 +03:00
|
|
|
namespace jsipc {
|
|
|
|
class CpowHolder;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace jsipc
|
2015-01-27 00:32:18 +03:00
|
|
|
|
2012-07-20 10:48:27 +04:00
|
|
|
namespace layers {
|
|
|
|
struct FrameMetrics;
|
Bug 825928: Land layers refactoring. r=jrmuizel,bas,nical,mattwoodrow,roc,nrc,benwa,bjacob,jgilbert,kchen CLOSED TREE
Please contact Bas Schouten <bschouten@mozilla.com>, Nicolas Silva <nsilva@mozilla.com> or Nicholas Cameron <ncameron@mozilla.com> with general questions. Below is a rough list of authors to contact with specific questions.
Authors:
gfx/layers/Compositor.* gfx/layers/Effects.h - Compositor Interface - bas,nrc,nical
gfx/layers/d3d* - D3D9/D3D10 - bas
gfx/layers/ThebesLayer* - ThebesLayers - nrc,bas
gfx/layers/composite/* - CompositeLayers - nrc,nical
gfx/layers/client/* - Client - nrc,nical,bas
gfx/layers/*Image* - nical
gfx/layers/ipc ipc - IPC - nical
gfx/layers/opengl - CompositorOGL - nrc,nical
gfx/2d - bas,nrc
gfx/gl - GLContext - bjacob
dom/* layout/* - DOM - mattwoodrow
2013-04-10 13:20:52 +04:00
|
|
|
struct TextureFactoryIdentifier;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layers
|
2012-07-20 10:48:27 +04:00
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RenderFrameParent;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace layout
|
2012-07-20 10:48:27 +04:00
|
|
|
|
2014-09-11 17:46:17 +04:00
|
|
|
namespace widget {
|
|
|
|
struct IMENotification;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace widget
|
2014-09-11 17:46:17 +04:00
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
namespace gfx {
|
|
|
|
class SourceSurface;
|
|
|
|
class DataSourceSurface;
|
2015-07-13 18:25:42 +03:00
|
|
|
} // namespace gfx
|
2015-04-08 21:48:11 +03:00
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
namespace dom {
|
2009-07-01 00:39:22 +04:00
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
class ClonedMessageData;
|
2014-06-11 09:44:03 +04:00
|
|
|
class nsIContentParent;
|
2013-07-24 03:39:17 +04:00
|
|
|
class Element;
|
2015-04-08 21:48:11 +03:00
|
|
|
class DataTransfer;
|
2015-09-10 23:50:58 +03:00
|
|
|
|
|
|
|
namespace ipc {
|
|
|
|
class StructuredCloneData;
|
|
|
|
} // ipc namespace
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2015-03-21 21:35:18 +03:00
|
|
|
class TabParent final : public PBrowserParent
|
2015-03-31 23:39:02 +03:00
|
|
|
, public nsIDOMEventListener
|
2015-03-21 21:35:18 +03:00
|
|
|
, public nsITabParent
|
|
|
|
, public nsIAuthPromptProvider
|
|
|
|
, public nsISecureBrowserUI
|
|
|
|
, public nsSupportsWeakReference
|
|
|
|
, public TabContext
|
2015-04-21 17:33:56 +03:00
|
|
|
, public nsAPostRefreshObserver
|
2015-08-06 00:25:39 +03:00
|
|
|
, public nsIWebBrowserPersistable
|
2009-07-01 00:39:22 +04:00
|
|
|
{
|
2012-08-02 10:02:29 +04:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
|
|
|
|
2014-06-23 23:56:07 +04:00
|
|
|
virtual ~TabParent();
|
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
public:
|
2014-01-24 13:02:23 +04:00
|
|
|
// nsITabParent
|
|
|
|
NS_DECL_NSITABPARENT
|
2015-03-31 23:39:02 +03:00
|
|
|
// nsIDOMEventListener interfaces
|
|
|
|
NS_DECL_NSIDOMEVENTLISTENER
|
2014-01-24 13:02:23 +04:00
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
TabParent(nsIContentParent* aManager,
|
|
|
|
const TabId& aTabId,
|
|
|
|
const TabContext& aContext,
|
|
|
|
uint32_t aChromeFlags);
|
2013-07-24 03:39:17 +04:00
|
|
|
Element* GetOwnerElement() const { return mFrameElement; }
|
|
|
|
void SetOwnerElement(Element* aElement);
|
2013-04-26 04:53:26 +04:00
|
|
|
|
2015-02-27 08:35:26 +03:00
|
|
|
void CacheFrameLoader(nsFrameLoader* aFrameLoader);
|
|
|
|
|
2013-04-26 04:53:26 +04:00
|
|
|
/**
|
|
|
|
* Get the mozapptype attribute from this TabParent's owner DOM element.
|
|
|
|
*/
|
|
|
|
void GetAppType(nsAString& aOut);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true iff this TabParent's nsIFrameLoader is visible.
|
|
|
|
*
|
|
|
|
* The frameloader's visibility can be independent of e.g. its docshell's
|
|
|
|
* visibility.
|
|
|
|
*/
|
|
|
|
bool IsVisible();
|
|
|
|
|
2010-08-18 07:19:24 +04:00
|
|
|
nsIBrowserDOMWindow *GetBrowserDOMWindow() { return mBrowserDOMWindow; }
|
2010-01-01 04:35:55 +03:00
|
|
|
void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow) {
|
|
|
|
mBrowserDOMWindow = aBrowserDOMWindow;
|
|
|
|
}
|
2012-08-09 06:58:06 +04:00
|
|
|
|
2014-01-11 05:10:57 +04:00
|
|
|
already_AddRefed<nsILoadContext> GetLoadContext();
|
2015-07-09 17:48:57 +03:00
|
|
|
already_AddRefed<nsIWidget> GetTopLevelWidget();
|
2014-01-23 00:27:23 +04:00
|
|
|
nsIXULBrowserWindow* GetXULBrowserWindow();
|
|
|
|
|
2011-01-06 07:54:47 +03:00
|
|
|
void Destroy();
|
2015-08-31 13:21:40 +03:00
|
|
|
void Detach();
|
|
|
|
void Attach(nsFrameLoader* aFrameLoader);
|
2011-01-06 07:54:47 +03:00
|
|
|
|
2015-03-31 23:39:02 +03:00
|
|
|
void RemoveWindowListeners();
|
2015-04-21 17:33:56 +03:00
|
|
|
void AddWindowListeners();
|
2015-04-21 17:33:56 +03:00
|
|
|
void DidRefresh() override;
|
2015-03-31 23:39:02 +03:00
|
|
|
|
2015-07-13 13:07:49 +03:00
|
|
|
virtual bool RecvMoveFocus(const bool& aForward,
|
|
|
|
const bool& aForDocumentNavigation) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvEvent(const RemoteDOMEvent& aEvent) override;
|
|
|
|
virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& aEvent) override;
|
|
|
|
virtual bool RecvDispatchAfterKeyboardEvent(const WidgetKeyboardEvent& aEvent) override;
|
2012-06-13 02:01:25 +04:00
|
|
|
virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
|
|
|
|
const nsString& aURL,
|
|
|
|
const nsString& aName,
|
|
|
|
const nsString& aFeatures,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool* aOutWindowOpened) override;
|
2015-01-16 21:07:50 +03:00
|
|
|
virtual bool RecvCreateWindow(PBrowserParent* aOpener,
|
|
|
|
const uint32_t& aChromeFlags,
|
|
|
|
const bool& aCalledFromJS,
|
|
|
|
const bool& aPositionSpecified,
|
|
|
|
const bool& aSizeSpecified,
|
|
|
|
const nsString& aURI,
|
|
|
|
const nsString& aName,
|
2015-07-17 18:30:51 +03:00
|
|
|
const nsCString& aFeatures,
|
2015-01-16 21:07:50 +03:00
|
|
|
const nsString& aBaseURI,
|
2015-06-29 21:37:57 +03:00
|
|
|
nsresult* aResult,
|
2015-01-16 21:07:50 +03:00
|
|
|
bool* aWindowIsNew,
|
2015-01-23 07:00:18 +03:00
|
|
|
InfallibleTArray<FrameScriptInfo>* aFrameScripts,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsCString* aURLToLoad) override;
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool RecvSyncMessage(const nsString& aMessage,
|
2012-08-02 10:02:29 +04:00
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2013-11-06 21:21:15 +04:00
|
|
|
const IPC::Principal& aPrincipal,
|
2015-09-10 23:50:58 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetVal) override;
|
2014-10-08 08:32:45 +04:00
|
|
|
virtual bool RecvRpcMessage(const nsString& aMessage,
|
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2014-10-08 08:32:45 +04:00
|
|
|
const IPC::Principal& aPrincipal,
|
2015-09-10 23:50:58 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aRetVal) override;
|
2010-07-19 22:33:33 +04:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
2013-07-11 02:05:39 +04:00
|
|
|
const ClonedMessageData& aData,
|
2015-01-16 22:58:52 +03:00
|
|
|
InfallibleTArray<CpowEntry>&& aCpows,
|
2015-03-21 19:28:04 +03:00
|
|
|
const IPC::Principal& aPrincipal) override;
|
2015-07-17 07:30:01 +03:00
|
|
|
virtual bool RecvNotifyIMEFocus(const ContentCache& aContentCache,
|
|
|
|
const widget::IMENotification& aEventMessage,
|
2015-05-28 07:51:40 +03:00
|
|
|
nsIMEUpdatePreference* aPreference)
|
|
|
|
override;
|
2015-06-05 12:28:20 +03:00
|
|
|
virtual bool RecvNotifyIMETextChange(const ContentCache& aContentCache,
|
2015-07-17 07:30:01 +03:00
|
|
|
const widget::IMENotification& aEventMessage) override;
|
|
|
|
virtual bool RecvNotifyIMECompositionUpdate(const ContentCache& aContentCache,
|
|
|
|
const widget::IMENotification& aEventMessage) override;
|
2015-06-05 12:28:20 +03:00
|
|
|
virtual bool RecvNotifyIMESelection(const ContentCache& aContentCache,
|
2015-07-17 07:30:01 +03:00
|
|
|
const widget::IMENotification& aEventMessage) override;
|
2015-06-05 12:28:20 +03:00
|
|
|
virtual bool RecvUpdateContentCache(const ContentCache& aContentCache) override;
|
2014-09-11 17:46:17 +04:00
|
|
|
virtual bool RecvNotifyIMEMouseButtonEvent(const widget::IMENotification& aEventMessage,
|
2015-03-21 19:28:04 +03:00
|
|
|
bool* aConsumedByIME) override;
|
2015-07-17 07:30:01 +03:00
|
|
|
virtual bool RecvNotifyIMEPositionChange(const ContentCache& aContentCache,
|
|
|
|
const widget::IMENotification& aEventMessage) override;
|
2015-08-26 15:56:59 +03:00
|
|
|
virtual bool RecvOnEventNeedingAckHandled(const EventMessage& aMessage) override;
|
2011-09-29 10:19:26 +04:00
|
|
|
virtual bool RecvEndIMEComposition(const bool& aCancel,
|
2015-02-17 05:30:55 +03:00
|
|
|
bool* aNoCompositionEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsString* aComposition) override;
|
2015-02-20 19:37:02 +03:00
|
|
|
virtual bool RecvStartPluginIME(const WidgetKeyboardEvent& aKeyboardEvent,
|
|
|
|
const int32_t& aPanelX,
|
|
|
|
const int32_t& aPanelY,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsString* aCommitted) override;
|
|
|
|
virtual bool RecvSetPluginFocused(const bool& aFocused) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
|
2012-10-27 03:35:20 +04:00
|
|
|
int32_t* aIMEOpen,
|
2015-03-21 19:28:04 +03:00
|
|
|
intptr_t* aNativeIMEContext) override;
|
2012-08-22 19:56:38 +04:00
|
|
|
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
|
|
|
|
const int32_t& aIMEOpen,
|
2011-11-27 15:51:52 +04:00
|
|
|
const nsString& aType,
|
2012-08-27 06:16:22 +04:00
|
|
|
const nsString& aInputmode,
|
2011-11-27 15:51:52 +04:00
|
|
|
const nsString& aActionHint,
|
2012-08-22 19:56:38 +04:00
|
|
|
const int32_t& aCause,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int32_t& aFocusChange) override;
|
|
|
|
virtual bool RecvRequestFocus(const bool& aCanRaise) override;
|
2014-12-09 18:48:27 +03:00
|
|
|
virtual bool RecvEnableDisableCommands(const nsString& aAction,
|
2015-01-16 22:58:52 +03:00
|
|
|
nsTArray<nsCString>&& aEnabledCommands,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsTArray<nsCString>&& aDisabledCommands) override;
|
|
|
|
virtual bool RecvSetCursor(const uint32_t& aValue, const bool& aForce) override;
|
2015-05-20 04:28:57 +03:00
|
|
|
virtual bool RecvSetCustomCursor(const nsCString& aUri,
|
|
|
|
const uint32_t& aWidth,
|
|
|
|
const uint32_t& aHeight,
|
|
|
|
const uint32_t& aStride,
|
|
|
|
const uint8_t& aFormat,
|
|
|
|
const uint32_t& aHotspotX,
|
|
|
|
const uint32_t& aHotspotY,
|
|
|
|
const bool& aForce) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvSetBackgroundColor(const nscolor& aValue) override;
|
|
|
|
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) override;
|
|
|
|
virtual bool RecvIsParentWindowMainWidgetVisible(bool* aIsVisible) override;
|
|
|
|
virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip) override;
|
|
|
|
virtual bool RecvHideTooltip() override;
|
2015-04-08 19:51:49 +03:00
|
|
|
virtual bool RecvGetTabOffset(LayoutDeviceIntPoint* aPoint) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvGetDPI(float* aValue) override;
|
|
|
|
virtual bool RecvGetDefaultScale(double* aValue) override;
|
2015-05-08 04:29:00 +03:00
|
|
|
virtual bool RecvGetMaxTouchPoints(uint32_t* aTouchPoints) override;
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) override;
|
2015-08-12 18:00:26 +03:00
|
|
|
virtual bool RecvSetNativeChildOfShareableWindow(const uintptr_t& childWindow) override;
|
2015-07-09 17:48:57 +03:00
|
|
|
virtual bool RecvDispatchFocusToTopLevelWindow() override;
|
2013-11-13 22:20:30 +04:00
|
|
|
virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2015-03-21 19:28:04 +03:00
|
|
|
const CSSRect& aRect) override;
|
2013-11-14 21:35:41 +04:00
|
|
|
virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2015-06-17 19:32:41 +03:00
|
|
|
const MaybeZoomConstraints& aConstraints) override;
|
2015-08-28 08:10:48 +03:00
|
|
|
virtual bool RecvRespondStartSwipeEvent(const uint64_t& aInputBlockId,
|
|
|
|
const bool& aStartSwipe) override;
|
2014-12-09 13:35:12 +03:00
|
|
|
virtual bool RecvContentReceivedInputBlock(const ScrollableLayerGuid& aGuid,
|
|
|
|
const uint64_t& aInputBlockId,
|
2015-03-21 19:28:04 +03:00
|
|
|
const bool& aPreventDefault) override;
|
2014-11-22 05:36:25 +03:00
|
|
|
virtual bool RecvSetTargetAPZC(const uint64_t& aInputBlockId,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsTArray<ScrollableLayerGuid>&& aTargets) override;
|
2015-03-19 13:33:33 +03:00
|
|
|
virtual bool RecvSetAllowedTouchBehavior(const uint64_t& aInputBlockId,
|
2015-03-21 19:28:04 +03:00
|
|
|
nsTArray<TouchBehaviorFlags>&& aTargets) override;
|
2015-03-25 01:00:52 +03:00
|
|
|
virtual bool RecvDispatchWheelEvent(const mozilla::WidgetWheelEvent& aEvent) override;
|
|
|
|
virtual bool RecvDispatchMouseEvent(const mozilla::WidgetMouseEvent& aEvent) override;
|
|
|
|
virtual bool RecvDispatchKeyboardEvent(const mozilla::WidgetKeyboardEvent& aEvent) override;
|
2014-02-24 00:19:43 +04:00
|
|
|
|
|
|
|
virtual PColorPickerParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPColorPickerParent(const nsString& aTitle, const nsString& aInitialColor) override;
|
|
|
|
virtual bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker) override;
|
2014-02-24 00:19:43 +04:00
|
|
|
|
2015-05-21 20:04:58 +03:00
|
|
|
virtual PDocAccessibleParent*
|
|
|
|
AllocPDocAccessibleParent(PDocAccessibleParent*, const uint64_t&) override;
|
|
|
|
virtual bool DeallocPDocAccessibleParent(PDocAccessibleParent*) override;
|
|
|
|
virtual bool
|
|
|
|
RecvPDocAccessibleConstructor(PDocAccessibleParent* aDoc,
|
|
|
|
PDocAccessibleParent* aParentDoc,
|
|
|
|
const uint64_t& aParentID) override;
|
|
|
|
|
2009-07-01 00:39:22 +04:00
|
|
|
void LoadURL(nsIURI* aURI);
|
2010-08-21 03:24:40 +04:00
|
|
|
// XXX/cjones: it's not clear what we gain by hiding these
|
|
|
|
// message-sending functions under a layer of indirection and
|
|
|
|
// eating the return values
|
2015-03-05 12:13:05 +03:00
|
|
|
void Show(const ScreenIntSize& size, bool aParentIsActive);
|
2015-03-31 23:39:02 +03:00
|
|
|
void UpdateDimensions(const nsIntRect& rect, const ScreenIntSize& size);
|
2012-07-20 10:48:27 +04:00
|
|
|
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
|
2014-05-23 18:36:50 +04:00
|
|
|
void UIResolutionChanged();
|
2015-04-22 17:58:33 +03:00
|
|
|
void ThemeChanged();
|
2015-02-20 02:53:30 +03:00
|
|
|
void RequestFlingSnap(const FrameMetrics::ViewID& aScrollId,
|
|
|
|
const mozilla::CSSPoint& aDestination);
|
2014-02-06 02:43:20 +04:00
|
|
|
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
|
2014-03-12 23:27:45 +04:00
|
|
|
void HandleDoubleTap(const CSSPoint& aPoint,
|
2015-03-03 00:38:07 +03:00
|
|
|
Modifiers aModifiers,
|
2014-02-07 21:13:50 +04:00
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-03-12 23:27:45 +04:00
|
|
|
void HandleSingleTap(const CSSPoint& aPoint,
|
2015-03-03 00:38:07 +03:00
|
|
|
Modifiers aModifiers,
|
2014-02-07 21:13:50 +04:00
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-03-12 23:27:45 +04:00
|
|
|
void HandleLongTap(const CSSPoint& aPoint,
|
2015-03-03 00:38:07 +03:00
|
|
|
Modifiers aModifiers,
|
2014-10-24 21:29:30 +04:00
|
|
|
const ScrollableLayerGuid& aGuid,
|
|
|
|
uint64_t aInputBlockId);
|
2014-04-15 21:39:20 +04:00
|
|
|
void NotifyAPZStateChange(ViewID aViewId,
|
|
|
|
APZStateChange aChange,
|
|
|
|
int aArg);
|
2015-03-22 10:42:26 +03:00
|
|
|
void NotifyMouseScrollTestEvent(const ViewID& aScrollId, const nsString& aEvent);
|
2015-06-19 15:25:41 +03:00
|
|
|
void NotifyFlushComplete();
|
2009-11-05 21:14:22 +03:00
|
|
|
void Activate();
|
2011-06-18 04:08:32 +04:00
|
|
|
void Deactivate();
|
2011-09-30 11:00:48 +04:00
|
|
|
|
2013-10-02 07:46:04 +04:00
|
|
|
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
|
2013-08-14 18:15:27 +04:00
|
|
|
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
|
2013-10-02 07:46:04 +04:00
|
|
|
mozilla::WidgetEvent* aEvent);
|
2015-02-17 05:41:48 +03:00
|
|
|
LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale();
|
2013-08-14 18:15:27 +04:00
|
|
|
|
2014-04-22 00:40:09 +04:00
|
|
|
virtual bool RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent,
|
2015-03-21 19:28:04 +03:00
|
|
|
MaybeNativeKeyBinding* aBindings) override;
|
2014-04-22 00:40:09 +04:00
|
|
|
|
2015-04-14 18:36:36 +03:00
|
|
|
virtual bool RecvSynthesizeNativeKeyEvent(const int32_t& aNativeKeyboardLayout,
|
|
|
|
const int32_t& aNativeKeyCode,
|
|
|
|
const uint32_t& aModifierFlags,
|
|
|
|
const nsString& aCharacters,
|
|
|
|
const nsString& aUnmodifiedCharacters,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvSynthesizeNativeMouseEvent(const LayoutDeviceIntPoint& aPoint,
|
|
|
|
const uint32_t& aNativeMessage,
|
|
|
|
const uint32_t& aModifierFlags,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvSynthesizeNativeMouseMove(const LayoutDeviceIntPoint& aPoint,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvSynthesizeNativeMouseScrollEvent(const LayoutDeviceIntPoint& aPoint,
|
|
|
|
const uint32_t& aNativeMessage,
|
|
|
|
const double& aDeltaX,
|
|
|
|
const double& aDeltaY,
|
|
|
|
const double& aDeltaZ,
|
|
|
|
const uint32_t& aModifierFlags,
|
|
|
|
const uint32_t& aAdditionalFlags,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvSynthesizeNativeTouchPoint(const uint32_t& aPointerId,
|
|
|
|
const TouchPointerState& aPointerState,
|
|
|
|
const nsIntPoint& aPointerScreenPoint,
|
|
|
|
const double& aPointerPressure,
|
|
|
|
const uint32_t& aPointerOrientation,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvSynthesizeNativeTouchTap(const nsIntPoint& aPointerScreenPoint,
|
|
|
|
const bool& aLongTap,
|
|
|
|
const uint64_t& aObserverId) override;
|
|
|
|
virtual bool RecvClearNativeTouchSequence(const uint64_t& aObserverId) override;
|
|
|
|
|
2009-11-05 21:21:09 +03:00
|
|
|
void SendMouseEvent(const nsAString& aType, float aX, float aY,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aButton, int32_t aClickCount,
|
|
|
|
int32_t aModifiers, bool aIgnoreRootScrollFrame);
|
|
|
|
void SendKeyEvent(const nsAString& aType, int32_t aKeyCode,
|
|
|
|
int32_t aCharCode, int32_t aModifiers,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aPreventDefault);
|
2013-10-02 10:38:27 +04:00
|
|
|
bool SendRealMouseEvent(mozilla::WidgetMouseEvent& event);
|
2015-04-08 21:48:11 +03:00
|
|
|
bool SendRealDragEvent(mozilla::WidgetDragEvent& aEvent, uint32_t aDragAction,
|
|
|
|
uint32_t aDropEffect);
|
2013-10-16 13:37:36 +04:00
|
|
|
bool SendMouseWheelEvent(mozilla::WidgetWheelEvent& event);
|
2013-10-01 11:22:58 +04:00
|
|
|
bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event);
|
2013-09-27 10:20:57 +04:00
|
|
|
bool SendRealTouchEvent(WidgetTouchEvent& event);
|
2015-03-03 00:41:02 +03:00
|
|
|
bool SendHandleSingleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
|
|
|
|
bool SendHandleLongTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid, const uint64_t& aInputBlockId);
|
|
|
|
bool SendHandleDoubleTap(const CSSPoint& aPoint, const Modifiers& aModifiers, const ScrollableLayerGuid& aGuid);
|
2009-10-29 20:58:31 +03:00
|
|
|
|
2010-10-27 02:20:53 +04:00
|
|
|
virtual PDocumentRendererParent*
|
2014-01-17 21:46:41 +04:00
|
|
|
AllocPDocumentRendererParent(const nsRect& documentRect,
|
|
|
|
const gfx::Matrix& transform,
|
2013-07-08 19:48:39 +04:00
|
|
|
const nsString& bgcolor,
|
2014-01-17 21:46:41 +04:00
|
|
|
const uint32_t& renderFlags,
|
|
|
|
const bool& flushLayout,
|
2015-03-21 19:28:04 +03:00
|
|
|
const nsIntSize& renderSize) override;
|
|
|
|
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) override;
|
2010-03-24 13:47:18 +03:00
|
|
|
|
2014-02-18 04:30:06 +04:00
|
|
|
virtual PFilePickerParent*
|
|
|
|
AllocPFilePickerParent(const nsString& aTitle,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int16_t& aMode) override;
|
|
|
|
virtual bool DeallocPFilePickerParent(PFilePickerParent* actor) override;
|
2014-02-18 04:30:06 +04:00
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
virtual PIndexedDBPermissionRequestParent*
|
|
|
|
AllocPIndexedDBPermissionRequestParent(const Principal& aPrincipal)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPIndexedDBPermissionRequestConstructor(
|
|
|
|
PIndexedDBPermissionRequestParent* aActor,
|
|
|
|
const Principal& aPrincipal)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
DeallocPIndexedDBPermissionRequestParent(
|
|
|
|
PIndexedDBPermissionRequestParent* aActor)
|
2015-03-21 19:28:04 +03:00
|
|
|
override;
|
2014-09-27 03:21:57 +04:00
|
|
|
|
2013-08-09 02:53:04 +04:00
|
|
|
bool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
|
2009-11-06 23:43:39 +03:00
|
|
|
|
2010-03-26 21:39:39 +03:00
|
|
|
NS_DECL_ISUPPORTS
|
2010-06-25 02:20:42 +04:00
|
|
|
NS_DECL_NSIAUTHPROMPTPROVIDER
|
2010-08-13 12:06:40 +04:00
|
|
|
NS_DECL_NSISECUREBROWSERUI
|
2015-08-06 00:25:39 +03:00
|
|
|
NS_DECL_NSIWEBBROWSERPERSISTABLE
|
2010-03-26 21:39:39 +03:00
|
|
|
|
2013-10-01 11:23:00 +04:00
|
|
|
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
|
2013-10-01 11:23:00 +04:00
|
|
|
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event);
|
2013-10-01 11:23:01 +04:00
|
|
|
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event);
|
2012-06-23 05:27:30 +04:00
|
|
|
|
|
|
|
static TabParent* GetFrom(nsFrameLoader* aFrameLoader);
|
2015-02-06 00:47:32 +03:00
|
|
|
static TabParent* GetFrom(nsIFrameLoader* aFrameLoader);
|
|
|
|
static TabParent* GetFrom(nsITabParent* aTabParent);
|
|
|
|
static TabParent* GetFrom(PBrowserParent* aTabParent);
|
2012-06-23 05:27:30 +04:00
|
|
|
static TabParent* GetFrom(nsIContent* aContent);
|
2014-10-29 21:11:00 +03:00
|
|
|
static TabId GetTabIdFrom(nsIDocShell* docshell);
|
2012-06-23 05:27:30 +04:00
|
|
|
|
2014-06-11 09:44:03 +04:00
|
|
|
nsIContentParent* Manager() { return mManager; }
|
2013-07-10 21:07:51 +04:00
|
|
|
|
2013-10-17 02:25:50 +04:00
|
|
|
/**
|
|
|
|
* Let managees query if Destroy() is already called so they don't send out
|
|
|
|
* messages when the PBrowser actor is being destroyed.
|
|
|
|
*/
|
|
|
|
bool IsDestroyed() const { return mIsDestroyed; }
|
|
|
|
|
2014-07-14 21:22:26 +04:00
|
|
|
already_AddRefed<nsIWidget> GetWidget() const;
|
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
const TabId GetTabId() const
|
|
|
|
{
|
|
|
|
return mTabId;
|
|
|
|
}
|
|
|
|
|
2015-02-15 21:52:28 +03:00
|
|
|
LayoutDeviceIntPoint GetChildProcessOffset();
|
2014-11-12 23:59:19 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Native widget remoting protocol for use with windowed plugins with e10s.
|
|
|
|
*/
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual PPluginWidgetParent* AllocPPluginWidgetParent() override;
|
|
|
|
virtual bool DeallocPPluginWidgetParent(PPluginWidgetParent* aActor) override;
|
2014-11-12 23:59:19 +03:00
|
|
|
|
2014-11-16 21:23:22 +03:00
|
|
|
void SetInitedByParent() { mInitedByParent = true; }
|
|
|
|
bool IsInitedByParent() const { return mInitedByParent; }
|
|
|
|
|
2015-01-16 21:07:50 +03:00
|
|
|
static TabParent* GetNextTabParent();
|
|
|
|
|
|
|
|
bool SendLoadRemoteScript(const nsString& aURL,
|
|
|
|
const bool& aRunInGlobalScope);
|
|
|
|
|
2015-02-27 08:30:44 +03:00
|
|
|
// See nsIFrameLoader requestNotifyLayerTreeReady.
|
|
|
|
bool RequestNotifyLayerTreeReady();
|
|
|
|
bool RequestNotifyLayerTreeCleared();
|
|
|
|
bool LayerTreeUpdate(bool aActive);
|
2015-04-14 03:06:03 +03:00
|
|
|
void SwapLayerTreeObservers(TabParent* aOther);
|
2015-02-27 08:30:44 +03:00
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
virtual bool
|
|
|
|
RecvInvokeDragSession(nsTArray<IPCDataTransfer>&& aTransfers,
|
|
|
|
const uint32_t& aAction,
|
|
|
|
const nsCString& aVisualDnDData,
|
|
|
|
const uint32_t& aWidth, const uint32_t& aHeight,
|
|
|
|
const uint32_t& aStride, const uint8_t& aFormat,
|
|
|
|
const int32_t& aDragAreaX, const int32_t& aDragAreaY) override;
|
|
|
|
|
|
|
|
void AddInitialDnDDataTo(DataTransfer* aDataTransfer);
|
|
|
|
|
|
|
|
void TakeDragVisualization(RefPtr<mozilla::gfx::SourceSurface>& aSurface,
|
|
|
|
int32_t& aDragAreaX, int32_t& aDragAreaY);
|
2015-06-09 13:20:41 +03:00
|
|
|
layout::RenderFrameParent* GetRenderFrame();
|
2015-08-06 00:25:39 +03:00
|
|
|
|
2015-08-06 17:44:16 +03:00
|
|
|
virtual PWebBrowserPersistDocumentParent* AllocPWebBrowserPersistDocumentParent(const uint64_t& aOuterWindowID) override;
|
2015-08-06 00:25:39 +03:00
|
|
|
virtual bool DeallocPWebBrowserPersistDocumentParent(PWebBrowserPersistDocumentParent* aActor) override;
|
|
|
|
|
2009-11-05 21:14:22 +03:00
|
|
|
protected:
|
2010-03-30 00:29:45 +04:00
|
|
|
bool ReceiveMessage(const nsString& aMessage,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aSync,
|
2015-09-10 23:50:58 +03:00
|
|
|
ipc::StructuredCloneData* aData,
|
2015-01-27 00:32:18 +03:00
|
|
|
mozilla::jsipc::CpowHolder* aCpows,
|
2013-11-06 21:21:15 +04:00
|
|
|
nsIPrincipal* aPrincipal,
|
2015-09-10 23:50:58 +03:00
|
|
|
nsTArray<ipc::StructuredCloneData>* aJSONRetVal = nullptr);
|
2010-03-30 00:29:45 +04:00
|
|
|
|
2014-06-11 09:44:36 +04:00
|
|
|
virtual bool RecvAsyncAuthPrompt(const nsCString& aUri,
|
|
|
|
const nsString& aRealm,
|
2015-03-21 19:28:04 +03:00
|
|
|
const uint64_t& aCallbackId) override;
|
2014-06-11 09:44:36 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool Recv__delete__() override;
|
2012-07-17 22:27:27 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) override;
|
2010-04-12 04:34:02 +04:00
|
|
|
|
2013-07-24 03:39:17 +04:00
|
|
|
Element* mFrameElement;
|
2010-01-01 04:35:55 +03:00
|
|
|
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
|
2010-03-26 21:39:39 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual PRenderFrameParent* AllocPRenderFrameParent() override;
|
|
|
|
virtual bool DeallocPRenderFrameParent(PRenderFrameParent* aFrame) override;
|
2010-08-21 03:24:41 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual bool RecvRemotePaintIsReady() override;
|
2014-05-23 22:19:00 +04:00
|
|
|
|
2014-11-16 21:23:22 +03:00
|
|
|
virtual bool RecvGetRenderFrameInfo(PRenderFrameParent* aRenderFrame,
|
|
|
|
TextureFactoryIdentifier* aTextureFactoryIdentifier,
|
2015-05-18 08:42:05 +03:00
|
|
|
uint64_t* aLayersId) override;
|
2014-11-16 21:23:22 +03:00
|
|
|
|
2015-01-13 03:41:53 +03:00
|
|
|
virtual bool RecvSetDimensions(const uint32_t& aFlags,
|
|
|
|
const int32_t& aX, const int32_t& aY,
|
2015-03-21 19:28:04 +03:00
|
|
|
const int32_t& aCx, const int32_t& aCy) override;
|
2015-01-13 03:41:53 +03:00
|
|
|
|
2015-07-10 19:38:44 +03:00
|
|
|
virtual bool RecvAudioChannelActivityNotification(const uint32_t& aAudioChannel,
|
|
|
|
const bool& aActive) override;
|
|
|
|
|
2015-04-24 02:41:00 +03:00
|
|
|
bool InitBrowserConfiguration(const nsCString& aURI,
|
2015-02-11 14:53:00 +03:00
|
|
|
BrowserConfiguration& aConfiguration);
|
|
|
|
|
2015-05-13 23:44:39 +03:00
|
|
|
void SetHasContentOpener(bool aHasContentOpener);
|
|
|
|
|
2015-06-26 02:21:13 +03:00
|
|
|
ContentCacheInParent mContentCache;
|
2010-09-24 07:28:15 +04:00
|
|
|
|
2014-08-08 21:23:50 +04:00
|
|
|
nsIntRect mRect;
|
2015-03-05 12:13:05 +03:00
|
|
|
ScreenIntSize mDimensions;
|
2015-08-19 00:55:09 +03:00
|
|
|
ScreenOrientationInternal mOrientation;
|
2010-12-09 21:57:05 +03:00
|
|
|
float mDPI;
|
2013-09-18 04:45:19 +04:00
|
|
|
CSSToLayoutDeviceScale mDefaultScale;
|
2013-01-29 11:49:38 +04:00
|
|
|
bool mUpdatedDimensions;
|
2015-04-21 17:33:56 +03:00
|
|
|
LayoutDeviceIntPoint mChromeOffset;
|
2010-12-09 21:57:05 +03:00
|
|
|
|
2010-08-06 02:11:23 +04:00
|
|
|
private:
|
2015-08-28 10:18:00 +03:00
|
|
|
void DestroyInternal();
|
2015-02-27 08:35:26 +03:00
|
|
|
already_AddRefed<nsFrameLoader> GetFrameLoader(bool aUseCachedFrameLoaderAfterDestroy = false) const;
|
2014-06-11 09:44:03 +04:00
|
|
|
nsRefPtr<nsIContentParent> mManager;
|
2013-05-02 03:06:19 +04:00
|
|
|
void TryCacheDPIAndScale();
|
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
|
|
|
|
2015-04-21 17:33:56 +03:00
|
|
|
nsresult UpdatePosition();
|
|
|
|
|
2014-03-12 23:27:45 +04:00
|
|
|
CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
|
2013-12-06 03:17:37 +04:00
|
|
|
|
2015-06-04 23:51:10 +03:00
|
|
|
bool AsyncPanZoomEnabled() const;
|
|
|
|
|
2015-09-04 16:42:01 +03:00
|
|
|
// Cached value indicating the docshell active state of the remote browser.
|
|
|
|
bool mDocShellIsActive;
|
|
|
|
|
2015-02-07 00:46:46 +03:00
|
|
|
// Update state prior to routing an APZ-aware event to the child process.
|
2014-03-11 01:59:46 +04:00
|
|
|
// |aOutTargetGuid| will contain the identifier
|
2015-05-14 15:16:00 +03:00
|
|
|
// of the APZC instance that handled the event. aOutTargetGuid may be null.
|
2014-10-24 21:29:30 +04:00
|
|
|
// |aOutInputBlockId| will contain the identifier of the input block
|
2015-05-14 15:16:00 +03:00
|
|
|
// that this event was added to, if there was one. aOutInputBlockId may be null.
|
|
|
|
// |aOutApzResponse| will contain the response that the APZ gave when processing
|
|
|
|
// the input block; this is used for generating appropriate pointercancel events.
|
2015-02-07 00:46:46 +03:00
|
|
|
void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
|
2015-05-14 15:16:00 +03:00
|
|
|
uint64_t* aOutInputBlockId,
|
|
|
|
nsEventStatus* aOutApzResponse);
|
|
|
|
// When true, we've initiated normal shutdown and notified our managing PContent.
|
2013-01-10 17:22:14 +04:00
|
|
|
bool mMarkedDestroying;
|
2015-05-14 15:16:00 +03:00
|
|
|
// When true, the TabParent is invalid and we should not send IPC messages anymore.
|
2012-11-10 10:09:24 +04:00
|
|
|
bool mIsDestroyed;
|
2015-08-31 13:21:40 +03:00
|
|
|
// When true, the TabParent is detached from the frame loader.
|
|
|
|
bool mIsDetached;
|
2013-02-16 02:27:21 +04:00
|
|
|
// Whether we have already sent a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorSent;
|
2014-01-11 05:10:57 +04:00
|
|
|
|
2014-08-23 03:17:18 +04:00
|
|
|
// Whether we need to send the offline status to the TabChild
|
|
|
|
// This is true, until the first call of LoadURL
|
|
|
|
bool mSendOfflineStatus;
|
|
|
|
|
2014-01-11 05:10:57 +04:00
|
|
|
uint32_t mChromeFlags;
|
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
struct DataTransferItem
|
|
|
|
{
|
|
|
|
nsCString mFlavor;
|
|
|
|
nsString mStringData;
|
2015-05-12 15:11:03 +03:00
|
|
|
nsRefPtr<mozilla::dom::BlobImpl> mBlobData;
|
2015-04-08 21:48:11 +03:00
|
|
|
enum DataType
|
|
|
|
{
|
|
|
|
eString,
|
|
|
|
eBlob
|
|
|
|
};
|
|
|
|
DataType mType;
|
|
|
|
};
|
|
|
|
nsTArray<nsTArray<DataTransferItem>> mInitialDataTransferItems;
|
|
|
|
|
|
|
|
mozilla::RefPtr<gfx::DataSourceSurface> mDnDVisualization;
|
|
|
|
int32_t mDragAreaX;
|
|
|
|
int32_t mDragAreaY;
|
|
|
|
|
2014-11-16 21:23:22 +03:00
|
|
|
// When true, the TabParent is initialized without child side's request.
|
|
|
|
// When false, the TabParent is initialized by window.open() from child side.
|
|
|
|
bool mInitedByParent;
|
|
|
|
|
2014-01-11 05:10:57 +04:00
|
|
|
nsCOMPtr<nsILoadContext> mLoadContext;
|
2014-10-29 21:11:00 +03:00
|
|
|
|
2015-02-27 08:35:26 +03:00
|
|
|
// We keep a strong reference to the frameloader after we've sent the
|
|
|
|
// Destroy message and before we've received __delete__. This allows us to
|
|
|
|
// dispatch message manager messages during this time.
|
|
|
|
nsRefPtr<nsFrameLoader> mFrameLoader;
|
|
|
|
|
2014-10-29 21:11:00 +03:00
|
|
|
TabId mTabId;
|
2014-12-19 02:23:39 +03:00
|
|
|
|
2015-01-16 21:07:50 +03:00
|
|
|
// Helper class for RecvCreateWindow.
|
|
|
|
struct AutoUseNewTab;
|
|
|
|
|
|
|
|
// When loading a new tab or window via window.open, the child process sends
|
|
|
|
// a new PBrowser to use. We store that tab in sNextTabParent and then
|
|
|
|
// proceed through the browser's normal paths to create a new
|
|
|
|
// window/tab. When it comes time to create a new TabParent, we instead use
|
|
|
|
// sNextTabParent.
|
|
|
|
static TabParent* sNextTabParent;
|
|
|
|
|
|
|
|
// When loading a new tab or window via window.open, the child is
|
2015-01-23 07:00:18 +03:00
|
|
|
// responsible for loading the URL it wants into the new TabChild. When the
|
|
|
|
// parent receives the CreateWindow message, though, it sends a LoadURL
|
|
|
|
// message, usually for about:blank. It's important for the about:blank load
|
|
|
|
// to get processed because the Firefox frontend expects every new window to
|
|
|
|
// immediately start loading something (see bug 1123090). However, we want
|
|
|
|
// the child to process the LoadURL message before it returns from
|
|
|
|
// ProvideWindow so that the URL sent from the parent doesn't override the
|
|
|
|
// child's URL. This is not possible using our IPC mechanisms. To solve the
|
|
|
|
// problem, we skip sending the LoadURL message in the parent and instead
|
|
|
|
// return the URL as a result from CreateWindow. The child simulates
|
|
|
|
// receiving a LoadURL message before returning from ProvideWindow.
|
|
|
|
//
|
|
|
|
// The mCreatingWindow flag is set while dispatching CreateWindow. During
|
|
|
|
// that time, any LoadURL calls are skipped and the URL is stored in
|
|
|
|
// mSkippedURL.
|
|
|
|
bool mCreatingWindow;
|
|
|
|
nsCString mDelayedURL;
|
2015-01-16 21:07:50 +03:00
|
|
|
|
|
|
|
// When loading a new tab or window via window.open, we want to ensure that
|
|
|
|
// frame scripts for that tab are loaded before any scripts start to run in
|
|
|
|
// the window. We can't load the frame scripts the normal way, using
|
|
|
|
// separate IPC messages, since they won't be processed by the child until
|
|
|
|
// returning to the event loop, which is too late. Instead, we queue up
|
|
|
|
// frame scripts that we intend to load and send them as part of the
|
|
|
|
// CreateWindow response. Then TabChild loads them immediately.
|
|
|
|
nsTArray<FrameScriptInfo> mDelayedFrameScripts;
|
|
|
|
|
2015-03-11 01:21:02 +03:00
|
|
|
// If the user called RequestNotifyLayerTreeReady and the RenderFrameParent
|
|
|
|
// wasn't ready yet, we set this flag and call RequestNotifyLayerTreeReady
|
|
|
|
// again once the RenderFrameParent arrives.
|
|
|
|
bool mNeedLayerTreeReadyNotification;
|
|
|
|
|
2015-04-15 02:29:10 +03:00
|
|
|
// Cached cursor setting from TabChild. When the cursor is over the tab,
|
|
|
|
// it should take this appearance.
|
|
|
|
nsCursor mCursor;
|
2015-05-20 04:28:57 +03:00
|
|
|
nsCOMPtr<imgIContainer> mCustomCursor;
|
|
|
|
uint32_t mCustomCursorHotspotX, mCustomCursorHotspotY;
|
2015-04-15 02:29:10 +03:00
|
|
|
|
|
|
|
// True if the cursor changes from the TabChild should change the widget
|
|
|
|
// cursor. This happens whenever the cursor is in the tab's region.
|
|
|
|
bool mTabSetsCursor;
|
|
|
|
|
2015-04-21 17:33:56 +03:00
|
|
|
nsRefPtr<nsIPresShell> mPresShellWithRefreshListener;
|
|
|
|
|
2015-05-13 23:44:39 +03:00
|
|
|
bool mHasContentOpener;
|
2015-08-20 00:08:41 +03:00
|
|
|
|
|
|
|
DebugOnly<int32_t> mActiveSupressDisplayportCount;
|
2014-12-19 02:23:39 +03:00
|
|
|
private:
|
|
|
|
// This is used when APZ needs to find the TabParent associated with a layer
|
|
|
|
// to dispatch events.
|
|
|
|
typedef nsDataHashtable<nsUint64HashKey, TabParent*> LayerToTabParentTable;
|
|
|
|
static LayerToTabParentTable* sLayerToTabParentTable;
|
|
|
|
|
|
|
|
static void AddTabParentToTable(uint64_t aLayersId, TabParent* aTabParent);
|
|
|
|
static void RemoveTabParentFromTable(uint64_t aLayersId);
|
|
|
|
|
|
|
|
public:
|
|
|
|
static TabParent* GetTabParentFromLayersId(uint64_t aLayersId);
|
2009-07-01 00:39:22 +04:00
|
|
|
};
|
|
|
|
|
2009-08-12 20:18:08 +04:00
|
|
|
} // namespace dom
|
2009-07-01 00:39:22 +04:00
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|