diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index 1ddeb57aa1e..e7ffd8dce5d 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -2628,6 +2628,8 @@ PRUint32 GlobalWindowImpl::CalculateChromeFlags(char* aFeatures, PRBool aDialog) chromeFlags |= WinHasOption(aFeatures, "chrome", nsnull) ? nsIWebBrowserChrome::openAsChrome : 0; + chromeFlags |= WinHasOption(aFeatures, "centerscreen", nsnull) ? + nsIWebBrowserChrome::centerScreen : 0; chromeFlags |= WinHasOption(aFeatures, "dependent", nsnull) ? nsIWebBrowserChrome::dependent : 0; chromeFlags |= WinHasOption(aFeatures, "modal", nsnull) ? diff --git a/mozilla/xpfe/appshell/src/nsAppShellService.cpp b/mozilla/xpfe/appshell/src/nsAppShellService.cpp index f1d1968cd4b..5cb290320d0 100644 --- a/mozilla/xpfe/appshell/src/nsAppShellService.cpp +++ b/mozilla/xpfe/appshell/src/nsAppShellService.cpp @@ -589,6 +589,9 @@ nsAppShellService::JustCreateTopWindow(nsIXULWindow *aParent, #endif } + + if (aChromeMask & nsIWebBrowserChrome::centerScreen) + window->Center(nsnull, PR_TRUE, PR_FALSE); } return rv;