Bug 784908: Part 2: Add a call to UpdateDimensions when a tab is first created r=cjones

This commit is contained in:
Doug Sherk 2012-09-28 22:16:36 -04:00
parent c0e08ee726
commit b3a78c0ca6
2 changed files with 24 additions and 0 deletions

View File

@ -83,6 +83,7 @@ TabParent::TabParent(mozIApplication* aApp, bool aIsBrowserElement)
, mIMECompositionStart(0)
, mIMESeqno(0)
, mEventCaptureDepth(0)
, mDimensions(0, 0)
, mDPI(0)
, mIsBrowserElement(aIsBrowserElement)
, mShown(false)
@ -229,6 +230,7 @@ TabParent::Show(const nsIntSize& size)
{
// sigh
mShown = true;
mDimensions = size;
unused << SendShow(size);
}
@ -239,6 +241,7 @@ TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
if (RenderFrameParent* rfp = GetRenderFrame()) {
rfp->NotifyDimensionsChanged(size.width, size.height);
}
mDimensions = size;
}
void
@ -1172,6 +1175,21 @@ TabParent::RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
return true;
}
bool
TabParent::RecvPRenderFrameConstructor(PRenderFrameParent* actor,
ScrollingBehavior* scrolling,
LayersBackend* backend,
int32_t* maxTextureSize,
uint64_t* layersId)
{
RenderFrameParent* rfp = GetRenderFrame();
if (mDimensions != nsIntSize() && rfp) {
rfp->NotifyDimensionsChanged(mDimensions.width, mDimensions.height);
}
return true;
}
bool
TabParent::RecvZoomToRect(const gfxRect& aRect)
{

View File

@ -94,6 +94,11 @@ public:
virtual bool RecvMoveFocus(const bool& aForward);
virtual bool RecvEvent(const RemoteDOMEvent& aEvent);
virtual bool RecvPRenderFrameConstructor(PRenderFrameParent* actor,
ScrollingBehavior* scrolling,
LayersBackend* backend,
int32_t* maxTextureSize,
uint64_t* layersId);
virtual bool RecvBrowserFrameOpenWindow(PBrowserParent* aOpener,
const nsString& aURL,
const nsString& aName,
@ -269,6 +274,7 @@ protected:
// The number of event series we're currently capturing.
int32_t mEventCaptureDepth;
nsIntSize mDimensions;
float mDPI;
bool mIsBrowserElement;
bool mShown;