2009-08-18 19:05:15 +00: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 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
|
|
|
|
|
|
|
#ifndef mozilla_tabs_TabParent_h
|
|
|
|
#define mozilla_tabs_TabParent_h
|
|
|
|
|
2013-10-22 13:27:35 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2010-07-19 18:33:33 +00:00
|
|
|
#include "mozilla/dom/PBrowserParent.h"
|
2014-02-18 00:30:06 +00: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 18:32:37 +00:00
|
|
|
#include "mozilla/dom/TabContext.h"
|
2010-01-01 01:35:55 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2012-06-23 01:27:30 +00:00
|
|
|
#include "nsIAuthPromptProvider.h"
|
2010-01-01 01:35:55 +00:00
|
|
|
#include "nsIBrowserDOMWindow.h"
|
2010-08-13 08:06:40 +00:00
|
|
|
#include "nsISecureBrowserUI.h"
|
2012-06-23 01:27:30 +00:00
|
|
|
#include "nsITabParent.h"
|
2014-01-22 20:27:23 +00:00
|
|
|
#include "nsIXULBrowserWindow.h"
|
2013-07-11 14:43:35 +00:00
|
|
|
#include "Units.h"
|
2013-08-28 02:59:14 +00:00
|
|
|
#include "js/TypeDecls.h"
|
2010-01-01 01:35:55 +00:00
|
|
|
|
2012-06-23 01:27:30 +00:00
|
|
|
class nsFrameLoader;
|
2013-10-18 20:57:55 +00:00
|
|
|
class nsIContent;
|
2013-11-06 17:21:15 +00:00
|
|
|
class nsIPrincipal;
|
2012-06-23 01:27:30 +00:00
|
|
|
class nsIURI;
|
2013-10-18 20:57:55 +00:00
|
|
|
class nsIWidget;
|
2014-01-11 01:10:57 +00:00
|
|
|
class nsILoadContext;
|
2013-07-10 22:05:39 +00:00
|
|
|
class CpowHolder;
|
2009-11-06 20:43:39 +00:00
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
namespace mozilla {
|
2012-07-20 06:48:27 +00: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 09:20:52 +00:00
|
|
|
struct TextureFactoryIdentifier;
|
2012-07-20 06:48:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
namespace layout {
|
|
|
|
class RenderFrameParent;
|
|
|
|
}
|
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
namespace dom {
|
2009-06-30 20:39:22 +00:00
|
|
|
|
2012-08-02 06:02:29 +00:00
|
|
|
class ClonedMessageData;
|
2013-09-23 21:30:40 +00:00
|
|
|
class ContentParent;
|
2013-07-23 23:39:17 +00:00
|
|
|
class Element;
|
2012-08-02 06:02:29 +00:00
|
|
|
struct StructuredCloneData;
|
|
|
|
|
2010-07-19 18:33:33 +00:00
|
|
|
class TabParent : public PBrowserParent
|
2010-06-24 22:20:42 +00:00
|
|
|
, public nsITabParent
|
|
|
|
, public nsIAuthPromptProvider
|
2010-08-13 08:06:40 +00:00
|
|
|
, public nsISecureBrowserUI
|
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
|
|
|
, public TabContext
|
2009-06-30 20:39:22 +00:00
|
|
|
{
|
2012-08-02 06:02:29 +00:00
|
|
|
typedef mozilla::dom::ClonedMessageData ClonedMessageData;
|
2012-11-27 20:43:52 +00:00
|
|
|
typedef mozilla::layout::ScrollingBehavior ScrollingBehavior;
|
2012-08-02 06:02:29 +00:00
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
public:
|
2014-01-24 09:02:23 +00:00
|
|
|
// nsITabParent
|
|
|
|
NS_DECL_NSITABPARENT
|
|
|
|
|
2014-01-11 01:10:57 +00:00
|
|
|
TabParent(ContentParent* aManager, const TabContext& aContext, uint32_t aChromeFlags);
|
2009-06-30 20:39:22 +00:00
|
|
|
virtual ~TabParent();
|
2013-07-23 23:39:17 +00:00
|
|
|
Element* GetOwnerElement() const { return mFrameElement; }
|
|
|
|
void SetOwnerElement(Element* aElement);
|
2013-04-26 00:53:26 +00: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 03:19:24 +00:00
|
|
|
nsIBrowserDOMWindow *GetBrowserDOMWindow() { return mBrowserDOMWindow; }
|
2010-01-01 01:35:55 +00:00
|
|
|
void SetBrowserDOMWindow(nsIBrowserDOMWindow* aBrowserDOMWindow) {
|
|
|
|
mBrowserDOMWindow = aBrowserDOMWindow;
|
|
|
|
}
|
2012-08-09 02:58:06 +00:00
|
|
|
|
2014-01-11 01:10:57 +00:00
|
|
|
already_AddRefed<nsILoadContext> GetLoadContext();
|
|
|
|
|
2014-01-22 20:27:23 +00:00
|
|
|
nsIXULBrowserWindow* GetXULBrowserWindow();
|
|
|
|
|
2012-09-11 20:05:52 +00:00
|
|
|
/**
|
|
|
|
* Return the TabParent that has decided it wants to capture an
|
|
|
|
* event series for fast-path dispatch to its subprocess, if one
|
|
|
|
* has.
|
|
|
|
*
|
|
|
|
* DOM event dispatch and widget are free to ignore capture
|
|
|
|
* requests from TabParents; the end result wrt remote content is
|
|
|
|
* (must be) always the same, albeit usually slower without
|
|
|
|
* subprocess capturing. This allows frontends/widget backends to
|
|
|
|
* "opt in" to faster cross-process dispatch.
|
|
|
|
*/
|
|
|
|
static TabParent* GetEventCapturer();
|
|
|
|
/**
|
|
|
|
* If this is the current event capturer, give this a chance to
|
|
|
|
* capture the event. If it was captured, return true, false
|
|
|
|
* otherwise. Un-captured events should follow normal DOM
|
|
|
|
* dispatch; captured events should result in no further
|
|
|
|
* processing from the caller of TryCapture().
|
|
|
|
*
|
|
|
|
* It's an error to call TryCapture() if this isn't the event
|
|
|
|
* capturer.
|
|
|
|
*/
|
2013-10-02 03:46:03 +00:00
|
|
|
bool TryCapture(const WidgetGUIEvent& aEvent);
|
2012-09-11 20:05:52 +00:00
|
|
|
|
2011-01-06 04:54:47 +00:00
|
|
|
void Destroy();
|
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvMoveFocus(const bool& aForward) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvEvent(const RemoteDOMEvent& aEvent) MOZ_OVERRIDE;
|
2014-03-18 15:16:47 +00:00
|
|
|
virtual bool RecvReplyKeyEvent(const WidgetKeyboardEvent& event);
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor) MOZ_OVERRIDE;
|
2014-01-15 21:10:39 +00:00
|
|
|
virtual bool RecvInitRenderFrame(PRenderFrameParent* aFrame,
|
|
|
|
ScrollingBehavior* scrolling,
|
|
|
|
TextureFactoryIdentifier* identifier,
|
|
|
|
uint64_t* layersId,
|
2014-01-17 17:46:41 +00:00
|
|
|
bool *aSuccess) MOZ_OVERRIDE;
|
2012-06-12 22:01:25 +00:00
|
|
|
virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
|
|
|
|
const nsString& aURL,
|
|
|
|
const nsString& aName,
|
|
|
|
const nsString& aFeatures,
|
2014-01-17 17:46:41 +00:00
|
|
|
bool* aOutWindowOpened) MOZ_OVERRIDE;
|
|
|
|
virtual bool AnswerCreateWindow(PBrowserParent** retval) MOZ_OVERRIDE;
|
2010-07-19 18:33:33 +00:00
|
|
|
virtual bool RecvSyncMessage(const nsString& aMessage,
|
2012-08-02 06:02:29 +00:00
|
|
|
const ClonedMessageData& aData,
|
2013-07-10 22:05:39 +00:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2013-11-06 17:21:15 +00:00
|
|
|
const IPC::Principal& aPrincipal,
|
2014-01-17 17:46:41 +00:00
|
|
|
InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
|
2013-10-01 16:15:06 +00:00
|
|
|
virtual bool AnswerRpcMessage(const nsString& aMessage,
|
|
|
|
const ClonedMessageData& aData,
|
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2013-11-06 17:21:15 +00:00
|
|
|
const IPC::Principal& aPrincipal,
|
2014-01-17 17:46:41 +00:00
|
|
|
InfallibleTArray<nsString>* aJSONRetVal) MOZ_OVERRIDE;
|
2010-07-19 18:33:33 +00:00
|
|
|
virtual bool RecvAsyncMessage(const nsString& aMessage,
|
2013-07-10 22:05:39 +00:00
|
|
|
const ClonedMessageData& aData,
|
2013-11-06 17:21:15 +00:00
|
|
|
const InfallibleTArray<CpowEntry>& aCpows,
|
2014-01-17 17:46:41 +00:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool RecvNotifyIMEFocus(const bool& aFocus,
|
2010-10-01 14:17:37 +00:00
|
|
|
nsIMEUpdatePreference* aPreference,
|
2014-01-17 17:46:41 +00:00
|
|
|
uint32_t* aSeqno) MOZ_OVERRIDE;
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool RecvNotifyIMETextChange(const uint32_t& aStart,
|
|
|
|
const uint32_t& aEnd,
|
2014-02-26 00:48:02 +00:00
|
|
|
const uint32_t& aNewEnd,
|
|
|
|
const bool& aCausedByComposition) MOZ_OVERRIDE;
|
2013-11-07 00:11:11 +00:00
|
|
|
virtual bool RecvNotifyIMESelectedCompositionRect(const uint32_t& aOffset,
|
2014-01-16 10:04:39 +00:00
|
|
|
const nsIntRect& aRect,
|
|
|
|
const nsIntRect& aCaretRect) MOZ_OVERRIDE;
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool RecvNotifyIMESelection(const uint32_t& aSeqno,
|
|
|
|
const uint32_t& aAnchor,
|
2014-02-26 00:48:02 +00:00
|
|
|
const uint32_t& aFocus,
|
|
|
|
const bool& aCausedByComposition) MOZ_OVERRIDE;
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvNotifyIMETextHint(const nsString& aText) MOZ_OVERRIDE;
|
2011-09-29 06:19:26 +00:00
|
|
|
virtual bool RecvEndIMEComposition(const bool& aCancel,
|
2014-01-17 17:46:41 +00:00
|
|
|
nsString* aComposition) MOZ_OVERRIDE;
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool RecvGetInputContext(int32_t* aIMEEnabled,
|
2012-10-26 23:35:20 +00:00
|
|
|
int32_t* aIMEOpen,
|
2014-01-17 17:46:41 +00:00
|
|
|
intptr_t* aNativeIMEContext) MOZ_OVERRIDE;
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual bool RecvSetInputContext(const int32_t& aIMEEnabled,
|
|
|
|
const int32_t& aIMEOpen,
|
2011-11-27 11:51:52 +00:00
|
|
|
const nsString& aType,
|
2012-08-27 02:16:22 +00:00
|
|
|
const nsString& aInputmode,
|
2011-11-27 11:51:52 +00:00
|
|
|
const nsString& aActionHint,
|
2012-08-22 15:56:38 +00:00
|
|
|
const int32_t& aCause,
|
2014-01-17 17:46:41 +00:00
|
|
|
const int32_t& aFocusChange) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvRequestFocus(const bool& aCanRaise) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSetCursor(const uint32_t& aValue) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSetBackgroundColor(const nscolor& aValue) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvSetStatus(const uint32_t& aType, const nsString& aStatus) MOZ_OVERRIDE;
|
2014-01-22 20:27:23 +00:00
|
|
|
virtual bool RecvShowTooltip(const uint32_t& aX, const uint32_t& aY, const nsString& aTooltip);
|
|
|
|
virtual bool RecvHideTooltip();
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvGetDPI(float* aValue) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetDefaultScale(double* aValue) MOZ_OVERRIDE;
|
|
|
|
virtual bool RecvGetWidgetNativeData(WindowsHandle* aValue) MOZ_OVERRIDE;
|
2013-11-13 18:20:30 +00:00
|
|
|
virtual bool RecvZoomToRect(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2014-01-17 17:46:41 +00:00
|
|
|
const CSSRect& aRect) MOZ_OVERRIDE;
|
2013-11-14 17:35:41 +00:00
|
|
|
virtual bool RecvUpdateZoomConstraints(const uint32_t& aPresShellId,
|
|
|
|
const ViewID& aViewId,
|
2013-11-09 00:07:00 +00:00
|
|
|
const bool& aIsRoot,
|
2014-01-17 17:46:41 +00:00
|
|
|
const ZoomConstraints& aConstraints) MOZ_OVERRIDE;
|
2013-11-13 18:20:31 +00:00
|
|
|
virtual bool RecvContentReceivedTouch(const ScrollableLayerGuid& aGuid,
|
2014-01-17 17:46:41 +00:00
|
|
|
const bool& aPreventDefault) MOZ_OVERRIDE;
|
2014-02-23 20:19:43 +00:00
|
|
|
|
|
|
|
virtual PColorPickerParent*
|
|
|
|
AllocPColorPickerParent(const nsString& aTitle, const nsString& aInitialColor) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPColorPickerParent(PColorPickerParent* aColorPicker) MOZ_OVERRIDE;
|
|
|
|
|
2009-06-30 20:39:22 +00:00
|
|
|
void LoadURL(nsIURI* aURI);
|
2010-08-20 23:24:40 +00: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
|
|
|
|
void Show(const nsIntSize& size);
|
2011-07-15 21:46:56 +00:00
|
|
|
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
|
2012-07-20 06:48:27 +00:00
|
|
|
void UpdateFrame(const layers::FrameMetrics& aFrameMetrics);
|
2014-02-05 22:43:20 +00:00
|
|
|
void AcknowledgeScrollUpdate(const ViewID& aScrollId, const uint32_t& aScrollGeneration);
|
2014-03-12 19:27:45 +00:00
|
|
|
void HandleDoubleTap(const CSSPoint& aPoint,
|
2014-02-07 17:13:50 +00:00
|
|
|
int32_t aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-03-12 19:27:45 +00:00
|
|
|
void HandleSingleTap(const CSSPoint& aPoint,
|
2014-02-07 17:13:50 +00:00
|
|
|
int32_t aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-03-12 19:27:45 +00:00
|
|
|
void HandleLongTap(const CSSPoint& aPoint,
|
2014-02-07 17:13:50 +00:00
|
|
|
int32_t aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
2014-03-12 19:27:45 +00:00
|
|
|
void HandleLongTapUp(const CSSPoint& aPoint,
|
2014-02-07 17:13:50 +00:00
|
|
|
int32_t aModifiers,
|
|
|
|
const ScrollableLayerGuid& aGuid);
|
2013-12-10 03:14:55 +00:00
|
|
|
void NotifyTransformBegin(ViewID aViewId);
|
|
|
|
void NotifyTransformEnd(ViewID aViewId);
|
2009-11-05 18:14:22 +00:00
|
|
|
void Activate();
|
2011-06-18 00:08:32 +00:00
|
|
|
void Deactivate();
|
2011-09-30 07:00:48 +00:00
|
|
|
|
2013-10-02 03:46:04 +00:00
|
|
|
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
|
2013-08-14 14:15:27 +00:00
|
|
|
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
|
2013-10-02 03:46:04 +00:00
|
|
|
mozilla::WidgetEvent* aEvent);
|
2013-08-14 14:15:27 +00:00
|
|
|
|
2009-11-05 18:21:09 +00:00
|
|
|
void SendMouseEvent(const nsAString& aType, float aX, float aY,
|
2012-08-22 15:56:38 +00: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 06:19:26 +00:00
|
|
|
bool aPreventDefault);
|
2013-10-02 06:38:27 +00:00
|
|
|
bool SendRealMouseEvent(mozilla::WidgetMouseEvent& event);
|
2013-10-16 09:37:36 +00:00
|
|
|
bool SendMouseWheelEvent(mozilla::WidgetWheelEvent& event);
|
2013-10-01 07:22:58 +00:00
|
|
|
bool SendRealKeyEvent(mozilla::WidgetKeyboardEvent& event);
|
2013-09-27 06:20:57 +00:00
|
|
|
bool SendRealTouchEvent(WidgetTouchEvent& event);
|
2014-03-12 19:27:45 +00:00
|
|
|
bool SendHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
|
|
|
bool SendHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
|
|
|
bool SendHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
|
|
|
bool SendHandleDoubleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid);
|
2009-10-29 17:58:31 +00:00
|
|
|
|
2010-10-26 22:20:53 +00:00
|
|
|
virtual PDocumentRendererParent*
|
2014-01-17 17:46:41 +00:00
|
|
|
AllocPDocumentRendererParent(const nsRect& documentRect,
|
|
|
|
const gfx::Matrix& transform,
|
2013-07-08 15:48:39 +00:00
|
|
|
const nsString& bgcolor,
|
2014-01-17 17:46:41 +00:00
|
|
|
const uint32_t& renderFlags,
|
|
|
|
const bool& flushLayout,
|
|
|
|
const nsIntSize& renderSize) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPDocumentRendererParent(PDocumentRendererParent* actor) MOZ_OVERRIDE;
|
2010-03-24 10:47:18 +00:00
|
|
|
|
2012-07-30 14:58:26 +00:00
|
|
|
virtual PContentPermissionRequestParent*
|
2014-02-09 20:34:40 +00:00
|
|
|
AllocPContentPermissionRequestParent(const InfallibleTArray<PermissionRequest>& aRequests,
|
2014-01-17 17:46:41 +00:00
|
|
|
const IPC::Principal& aPrincipal) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
DeallocPContentPermissionRequestParent(PContentPermissionRequestParent* actor) MOZ_OVERRIDE;
|
2010-05-13 17:44:51 +00:00
|
|
|
|
2014-02-18 00:30:06 +00:00
|
|
|
virtual PFilePickerParent*
|
|
|
|
AllocPFilePickerParent(const nsString& aTitle,
|
|
|
|
const int16_t& aMode) MOZ_OVERRIDE;
|
|
|
|
virtual bool DeallocPFilePickerParent(PFilePickerParent* actor) MOZ_OVERRIDE;
|
|
|
|
|
2014-01-15 20:20:33 +00:00
|
|
|
virtual POfflineCacheUpdateParent*
|
|
|
|
AllocPOfflineCacheUpdateParent(const URIParams& aManifestURI,
|
|
|
|
const URIParams& aDocumentURI,
|
|
|
|
const bool& aStickDocument) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
|
|
|
RecvPOfflineCacheUpdateConstructor(POfflineCacheUpdateParent* aActor,
|
|
|
|
const URIParams& aManifestURI,
|
|
|
|
const URIParams& aDocumentURI,
|
|
|
|
const bool& stickDocument) MOZ_OVERRIDE;
|
|
|
|
virtual bool
|
2014-01-17 17:46:41 +00:00
|
|
|
DeallocPOfflineCacheUpdateParent(POfflineCacheUpdateParent* aActor) MOZ_OVERRIDE;
|
2014-01-15 20:20:33 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool RecvSetOfflinePermission(const IPC::Principal& principal) MOZ_OVERRIDE;
|
2010-10-20 17:12:32 +00:00
|
|
|
|
2013-08-08 22:53:04 +00:00
|
|
|
bool GetGlobalJSObject(JSContext* cx, JSObject** globalp);
|
2009-11-06 20:43:39 +00:00
|
|
|
|
2010-03-26 18:39:39 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
2010-06-24 22:20:42 +00:00
|
|
|
NS_DECL_NSIAUTHPROMPTPROVIDER
|
2010-08-13 08:06:40 +00:00
|
|
|
NS_DECL_NSISECUREBROWSERUI
|
2010-03-26 18:39:39 +00:00
|
|
|
|
2010-09-24 03:28:15 +00:00
|
|
|
static TabParent *GetIMETabParent() { return mIMETabParent; }
|
2013-10-01 07:23:00 +00:00
|
|
|
bool HandleQueryContentEvent(mozilla::WidgetQueryContentEvent& aEvent);
|
2013-10-01 07:23:00 +00:00
|
|
|
bool SendCompositionEvent(mozilla::WidgetCompositionEvent& event);
|
2013-10-01 07:22:59 +00:00
|
|
|
bool SendTextEvent(mozilla::WidgetTextEvent& event);
|
2013-10-01 07:23:01 +00:00
|
|
|
bool SendSelectionEvent(mozilla::WidgetSelectionEvent& event);
|
2012-06-23 01:27:30 +00:00
|
|
|
|
|
|
|
static TabParent* GetFrom(nsFrameLoader* aFrameLoader);
|
|
|
|
static TabParent* GetFrom(nsIContent* aContent);
|
|
|
|
|
2013-07-10 17:07:51 +00:00
|
|
|
ContentParent* Manager() { return mManager; }
|
|
|
|
|
2013-10-16 22:25:50 +00: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; }
|
|
|
|
|
2009-11-05 18:14:22 +00:00
|
|
|
protected:
|
2010-03-29 20:29:45 +00:00
|
|
|
bool ReceiveMessage(const nsString& aMessage,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aSync,
|
2012-08-02 06:02:29 +00:00
|
|
|
const StructuredCloneData* aCloneData,
|
2013-07-10 22:05:39 +00:00
|
|
|
CpowHolder* aCpows,
|
2013-11-06 17:21:15 +00:00
|
|
|
nsIPrincipal* aPrincipal,
|
2012-07-30 14:20:58 +00:00
|
|
|
InfallibleTArray<nsString>* aJSONRetVal = nullptr);
|
2010-03-29 20:29:45 +00:00
|
|
|
|
2012-07-17 18:27:27 +00:00
|
|
|
virtual bool Recv__delete__() MOZ_OVERRIDE;
|
|
|
|
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE;
|
2010-04-12 00:34:02 +00:00
|
|
|
|
2013-09-11 04:18:36 +00:00
|
|
|
virtual PIndexedDBParent* AllocPIndexedDBParent(
|
|
|
|
const nsCString& aGroup,
|
|
|
|
const nsCString& aASCIIOrigin,
|
2014-01-17 17:46:41 +00:00
|
|
|
bool* /* aAllowed */) MOZ_OVERRIDE;
|
2012-06-01 17:21:12 +00:00
|
|
|
|
2014-01-17 17:46:41 +00:00
|
|
|
virtual bool DeallocPIndexedDBParent(PIndexedDBParent* aActor) MOZ_OVERRIDE;
|
2012-06-01 17:21:12 +00:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPIndexedDBConstructor(PIndexedDBParent* aActor,
|
2013-09-11 04:18:36 +00:00
|
|
|
const nsCString& aGroup,
|
2012-06-01 17:21:12 +00:00
|
|
|
const nsCString& aASCIIOrigin,
|
2014-01-17 17:46:41 +00:00
|
|
|
bool* aAllowed) MOZ_OVERRIDE;
|
2012-06-01 17:21:12 +00:00
|
|
|
|
2013-07-23 23:39:17 +00:00
|
|
|
Element* mFrameElement;
|
2010-01-01 01:35:55 +00:00
|
|
|
nsCOMPtr<nsIBrowserDOMWindow> mBrowserDOMWindow;
|
2010-03-26 18:39:39 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool AllowContentIME();
|
2013-11-22 02:58:20 +00:00
|
|
|
nsIntPoint GetChildProcessOffset();
|
2010-08-05 22:11:23 +00:00
|
|
|
|
2014-01-15 21:10:39 +00:00
|
|
|
virtual PRenderFrameParent* AllocPRenderFrameParent() MOZ_OVERRIDE;
|
2013-07-08 15:48:39 +00:00
|
|
|
virtual bool DeallocPRenderFrameParent(PRenderFrameParent* aFrame) MOZ_OVERRIDE;
|
2010-08-20 23:24:41 +00:00
|
|
|
|
2010-09-24 03:28:15 +00:00
|
|
|
// IME
|
2010-09-24 03:28:15 +00:00
|
|
|
static TabParent *mIMETabParent;
|
2010-09-24 03:28:15 +00:00
|
|
|
nsString mIMECacheText;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mIMESelectionAnchor;
|
|
|
|
uint32_t mIMESelectionFocus;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIMEComposing;
|
|
|
|
bool mIMECompositionEnding;
|
2010-09-24 03:28:15 +00:00
|
|
|
// Buffer to store composition text during ResetInputState
|
|
|
|
// Compositions in almost all cases are small enough for nsAutoString
|
|
|
|
nsAutoString mIMECompositionText;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mIMECompositionStart;
|
|
|
|
uint32_t mIMESeqno;
|
2010-09-24 03:28:15 +00:00
|
|
|
|
2013-11-22 02:58:20 +00:00
|
|
|
uint32_t mIMECompositionRectOffset;
|
|
|
|
nsIntRect mIMECompositionRect;
|
2014-01-16 10:04:39 +00:00
|
|
|
nsIntRect mIMECaretRect;
|
2013-11-22 02:58:20 +00:00
|
|
|
|
2012-09-11 20:05:52 +00:00
|
|
|
// The number of event series we're currently capturing.
|
|
|
|
int32_t mEventCaptureDepth;
|
|
|
|
|
2013-01-29 07:49:38 +00:00
|
|
|
nsRect mRect;
|
2012-09-29 02:16:36 +00:00
|
|
|
nsIntSize mDimensions;
|
2013-01-29 07:49:38 +00:00
|
|
|
ScreenOrientation mOrientation;
|
2010-12-09 18:57:05 +00:00
|
|
|
float mDPI;
|
2013-09-18 00:45:19 +00:00
|
|
|
CSSToLayoutDeviceScale mDefaultScale;
|
2012-04-25 16:35:58 +00:00
|
|
|
bool mShown;
|
2013-01-29 07:49:38 +00:00
|
|
|
bool mUpdatedDimensions;
|
2010-12-09 18:57:05 +00:00
|
|
|
|
2010-08-05 22:11:23 +00:00
|
|
|
private:
|
|
|
|
already_AddRefed<nsFrameLoader> GetFrameLoader() const;
|
2010-09-24 03:28:15 +00:00
|
|
|
already_AddRefed<nsIWidget> GetWidget() const;
|
2012-07-20 06:48:27 +00:00
|
|
|
layout::RenderFrameParent* GetRenderFrame();
|
2013-07-10 17:07:51 +00:00
|
|
|
nsRefPtr<ContentParent> mManager;
|
2013-05-01 23:06:19 +00: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 18:32:37 +00:00
|
|
|
|
2014-03-12 19:27:45 +00:00
|
|
|
CSSPoint AdjustTapToChildWidget(const CSSPoint& aPoint);
|
2013-12-05 23:17:37 +00:00
|
|
|
|
2012-07-20 06:48:27 +00:00
|
|
|
// When true, we create a pan/zoom controller for our frame and
|
|
|
|
// notify it of input events targeting us.
|
|
|
|
bool UseAsyncPanZoom();
|
|
|
|
// If we have a render frame currently, notify it that we're about
|
|
|
|
// to dispatch |aEvent| to our child. If there's a relevant
|
2014-03-10 21:59:46 +00:00
|
|
|
// transform in place, |aEvent| will be transformed in-place so that
|
|
|
|
// it is ready to be dispatched to content.
|
|
|
|
// |aOutTargetGuid| will contain the identifier
|
2013-11-13 18:20:31 +00:00
|
|
|
// of the APZC instance that handled the event. aOutTargetGuid may be
|
2014-03-10 21:59:46 +00:00
|
|
|
// null.
|
|
|
|
void MaybeForwardEventToRenderFrame(WidgetInputEvent& aEvent,
|
|
|
|
ScrollableLayerGuid* aOutTargetGuid);
|
2013-05-16 05:58:07 +00:00
|
|
|
// The offset for the child process which is sampled at touch start. This
|
|
|
|
// means that the touch events are relative to where the frame was at the
|
|
|
|
// start of the touch. We need to look for a better solution to this
|
|
|
|
// problem see bug 872911.
|
2013-07-11 14:43:35 +00:00
|
|
|
LayoutDeviceIntPoint mChildProcessOffsetAtTouchStart;
|
2013-01-10 13:22:14 +00:00
|
|
|
// When true, we've initiated normal shutdown and notified our
|
|
|
|
// managing PContent.
|
|
|
|
bool mMarkedDestroying;
|
2012-11-10 06:09:24 +00:00
|
|
|
// When true, the TabParent is invalid and we should not send IPC messages
|
|
|
|
// anymore.
|
|
|
|
bool mIsDestroyed;
|
2013-02-15 22:27:21 +00:00
|
|
|
// Whether we have already sent a FileDescriptor for the app package.
|
|
|
|
bool mAppPackageFileDescriptorSent;
|
2014-01-11 01:10:57 +00:00
|
|
|
|
|
|
|
uint32_t mChromeFlags;
|
|
|
|
|
|
|
|
nsCOMPtr<nsILoadContext> mLoadContext;
|
2009-06-30 20:39:22 +00:00
|
|
|
};
|
|
|
|
|
2009-08-12 16:18:08 +00:00
|
|
|
} // namespace dom
|
2009-06-30 20:39:22 +00:00
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|