1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 2; -*- */
2 /* vim: set sw=4 ts=8 et tw=80 : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_TabChild_h
8 #define mozilla_dom_TabChild_h
10 #include "mozilla/dom/PBrowserChild.h"
11 #include "nsIWebNavigation.h"
13 #include "nsAutoPtr.h"
14 #include "nsIWebBrowserChrome2.h"
15 #include "nsIEmbeddingSiteWindow.h"
16 #include "nsIWebBrowserChromeFocus.h"
17 #include "nsIDOMEventListener.h"
18 #include "nsIInterfaceRequestor.h"
19 #include "nsIWindowProvider.h"
20 #include "nsIDOMWindow.h"
21 #include "nsIDocShell.h"
22 #include "nsIInterfaceRequestorUtils.h"
23 #include "nsFrameMessageManager.h"
24 #include "nsIWebProgressListener.h"
25 #include "nsIPresShell.h"
26 #include "nsIScriptObjectPrincipal.h"
27 #include "nsWeakReference.h"
28 #include "nsITabChild.h"
29 #include "nsITooltipListener.h"
30 #include "mozilla/Attributes.h"
31 #include "mozilla/dom/TabContext.h"
32 #include "mozilla/DOMEventTargetHelper.h"
33 #include "mozilla/EventDispatcher.h"
34 #include "mozilla/EventForwards.h"
35 #include "mozilla/layers/CompositorTypes.h"
37 class nsICachedFileDescriptorListener
;
38 class nsIDOMWindowUtils
;
42 class RenderFrameChild
;
46 class ActiveElementManager
;
50 struct AutoCacheNativeKeyCommands
;
56 class ClonedMessageData
;
59 class TabChildGlobal
: public DOMEventTargetHelper
,
60 public nsIContentFrameMessageManager
,
61 public nsIScriptObjectPrincipal
,
62 public nsIGlobalObject
65 explicit TabChildGlobal(TabChildBase
* aTabChild
);
67 NS_DECL_ISUPPORTS_INHERITED
68 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TabChildGlobal
, DOMEventTargetHelper
)
69 NS_FORWARD_SAFE_NSIMESSAGELISTENERMANAGER(mMessageManager
)
70 NS_FORWARD_SAFE_NSIMESSAGESENDER(mMessageManager
)
71 NS_IMETHOD
SendSyncMessage(const nsAString
& aMessageName
,
72 JS::Handle
<JS::Value
> aObject
,
73 JS::Handle
<JS::Value
> aRemote
,
74 nsIPrincipal
* aPrincipal
,
77 JS::MutableHandle
<JS::Value
> aRetval
)
79 return mMessageManager
80 ? mMessageManager
->SendSyncMessage(aMessageName
, aObject
, aRemote
,
81 aPrincipal
, aCx
, aArgc
, aRetval
)
82 : NS_ERROR_NULL_POINTER
;
84 NS_IMETHOD
SendRpcMessage(const nsAString
& aMessageName
,
85 JS::Handle
<JS::Value
> aObject
,
86 JS::Handle
<JS::Value
> aRemote
,
87 nsIPrincipal
* aPrincipal
,
90 JS::MutableHandle
<JS::Value
> aRetval
)
92 return mMessageManager
93 ? mMessageManager
->SendRpcMessage(aMessageName
, aObject
, aRemote
,
94 aPrincipal
, aCx
, aArgc
, aRetval
)
95 : NS_ERROR_NULL_POINTER
;
97 NS_IMETHOD
GetContent(nsIDOMWindow
** aContent
) MOZ_OVERRIDE
;
98 NS_IMETHOD
GetDocShell(nsIDocShell
** aDocShell
) MOZ_OVERRIDE
;
99 NS_IMETHOD
Dump(const nsAString
& aStr
) MOZ_OVERRIDE
101 return mMessageManager
? mMessageManager
->Dump(aStr
) : NS_OK
;
103 NS_IMETHOD
PrivateNoteIntentionalCrash() MOZ_OVERRIDE
;
104 NS_IMETHOD
Btoa(const nsAString
& aBinaryData
,
105 nsAString
& aAsciiBase64String
) MOZ_OVERRIDE
;
106 NS_IMETHOD
Atob(const nsAString
& aAsciiString
,
107 nsAString
& aBinaryData
) MOZ_OVERRIDE
;
109 NS_IMETHOD
AddEventListener(const nsAString
& aType
,
110 nsIDOMEventListener
* aListener
,
113 // By default add listeners only for trusted events!
114 return DOMEventTargetHelper::AddEventListener(aType
, aListener
,
115 aUseCapture
, false, 2);
117 using DOMEventTargetHelper::AddEventListener
;
118 NS_IMETHOD
AddEventListener(const nsAString
& aType
,
119 nsIDOMEventListener
* aListener
,
120 bool aUseCapture
, bool aWantsUntrusted
,
121 uint8_t optional_argc
) MOZ_OVERRIDE
123 return DOMEventTargetHelper::AddEventListener(aType
, aListener
,
130 PreHandleEvent(EventChainPreVisitor
& aVisitor
)
132 aVisitor
.mForceContentDispatch
= true;
136 virtual JSContext
* GetJSContextForEventHandlers() MOZ_OVERRIDE
;
137 virtual nsIPrincipal
* GetPrincipal() MOZ_OVERRIDE
;
138 virtual JSObject
* GetGlobalJSObject() MOZ_OVERRIDE
;
140 nsCOMPtr
<nsIContentFrameMessageManager
> mMessageManager
;
141 nsRefPtr
<TabChildBase
> mTabChild
;
147 class ContentListener MOZ_FINAL
: public nsIDOMEventListener
150 explicit ContentListener(TabChild
* aTabChild
) : mTabChild(aTabChild
) {}
152 NS_DECL_NSIDOMEVENTLISTENER
154 ~ContentListener() {}
158 // This is base clase which helps to share Viewport and touch related functionality
159 // between b2g/android FF/embedlite clients implementation.
160 // It make sense to place in this class all helper functions, and functionality which could be shared between
161 // Cross-process/Cross-thread implmentations.
162 class TabChildBase
: public nsISupports
,
163 public nsFrameScriptExecutor
,
164 public ipc::MessageManagerCallback
169 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
170 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TabChildBase
)
172 virtual nsIWebNavigation
* WebNavigation() = 0;
173 virtual nsIWidget
* WebWidget() = 0;
174 nsIPrincipal
* GetPrincipal() { return mPrincipal
; }
175 bool IsAsyncPanZoomEnabled();
176 // Recalculates the display state, including the CSS
177 // viewport. This should be called whenever we believe the
178 // viewport data on a document may have changed. If it didn't
179 // change, this function doesn't do anything. However, it should
180 // not be called all the time as it is fairly expensive.
181 bool HandlePossibleViewportChange(const ScreenIntSize
& aOldScreenSize
);
182 virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId
,
183 const mozilla::layers::FrameMetrics::ViewID
& aViewId
,
185 const mozilla::layers::ZoomConstraints
& aConstraints
) = 0;
187 nsEventStatus
DispatchSynthesizedMouseEvent(uint32_t aMsg
, uint64_t aTime
,
188 const LayoutDevicePoint
& aRefPoint
,
192 virtual ~TabChildBase();
193 CSSSize
GetPageSize(nsCOMPtr
<nsIDocument
> aDocument
, const CSSSize
& aViewport
);
195 // Get the DOMWindowUtils for the top-level window in this tab.
196 already_AddRefed
<nsIDOMWindowUtils
> GetDOMWindowUtils();
197 // Get the Document for the top-level window in this tab.
198 already_AddRefed
<nsIDocument
> GetDocument();
200 // Wrapper for nsIDOMWindowUtils.setCSSViewport(). This updates some state
201 // variables local to this class before setting it.
202 void SetCSSViewport(const CSSSize
& aSize
);
204 // Wraps up a JSON object as a structured clone and sends it to the browser
207 // XXX/bug 780335: Do the work the browser chrome script does in C++ instead
208 // so we don't need things like this.
209 void DispatchMessageManagerMessage(const nsAString
& aMessageName
,
210 const nsAString
& aJSONData
);
212 nsEventStatus
DispatchWidgetEvent(WidgetGUIEvent
& event
);
214 void InitializeRootMetrics();
216 mozilla::layers::FrameMetrics
ProcessUpdateFrame(const mozilla::layers::FrameMetrics
& aFrameMetrics
);
218 bool UpdateFrameHandler(const mozilla::layers::FrameMetrics
& aFrameMetrics
);
221 CSSSize mOldViewportSize
;
222 bool mContentDocumentIsDisplayed
;
223 nsRefPtr
<TabChildGlobal
> mTabChildGlobal
;
224 ScreenIntSize mInnerSize
;
225 mozilla::layers::FrameMetrics mLastRootMetrics
;
226 mozilla::layout::ScrollingBehavior mScrolling
;
229 class TabChild MOZ_FINAL
: public TabChildBase
,
230 public PBrowserChild
,
231 public nsIWebBrowserChrome2
,
232 public nsIEmbeddingSiteWindow
,
233 public nsIWebBrowserChromeFocus
,
234 public nsIInterfaceRequestor
,
235 public nsIWindowProvider
,
236 public nsIDOMEventListener
,
237 public nsIWebProgressListener
,
238 public nsSupportsWeakReference
,
242 public nsITooltipListener
244 typedef mozilla::dom::ClonedMessageData ClonedMessageData
;
245 typedef mozilla::layout::RenderFrameChild RenderFrameChild
;
246 typedef mozilla::layout::ScrollingBehavior ScrollingBehavior
;
247 typedef mozilla::layers::ActiveElementManager ActiveElementManager
;
250 static std::map
<uint64_t, nsRefPtr
<TabChild
> >& NestedTabChildMap();
254 * This is expected to be called off the critical path to content
255 * startup. This is an opportunity to load things that are slow
256 * on the critical path.
258 static void PreloadSlowThings();
260 /** Return a TabChild with the given attributes. */
261 static already_AddRefed
<TabChild
>
262 Create(nsIContentChild
* aManager
, const TabContext
& aContext
, uint32_t aChromeFlags
);
264 bool IsRootContentDocument();
266 const uint64_t Id() const {
271 GetTabChildId(TabChild
* aTabChild
)
273 MOZ_ASSERT(NS_IsMainThread());
274 if (aTabChild
->Id() != 0) {
275 return aTabChild
->Id();
277 static uint64_t sId
= 0;
279 aTabChild
->mUniqueId
= sId
;
280 NestedTabChildMap()[sId
] = aTabChild
;
284 NS_DECL_ISUPPORTS_INHERITED
285 NS_DECL_NSIWEBBROWSERCHROME
286 NS_DECL_NSIWEBBROWSERCHROME2
287 NS_DECL_NSIEMBEDDINGSITEWINDOW
288 NS_DECL_NSIWEBBROWSERCHROMEFOCUS
289 NS_DECL_NSIINTERFACEREQUESTOR
290 NS_DECL_NSIWINDOWPROVIDER
291 NS_DECL_NSIDOMEVENTLISTENER
292 NS_DECL_NSIWEBPROGRESSLISTENER
295 NS_DECL_NSITOOLTIPLISTENER
298 * MessageManagerCallback methods that we override.
300 virtual bool DoSendBlockingMessage(JSContext
* aCx
,
301 const nsAString
& aMessage
,
302 const mozilla::dom::StructuredCloneData
& aData
,
303 JS::Handle
<JSObject
*> aCpows
,
304 nsIPrincipal
* aPrincipal
,
305 InfallibleTArray
<nsString
>* aJSONRetVal
,
306 bool aIsSync
) MOZ_OVERRIDE
;
307 virtual bool DoSendAsyncMessage(JSContext
* aCx
,
308 const nsAString
& aMessage
,
309 const mozilla::dom::StructuredCloneData
& aData
,
310 JS::Handle
<JSObject
*> aCpows
,
311 nsIPrincipal
* aPrincipal
) MOZ_OVERRIDE
;
312 virtual bool DoUpdateZoomConstraints(const uint32_t& aPresShellId
,
313 const ViewID
& aViewId
,
315 const ZoomConstraints
& aConstraints
) MOZ_OVERRIDE
;
316 virtual bool RecvLoadURL(const nsCString
& uri
) MOZ_OVERRIDE
;
317 virtual bool RecvCacheFileDescriptor(const nsString
& aPath
,
318 const FileDescriptor
& aFileDescriptor
)
320 virtual bool RecvShow(const nsIntSize
& size
) MOZ_OVERRIDE
;
321 virtual bool RecvUpdateDimensions(const nsIntRect
& rect
,
322 const nsIntSize
& size
,
323 const ScreenOrientation
& orientation
) MOZ_OVERRIDE
;
324 virtual bool RecvUpdateFrame(const mozilla::layers::FrameMetrics
& aFrameMetrics
) MOZ_OVERRIDE
;
325 virtual bool RecvAcknowledgeScrollUpdate(const ViewID
& aScrollId
,
326 const uint32_t& aScrollGeneration
) MOZ_OVERRIDE
;
327 virtual bool RecvHandleDoubleTap(const CSSPoint
& aPoint
,
328 const mozilla::layers::ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
329 virtual bool RecvHandleSingleTap(const CSSPoint
& aPoint
,
330 const mozilla::layers::ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
331 virtual bool RecvHandleLongTap(const CSSPoint
& aPoint
,
332 const mozilla::layers::ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
333 virtual bool RecvHandleLongTapUp(const CSSPoint
& aPoint
,
334 const mozilla::layers::ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
335 virtual bool RecvNotifyAPZStateChange(const ViewID
& aViewId
,
336 const APZStateChange
& aChange
,
337 const int& aArg
) MOZ_OVERRIDE
;
338 virtual bool RecvActivate() MOZ_OVERRIDE
;
339 virtual bool RecvDeactivate() MOZ_OVERRIDE
;
340 virtual bool RecvMouseEvent(const nsString
& aType
,
343 const int32_t& aButton
,
344 const int32_t& aClickCount
,
345 const int32_t& aModifiers
,
346 const bool& aIgnoreRootScrollFrame
) MOZ_OVERRIDE
;
347 virtual bool RecvRealMouseEvent(const mozilla::WidgetMouseEvent
& event
) MOZ_OVERRIDE
;
348 virtual bool RecvRealKeyEvent(const mozilla::WidgetKeyboardEvent
& event
,
349 const MaybeNativeKeyBinding
& aBindings
) MOZ_OVERRIDE
;
350 virtual bool RecvMouseWheelEvent(const mozilla::WidgetWheelEvent
& event
) MOZ_OVERRIDE
;
351 virtual bool RecvRealTouchEvent(const WidgetTouchEvent
& aEvent
,
352 const ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
353 virtual bool RecvRealTouchMoveEvent(const WidgetTouchEvent
& aEvent
,
354 const ScrollableLayerGuid
& aGuid
) MOZ_OVERRIDE
;
355 virtual bool RecvKeyEvent(const nsString
& aType
,
356 const int32_t& aKeyCode
,
357 const int32_t& aCharCode
,
358 const int32_t& aModifiers
,
359 const bool& aPreventDefault
) MOZ_OVERRIDE
;
360 virtual bool RecvCompositionEvent(const mozilla::WidgetCompositionEvent
& event
) MOZ_OVERRIDE
;
361 virtual bool RecvTextEvent(const mozilla::WidgetTextEvent
& event
) MOZ_OVERRIDE
;
362 virtual bool RecvSelectionEvent(const mozilla::WidgetSelectionEvent
& event
) MOZ_OVERRIDE
;
363 virtual bool RecvActivateFrameEvent(const nsString
& aType
, const bool& capture
) MOZ_OVERRIDE
;
364 virtual bool RecvLoadRemoteScript(const nsString
& aURL
,
365 const bool& aRunInGlobalScope
) MOZ_OVERRIDE
;
366 virtual bool RecvAsyncMessage(const nsString
& aMessage
,
367 const ClonedMessageData
& aData
,
368 const InfallibleTArray
<CpowEntry
>& aCpows
,
369 const IPC::Principal
& aPrincipal
) MOZ_OVERRIDE
;
371 virtual PDocumentRendererChild
*
372 AllocPDocumentRendererChild(const nsRect
& documentRect
, const gfx::Matrix
& transform
,
373 const nsString
& bgcolor
,
374 const uint32_t& renderFlags
, const bool& flushLayout
,
375 const nsIntSize
& renderSize
) MOZ_OVERRIDE
;
376 virtual bool DeallocPDocumentRendererChild(PDocumentRendererChild
* actor
) MOZ_OVERRIDE
;
377 virtual bool RecvPDocumentRendererConstructor(PDocumentRendererChild
* actor
,
378 const nsRect
& documentRect
,
379 const gfx::Matrix
& transform
,
380 const nsString
& bgcolor
,
381 const uint32_t& renderFlags
,
382 const bool& flushLayout
,
383 const nsIntSize
& renderSize
) MOZ_OVERRIDE
;
385 virtual PColorPickerChild
*
386 AllocPColorPickerChild(const nsString
& title
, const nsString
& initialColor
) MOZ_OVERRIDE
;
387 virtual bool DeallocPColorPickerChild(PColorPickerChild
* actor
) MOZ_OVERRIDE
;
389 virtual PContentPermissionRequestChild
*
390 AllocPContentPermissionRequestChild(const InfallibleTArray
<PermissionRequest
>& aRequests
,
391 const IPC::Principal
& aPrincipal
) MOZ_OVERRIDE
;
393 DeallocPContentPermissionRequestChild(PContentPermissionRequestChild
* actor
) MOZ_OVERRIDE
;
395 virtual PFilePickerChild
*
396 AllocPFilePickerChild(const nsString
& aTitle
, const int16_t& aMode
) MOZ_OVERRIDE
;
398 DeallocPFilePickerChild(PFilePickerChild
* actor
) MOZ_OVERRIDE
;
400 virtual POfflineCacheUpdateChild
* AllocPOfflineCacheUpdateChild(
401 const URIParams
& manifestURI
,
402 const URIParams
& documentURI
,
403 const bool& stickDocument
) MOZ_OVERRIDE
;
405 DeallocPOfflineCacheUpdateChild(POfflineCacheUpdateChild
* offlineCacheUpdate
) MOZ_OVERRIDE
;
407 virtual nsIWebNavigation
* WebNavigation() MOZ_OVERRIDE
{ return mWebNav
; }
408 virtual nsIWidget
* WebWidget() MOZ_OVERRIDE
{ return mWidget
; }
410 /** Return the DPI of the widget this TabChild draws to. */
411 void GetDPI(float* aDPI
);
412 void GetDefaultScale(double *aScale
);
414 ScreenOrientation
GetOrientation() { return mOrientation
; }
416 void SetBackgroundColor(const nscolor
& aColor
);
418 void NotifyPainted();
420 void RequestNativeKeyBindings(mozilla::widget::AutoCacheNativeKeyCommands
* aAutoCache
,
421 WidgetKeyboardEvent
* aEvent
);
423 /** Return a boolean indicating if the page has called preventDefault on
426 bool DispatchMouseEvent(const nsString
& aType
,
427 const CSSPoint
& aPoint
,
428 const int32_t& aButton
,
429 const int32_t& aClickCount
,
430 const int32_t& aModifiers
,
431 const bool& aIgnoreRootScrollFrame
,
432 const unsigned short& aInputSourceArg
);
435 * Signal to this TabChild that it should be made visible:
436 * activated widget, retained layer tree, etc. (Respectively,
442 // Returns true if the file descriptor was found in the cache, false
444 bool GetCachedFileDescriptor(const nsAString
& aPath
,
445 nsICachedFileDescriptorListener
* aCallback
);
447 void CancelCachedFileDescriptorCallback(
448 const nsAString
& aPath
,
449 nsICachedFileDescriptorListener
* aCallback
);
451 nsIContentChild
* Manager() { return mManager
; }
453 bool GetUpdateHitRegion() { return mUpdateHitRegion
; }
455 void UpdateHitRegion(const nsRegion
& aRegion
);
457 static inline TabChild
*
458 GetFrom(nsIDocShell
* aDocShell
)
460 nsCOMPtr
<nsITabChild
> tc
= do_GetInterface(aDocShell
);
461 return static_cast<TabChild
*>(tc
.get());
464 static TabChild
* GetFrom(nsIPresShell
* aPresShell
);
465 static TabChild
* GetFrom(uint64_t aLayersId
);
467 void DidComposite(uint64_t aTransactionId
);
469 static inline TabChild
*
470 GetFrom(nsIDOMWindow
* aWindow
)
472 nsCOMPtr
<nsIWebNavigation
> webNav
= do_GetInterface(aWindow
);
473 nsCOMPtr
<nsIDocShell
> docShell
= do_QueryInterface(webNav
);
474 return GetFrom(docShell
);
477 virtual bool RecvUIResolutionChanged() MOZ_OVERRIDE
;
482 virtual PRenderFrameChild
* AllocPRenderFrameChild(ScrollingBehavior
* aScrolling
,
483 TextureFactoryIdentifier
* aTextureFactoryIdentifier
,
485 bool* aSuccess
) MOZ_OVERRIDE
;
486 virtual bool DeallocPRenderFrameChild(PRenderFrameChild
* aFrame
) MOZ_OVERRIDE
;
487 virtual bool RecvDestroy() MOZ_OVERRIDE
;
488 virtual bool RecvSetUpdateHitRegion(const bool& aEnabled
) MOZ_OVERRIDE
;
489 virtual bool RecvSetIsDocShellActive(const bool& aIsActive
) MOZ_OVERRIDE
;
491 virtual PIndexedDBChild
* AllocPIndexedDBChild(const nsCString
& aGroup
,
492 const nsCString
& aASCIIOrigin
,
493 bool* /* aAllowed */) MOZ_OVERRIDE
;
495 virtual bool DeallocPIndexedDBChild(PIndexedDBChild
* aActor
) MOZ_OVERRIDE
;
497 virtual bool RecvRequestNotifyAfterRemotePaint();
501 * Create a new TabChild object.
503 * |aOwnOrContainingAppId| is the app-id of our frame or of the closest app
504 * frame in the hierarchy which contains us.
506 * |aIsBrowserElement| indicates whether we're a browser (but not an app).
508 TabChild(nsIContentChild
* aManager
, const TabContext
& aContext
, uint32_t aChromeFlags
);
512 class DelayedFireSingleTapEvent
;
513 class DelayedFireContextMenuEvent
;
515 // Notify others that our TabContext has been updated. (At the moment, this
516 // sets the appropriate app-id and is-browser flags on our docshell.)
518 // You should call this after calling TabContext::SetTabContext(). We also
519 // call this during Init().
520 void NotifyTabContextUpdated();
522 void ActorDestroy(ActorDestroyReason why
) MOZ_OVERRIDE
;
524 enum FrameScriptLoading
{ DONT_LOAD_SCRIPTS
, DEFAULT_LOAD_SCRIPTS
};
525 bool InitTabChildGlobal(FrameScriptLoading aScriptLoading
= DEFAULT_LOAD_SCRIPTS
);
526 bool InitRenderingState();
527 void DestroyWindow();
528 void SetProcessNameToAppName();
530 // Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
533 // These methods are used for tracking synthetic mouse events
534 // dispatched for compatibility. On each touch event, we
535 // UpdateTapState(). If we've detected that the current gesture
536 // isn't a tap, then we CancelTapTracking(). In the meantime, we
537 // may detect a context-menu event, and if so we
538 // FireContextMenuEvent().
539 void FireContextMenuEvent();
540 void CancelTapTracking();
541 void UpdateTapState(const WidgetTouchEvent
& aEvent
, nsEventStatus aStatus
);
544 BrowserFrameProvideWindow(nsIDOMWindow
* aOpener
,
546 const nsAString
& aName
,
547 const nsACString
& aFeatures
,
549 nsIDOMWindow
** aReturn
);
551 bool HasValidInnerSize();
553 void SendPendingTouchPreventedResponse(bool aPreventDefault
,
554 const ScrollableLayerGuid
& aGuid
);
556 class CachedFileDescriptorInfo
;
557 class CachedFileDescriptorCallbackRunnable
;
559 TextureFactoryIdentifier mTextureFactoryIdentifier
;
560 nsCOMPtr
<nsIWebNavigation
> mWebNav
;
561 nsCOMPtr
<nsIWidget
> mWidget
;
562 nsCOMPtr
<nsIURI
> mLastURI
;
563 RenderFrameChild
* mRemoteFrame
;
564 nsRefPtr
<nsIContentChild
> mManager
;
565 uint32_t mChromeFlags
;
567 nsIntRect mOuterRect
;
568 // When we're tracking a possible tap gesture, this is the "down"
569 // point of the touchstart.
570 LayoutDevicePoint mGestureDownPoint
;
571 // The touch identifier of the active gesture.
572 int32_t mActivePointerId
;
573 // A timer task that fires if the tap-hold timeout is exceeded by
574 // the touch we're tracking. That is, if touchend or a touchmove
575 // that exceeds the gesture threshold doesn't happen.
576 nsCOMPtr
<nsITimer
> mTapHoldTimer
;
577 // Whether we have already received a FileDescriptor for the app package.
578 bool mAppPackageFileDescriptorRecved
;
579 // At present only 1 of these is really expected.
580 nsAutoTArray
<nsAutoPtr
<CachedFileDescriptorInfo
>, 1>
581 mCachedFileDescriptorInfos
;
582 nscolor mLastBackgroundColor
;
585 bool mTriedBrowserInit
;
586 ScreenOrientation mOrientation
;
587 bool mUpdateHitRegion
;
588 bool mPendingTouchPreventedResponse
;
589 ScrollableLayerGuid mPendingTouchPreventedGuid
;
590 void FireSingleTapEvent(LayoutDevicePoint aPoint
);
592 bool mTouchEndCancelled
;
593 bool mEndTouchIsClick
;
595 bool mIgnoreKeyPressEvent
;
596 nsRefPtr
<ActiveElementManager
> mActiveElementManager
;
597 bool mHasValidInnerSize
;
601 DISALLOW_EVIL_CONSTRUCTORS(TabChild
);
607 #endif // mozilla_dom_TabChild_h