Backed out changeset 31cbb80c705e, win burning

This commit is contained in:
Oleg Romashin 2011-07-15 14:30:29 -07:00
parent 5dfda6c571
commit 37cc5f01d3
7 changed files with 11 additions and 73 deletions

View File

@ -914,9 +914,7 @@ nsFrameLoader::ShowRemoteFrame(const nsIntSize& size)
EnsureMessageManager();
} else {
nsRect dimensions;
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), false);
mRemoteBrowser->UpdateDimensions(dimensions, size);
mRemoteBrowser->Move(size);
}
return true;
@ -1602,51 +1600,13 @@ nsFrameLoader::CheckForRecursiveLoad(nsIURI* aURI)
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::GetWindowDimensions(nsRect& aRect)
{
// Need to get outer window position here
nsIDocument* doc = mOwnerContent->GetDocument();
if (!doc) {
return NS_ERROR_FAILURE;
}
if (doc->GetDisplayDocument()) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIWebNavigation> parentAsWebNav =
do_GetInterface(doc->GetScriptGlobalObject());
if (!parentAsWebNav) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIDocShellTreeItem> parentAsItem(do_QueryInterface(parentAsWebNav));
NS_ASSERTION(mIsTopLevelContent, "Outer dimensions must be taken only from TopLevel content");
nsCOMPtr<nsIDocShellTreeOwner> parentOwner;
if (NS_FAILED(parentAsItem->GetTreeOwner(getter_AddRefs(parentOwner))) ||
!parentOwner) {
return NS_ERROR_FAILURE;
}
nsCOMPtr<nsIBaseWindow> treeOwnerAsWin(do_GetInterface(parentOwner));
treeOwnerAsWin->GetPosition(&aRect.x, &aRect.y);
treeOwnerAsWin->GetSize(&aRect.width, &aRect.height);
return NS_OK;
}
NS_IMETHODIMP
nsFrameLoader::UpdatePositionAndSize(nsIFrame *aIFrame)
{
if (mRemoteFrame) {
if (mRemoteBrowser) {
nsIntSize size = GetSubDocumentSize(aIFrame);
nsRect dimensions;
NS_ENSURE_SUCCESS(GetWindowDimensions(dimensions), NS_ERROR_FAILURE);
mRemoteBrowser->UpdateDimensions(dimensions, size);
mRemoteBrowser->Move(size);
}
return NS_OK;
}

View File

@ -296,7 +296,6 @@ private:
// Properly retrieves documentSize of any subdocument type.
NS_HIDDEN_(nsIntSize) GetSubDocumentSize(const nsIFrame *aIFrame);
nsresult GetWindowDimensions(nsRect& aRect);
// Updates the subdocument position and size. This gets called only
// when we have our own in-process DocShell.

View File

@ -239,7 +239,7 @@ child:
LoadURL(nsCString uri);
UpdateDimensions(nsRect rect, nsIntSize size);
Move(nsIntSize size);
/**
* Sending an activate message moves focus to the child.

View File

@ -122,7 +122,6 @@ TabChild::TabChild(PRUint32 aChromeFlags)
: mRemoteFrame(nsnull)
, mTabChildGlobal(nsnull)
, mChromeFlags(aChromeFlags)
, mOuterRect(0, 0, 0, 0)
{
printf("creating %d!\n", NS_IsMainThread());
}
@ -262,20 +261,9 @@ NS_IMETHODIMP
TabChild::GetDimensions(PRUint32 aFlags, PRInt32* aX,
PRInt32* aY, PRInt32* aCx, PRInt32* aCy)
{
if (aX) {
*aX = mOuterRect.x;
}
if (aY) {
*aY = mOuterRect.y;
}
if (aCx) {
*aCx = mOuterRect.width;
}
if (aCy) {
*aCy = mOuterRect.height;
}
NS_NOTREACHED("TabChild::GetDimensions not supported in TabChild");
return NS_OK;
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP
@ -546,16 +534,9 @@ TabChild::RecvShow(const nsIntSize& size)
}
bool
TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size)
TabChild::RecvMove(const nsIntSize& size)
{
#ifdef DEBUG
printf("[TabChild] Update Dimensions to (x,y,w,h)= (%ud, %ud, %ud, %ud) and move to (w,h)= (%ud, %ud)\n", rect.x, rect.y, rect.width, rect.height, size.width, size.height);
#endif
mOuterRect.x = rect.x;
mOuterRect.y = rect.y;
mOuterRect.width = rect.width;
mOuterRect.height = rect.height;
printf("[TabChild] RESIZE to (w,h)= (%ud, %ud)\n", size.width, size.height);
mWidget->Resize(0, 0, size.width, size.height,
PR_TRUE);
@ -563,7 +544,6 @@ TabChild::RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size)
nsCOMPtr<nsIBaseWindow> baseWin = do_QueryInterface(mWebNav);
baseWin->SetPositionAndSize(0, 0, size.width, size.height,
PR_TRUE);
return true;
}

View File

@ -178,7 +178,7 @@ public:
virtual bool RecvLoadURL(const nsCString& uri);
virtual bool RecvShow(const nsIntSize& size);
virtual bool RecvUpdateDimensions(const nsRect& rect, const nsIntSize& size);
virtual bool RecvMove(const nsIntSize& size);
virtual bool RecvActivate();
virtual bool RecvDeactivate();
virtual bool RecvMouseEvent(const nsString& aType,
@ -268,7 +268,6 @@ private:
RenderFrameChild* mRemoteFrame;
nsRefPtr<TabChildGlobal> mTabChildGlobal;
PRUint32 mChromeFlags;
nsIntRect mOuterRect;
DISALLOW_EVIL_CONSTRUCTORS(TabChild);
};

View File

@ -209,9 +209,9 @@ TabParent::Show(const nsIntSize& size)
}
void
TabParent::UpdateDimensions(const nsRect& rect, const nsIntSize& size)
TabParent::Move(const nsIntSize& size)
{
unused << SendUpdateDimensions(rect, size);
unused << SendMove(size);
}
void

View File

@ -126,7 +126,7 @@ public:
// message-sending functions under a layer of indirection and
// eating the return values
void Show(const nsIntSize& size);
void UpdateDimensions(const nsRect& rect, const nsIntSize& size);
void Move(const nsIntSize& size);
void Activate();
void Deactivate();
void SendMouseEvent(const nsAString& aType, float aX, float aY,