Bug 750901 - Elm to mc migration work - metro related changes to Windows widget src to support building metro winrt bits (nsWidgetFactory, nsWindowGfx, nsToolkit, WinUtils). Also landing nsIWinMetroUtils.idl. r=bbondy
This commit is contained in:
@@ -27,19 +27,41 @@
|
||||
* method for the nsAppShell class.
|
||||
*/
|
||||
|
||||
static nsAppShell *sAppShell;
|
||||
#include "nsXULAppAPI.h"
|
||||
#if defined(MOZ_METRO) && defined(XP_WIN)
|
||||
#include "winrt/MetroAppShell.h"
|
||||
#endif
|
||||
|
||||
static nsIAppShell *sAppShell;
|
||||
|
||||
static nsresult
|
||||
nsAppShellInit()
|
||||
{
|
||||
NS_ASSERTION(!sAppShell, "already initialized");
|
||||
|
||||
#if !defined(MOZ_METRO) || !defined(XP_WIN)
|
||||
sAppShell = new nsAppShell();
|
||||
#else
|
||||
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
|
||||
sAppShell = new MetroAppShell();
|
||||
} else {
|
||||
sAppShell = new nsAppShell();
|
||||
}
|
||||
#endif
|
||||
if (!sAppShell)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(sAppShell);
|
||||
|
||||
nsresult rv = sAppShell->Init();
|
||||
nsresult rv;
|
||||
#if !defined(MOZ_METRO) || !defined(XP_WIN)
|
||||
rv = static_cast<nsAppShell*>(sAppShell)->Init();
|
||||
#else
|
||||
if (XRE_GetWindowsEnvironment() == WindowsEnvironmentType_Metro) {
|
||||
rv = static_cast<MetroAppShell*>(sAppShell)->Init();
|
||||
} else {
|
||||
rv = static_cast<nsAppShell*>(sAppShell)->Init();
|
||||
}
|
||||
#endif
|
||||
if (NS_FAILED(rv)) {
|
||||
NS_RELEASE(sAppShell);
|
||||
return rv;
|
||||
|
||||
Reference in New Issue
Block a user