SizeContentTo sizes content webshell (was sizing chrome webshell)
git-svn-id: svn://10.0.0.236/trunk@45233 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -2638,16 +2638,21 @@ NS_IMETHODIMP nsWebShellWindow::SizeWindowTo(PRInt32 aWidth, PRInt32 aHeight)
|
||||
|
||||
NS_IMETHODIMP nsWebShellWindow::SizeContentTo(PRInt32 aWidth, PRInt32 aHeight)
|
||||
{
|
||||
PRInt32 x,y,width,height;
|
||||
mWebShell->GetBounds(x,y,width,height);
|
||||
PRInt32 aWidthDelta = aWidth - width;
|
||||
PRInt32 aHeightDelta = aHeight - height;
|
||||
nsCOMPtr<nsIWebShell> content;
|
||||
GetContentWebShell(getter_AddRefs(content));
|
||||
if (content) {
|
||||
PRInt32 x, y, width, height,
|
||||
widthDelta, heightDelta;
|
||||
content->GetBounds(x,y,width,height);
|
||||
widthDelta = aWidth - width;
|
||||
heightDelta = aHeight - height;
|
||||
|
||||
nsRect windowBounds;
|
||||
mWindow->GetBounds(windowBounds);
|
||||
mWindow->Resize(windowBounds.width + aWidthDelta,
|
||||
windowBounds.height + aHeightDelta,
|
||||
PR_TRUE);
|
||||
nsRect windowBounds;
|
||||
mWindow->GetBounds(windowBounds);
|
||||
mWindow->Resize(windowBounds.width + widthDelta,
|
||||
windowBounds.height + heightDelta,
|
||||
PR_TRUE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user