[OS/2] Bug 501461 - remove os2Embed from the tree, r=pweilbacher
authorWalter Meinl <wuno@lsvw.de>
Sat, 01 Aug 2009 21:55:07 +0300
changeset 30999 65cc2bbfaf3993d95ec34ce9a20044dcd893260f
parent 30998 abce781674e52b88dcdc05411e56462119c24ca0
child 31000 0b159e56802e1663d6ab821c3c7af5c6e921b88d
push idunknown
push userunknown
push dateunknown
reviewerspweilbacher
bugs501461
milestone1.9.2a1pre
[OS/2] Bug 501461 - remove os2Embed from the tree, r=pweilbacher
embedding/tests/Makefile.in
embedding/tests/os2Embed/Makefile.in
embedding/tests/os2Embed/SMALL.ICO
embedding/tests/os2Embed/WebBrowserChrome.cpp
embedding/tests/os2Embed/WebBrowserChrome.h
embedding/tests/os2Embed/WindowCreator.cpp
embedding/tests/os2Embed/WindowCreator.h
embedding/tests/os2Embed/os2Embed.ICO
embedding/tests/os2Embed/os2Embed.cpp
embedding/tests/os2Embed/os2Embed.h
embedding/tests/os2Embed/os2Embed.rc
embedding/tests/os2Embed/resource.h
toolkit/mozapps/installer/packager.mk
xulrunner/build.mk
--- a/embedding/tests/Makefile.in
+++ b/embedding/tests/Makefile.in
@@ -30,20 +30,16 @@
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-ifeq ($(OS_ARCH),OS2)
-DIRS = os2Embed
-endif
-
 ifeq ($(OS_ARCH),WINNT)
 # disable winembed in non-libxul
 ifndef BUILD_STATIC_LIBS
 DIRS = winEmbed
 endif
 
 endif
 
deleted file mode 100644
--- a/embedding/tests/os2Embed/Makefile.in
+++ /dev/null
@@ -1,115 +0,0 @@
-# ***** BEGIN LICENSE BLOCK *****
-# Version: Mozilla-sample-code 1.0
-#
-# Copyright (c) 2002 Netscape Communications Corporation and
-# other contributors
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this Mozilla sample software and associated documentation files
-# (the "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to permit
-# persons to whom the Software is furnished to do so, subject to the
-# following conditions:
-#
-# The above copyright notice and this permission notice shall be included
-# in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-# DEALINGS IN THE SOFTWARE.
-#
-# Contributor(s):
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= ../../..
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-PROGRAM		= os2Embed$(BIN_SUFFIX)
-RESFILE		= os2Embed.res
-MOZILLA_INTERNAL_API = 1
-
-MODULE		= os2Embed
-
-REQUIRES	= xpcom \
-		  string \
-		  embed_base \
-		  webbrwsr \
-		  webshell \
-		  windowwatcher \
-		  profile \
-		  necko \
-		  docshell \
-		  dom \
-		  widget \
-		  uriloader \
-		  shistory \
-		  webbrowserpersist \
-		  gfx \
-		  $(NULL)
-
-CPPSRCS		= \
-		os2Embed.cpp \
-		WebBrowserChrome.cpp \
-		WindowCreator.cpp \
-		$(NULL)
-
-EXTRA_DSO_LIBS	= embed_base_s gkgfx
-
-LIBS		= \
-		$(EXTRA_DSO_LIBS) \
-		$(XPCOM_LIBS) \
-		$(MOZ_JS_LIBS) \
-		$(NSPR_LIBS) \
-		$(NULL)
-
-#
-# Control the default heap size.
-# This is the heap returned by GetProcessHeap().
-# As we use the CRT heap, the default size is too large and wastes VM.
-#
-# The default heap size is 1MB on Win32.
-# The heap will grow if need be.
-#
-# Set it to 256k.  See bug 127069.
-#
-LDFLAGS += /HEAP:0x40000
-
-include $(topsrcdir)/config/config.mk
-
-# Force applications to be built non-statically
-# when building the mozcomps meta component
-ifneq (,$(filter mozcomps,$(MOZ_META_COMPONENTS)))
-BUILD_STATIC_LIBS=
-endif
-
-ifdef BUILD_STATIC_LIBS
-
-include $(topsrcdir)/config/static-config.mk
-
-EXTRA_DEPS     += $(STATIC_EXTRA_DEPS)
-EXTRA_DSO_LIBS += $(STATIC_EXTRA_DSO_LIBS)
-EXTRA_LIBS     += -L$(DEPTH)/dist/lib/components
-EXTRA_LIBS     += $(EXTRA_DSO_LIBS) $(STATIC_EXTRA_LIBS)
-EXTRA_LIBS     += $(DIST)/lib/$(LIB_PREFIX)xulapp_s.$(LIB_SUFFIX)
-DEFINES        += $(STATIC_DEFINES)
-CPPSRCS        += $(STATIC_CPPSRCS)
-
-endif # BUILD_STATIC_LIBS
-
-
-include $(topsrcdir)/config/rules.mk
-
-ifdef BUILD_STATIC_LIBS
-include $(topsrcdir)/config/static-rules.mk
-endif # BUILD_STATIC_LIBS
-
deleted file mode 100644
index 2f28f20e1466692053ba37c12ef4748d065095fc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/embedding/tests/os2Embed/WebBrowserChrome.cpp
+++ /dev/null
@@ -1,568 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
-
-// Mozilla Includes
-#include "nsIGenericFactory.h"
-#include "nsIComponentManager.h"
-#include "nsString.h"
-#include "nsXPIDLString.h"
-#include "nsIURI.h"
-#include "nsIWebProgress.h"
-#include "nsIDocShellTreeItem.h"
-#include "nsIDOMWindow.h"
-#include "nsIDOMWindowInternal.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIRequest.h"
-#include "nsIChannel.h"
-#include "nsCWebBrowser.h"
-#include "nsWidgetsCID.h"
-#include "nsIProfileChangeStatus.h"
-#include "nsCRT.h"
-
-// Local includes
-#include "resource.h"
-
-#include "os2Embed.h"
-#include "WebBrowserChrome.h"
-
-
-WebBrowserChrome::WebBrowserChrome()
-{
-    mNativeWindow = nsnull;
-    mSizeSet = PR_FALSE;
-}
-
-WebBrowserChrome::~WebBrowserChrome()
-{
-    WebBrowserChromeUI::Destroyed(this);
-}
-
-nsresult WebBrowserChrome::CreateBrowser(PRInt32 aX, PRInt32 aY,
-                                         PRInt32 aCX, PRInt32 aCY,
-                                         nsIWebBrowser **aBrowser)
-{
-    NS_ENSURE_ARG_POINTER(aBrowser);
-    *aBrowser = nsnull;
-
-    mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID);
-    
-    if (!mWebBrowser)
-        return NS_ERROR_FAILURE;
-
-    (void)mWebBrowser->SetContainerWindow(static_cast<nsIWebBrowserChrome*>(this));
-
-    nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
-    dsti->SetItemType(nsIDocShellTreeItem::typeContentWrapper);
-
-    nsCOMPtr<nsIBaseWindow> browserBaseWindow = do_QueryInterface(mWebBrowser);
-
-    mNativeWindow = WebBrowserChromeUI::CreateNativeWindow(static_cast<nsIWebBrowserChrome*>(this));
-
-    if (!mNativeWindow)
-        return NS_ERROR_FAILURE;
-
-    browserBaseWindow->InitWindow( mNativeWindow,
-                             nsnull, 
-                             aX, aY, aCX, aCY);
-    browserBaseWindow->Create();
-
-    nsCOMPtr<nsIWebProgressListener> listener(static_cast<nsIWebProgressListener*>(this));
-    nsCOMPtr<nsIWeakReference> thisListener(do_GetWeakReference(listener));
-    (void)mWebBrowser->AddWebBrowserListener(thisListener, 
-        NS_GET_IID(nsIWebProgressListener));
-
-    // The window has been created. Now register for history notifications
-    mWebBrowser->AddWebBrowserListener(thisListener, NS_GET_IID(nsISHistoryListener));
-
-    if (mWebBrowser)
-    {
-      *aBrowser = mWebBrowser;
-      NS_ADDREF(*aBrowser);
-      return NS_OK;
-    }
-    return NS_ERROR_FAILURE;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsISupports
-//*****************************************************************************   
-
-NS_IMPL_ADDREF(WebBrowserChrome)
-NS_IMPL_RELEASE(WebBrowserChrome)
-
-NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
-   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
-   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
-   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
-   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
-   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional
-   NS_INTERFACE_MAP_ENTRY(nsISHistoryListener)
-   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-   NS_INTERFACE_MAP_ENTRY(nsIObserver)
-   NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener)
-   NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
-NS_INTERFACE_MAP_END
-
-//*****************************************************************************
-// WebBrowserChrome::nsIInterfaceRequestor
-//*****************************************************************************   
-
-NS_IMETHODIMP WebBrowserChrome::GetInterface(const nsIID &aIID, void** aInstancePtr)
-{
-    NS_ENSURE_ARG_POINTER(aInstancePtr);
-
-    *aInstancePtr = 0;
-    if (aIID.Equals(NS_GET_IID(nsIDOMWindow)))
-    {
-        if (mWebBrowser)
-        {
-            return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr);
-        }
-        return NS_ERROR_NOT_INITIALIZED;
-    }
-    return QueryInterface(aIID, aInstancePtr);
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsIWebBrowserChrome
-//*****************************************************************************   
-
-NS_IMETHODIMP WebBrowserChrome::SetStatus(PRUint32 aType, const PRUnichar* aStatus)
-{
-    WebBrowserChromeUI::UpdateStatusBarText(this, aStatus);
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::GetWebBrowser(nsIWebBrowser** aWebBrowser)
-{
-    NS_ENSURE_ARG_POINTER(aWebBrowser);
-    *aWebBrowser = mWebBrowser;
-    NS_IF_ADDREF(*aWebBrowser);
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::SetWebBrowser(nsIWebBrowser* aWebBrowser)
-{
-    mWebBrowser = aWebBrowser;
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::GetChromeFlags(PRUint32* aChromeMask)
-{
-    *aChromeMask = mChromeFlags;
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::SetChromeFlags(PRUint32 aChromeMask)
-{
-    mChromeFlags = aChromeMask;
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::DestroyBrowserWindow(void)
-{
-    WebBrowserChromeUI::Destroy(this);
-    return NS_OK;
-}
-
-
-// IN: The desired browser client area dimensions.
-NS_IMETHODIMP WebBrowserChrome::SizeBrowserTo(PRInt32 aWidth, PRInt32 aHeight)
-{
-  /* This isn't exactly correct: we're setting the whole window to
-     the size requested for the browser. At time of writing, though,
-     it's fine and useful for os2Embed's purposes. */
-  WebBrowserChromeUI::SizeTo(this, aWidth, aHeight);
-  mSizeSet = PR_TRUE;
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP WebBrowserChrome::ShowAsModal(void)
-{
-  if (mDependentParent)
-    EnableChromeWindow(mDependentParent, PR_FALSE);
-
-  mContinueModalLoop = PR_TRUE;
-  RunEventLoop(mContinueModalLoop);
-
-  if (mDependentParent)
-    EnableChromeWindow(mDependentParent, PR_TRUE);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::IsWindowModal(PRBool *_retval)
-{
-    *_retval = PR_FALSE;
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP WebBrowserChrome::ExitModalEventLoop(nsresult aStatus)
-{
-  mContinueModalLoop = PR_FALSE;
-  return NS_OK;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsIWebBrowserChromeFocus
-//*****************************************************************************
-
-NS_IMETHODIMP WebBrowserChrome::FocusNextElement()
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP WebBrowserChrome::FocusPrevElement()
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsIWebProgressListener
-//*****************************************************************************   
-
-NS_IMETHODIMP WebBrowserChrome::OnProgressChange(nsIWebProgress *progress, nsIRequest *request,
-                                                  PRInt32 curSelfProgress, PRInt32 maxSelfProgress,
-                                                  PRInt32 curTotalProgress, PRInt32 maxTotalProgress)
-{
-    WebBrowserChromeUI::UpdateProgress(this, curTotalProgress, maxTotalProgress);
-    return NS_OK;
-}
-
-NS_IMETHODIMP WebBrowserChrome::OnStateChange(nsIWebProgress *progress, nsIRequest *request,
-                                               PRUint32 progressStateFlags, nsresult status)
-{
-    if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
-    {
-        WebBrowserChromeUI::UpdateBusyState(this, PR_TRUE);
-    }
-
-    if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
-    {
-        WebBrowserChromeUI::UpdateBusyState(this, PR_FALSE);
-        WebBrowserChromeUI::UpdateProgress(this, 0, 100);
-        WebBrowserChromeUI::UpdateStatusBarText(this, nsnull);
-        ContentFinishedLoading();
-    }
-
-    return NS_OK;
-}
-
-
-NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress* aWebProgress,
-                                                 nsIRequest* aRequest,
-                                                 nsIURI *location)
-{
-  PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
-  if (aWebProgress) {
-    nsCOMPtr<nsIDOMWindow>  domWindow;
-    nsCOMPtr<nsIDOMWindow>  topDomWindow;
-    aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
-    if (domWindow) { // Get root domWindow
-      domWindow->GetTop(getter_AddRefs(topDomWindow));
-    }
-    if (domWindow != topDomWindow)
-      isSubFrameLoad = PR_TRUE;
-  }
-  if (!isSubFrameLoad)
-    WebBrowserChromeUI::UpdateCurrentURI(this);
-  return NS_OK;
-}
-
-NS_IMETHODIMP 
-WebBrowserChrome::OnStatusChange(nsIWebProgress* aWebProgress,
-                                 nsIRequest* aRequest,
-                                 nsresult aStatus,
-                                 const PRUnichar* aMessage)
-{
-    WebBrowserChromeUI::UpdateStatusBarText(this, aMessage);
-    return NS_OK;
-}
-
-
-
-NS_IMETHODIMP 
-WebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress, 
-                                    nsIRequest *aRequest, 
-                                    PRUint32 state)
-{
-    return NS_OK;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsISHistoryListener
-//*****************************************************************************   
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryNewEntry(nsIURI * aNewURI)
-{
-    return SendHistoryStatusMessage(aNewURI, "add");
-}
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryGoBack(nsIURI * aBackURI, PRBool * aContinue)
-{
-    // For now, let the operation continue
-    *aContinue = PR_TRUE;
-    return SendHistoryStatusMessage(aBackURI, "back");
-}
-
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryGoForward(nsIURI * aForwardURI, PRBool * aContinue)
-{
-    // For now, let the operation continue
-    *aContinue = PR_TRUE;
-    return SendHistoryStatusMessage(aForwardURI, "forward");
-}
-
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryGotoIndex(PRInt32 aIndex, nsIURI * aGotoURI, PRBool * aContinue)
-{
-    // For now, let the operation continue
-    *aContinue = PR_TRUE;
-    return SendHistoryStatusMessage(aGotoURI, "goto", aIndex);
-}
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryReload(nsIURI * aURI, PRUint32 aReloadFlags, PRBool * aContinue)
-{
-    // For now, let the operation continue
-    *aContinue = PR_TRUE;
-    return SendHistoryStatusMessage(aURI, "reload", 0 /* no info to pass here */, aReloadFlags);
-}
-
-NS_IMETHODIMP
-WebBrowserChrome::OnHistoryPurge(PRInt32 aNumEntries, PRBool *aContinue)
-{
-    // For now let the operation continue
-    *aContinue = PR_FALSE;
-    return SendHistoryStatusMessage(nsnull, "purge", aNumEntries);
-}
-
-nsresult
-WebBrowserChrome::SendHistoryStatusMessage(nsIURI * aURI, char * operation, PRInt32 info1, PRUint32 aReloadFlags)
-{
-    nsCAutoString uriCStr;
-    if (aURI)
-    {
-        aURI->GetSpec(uriCStr);
-    }
-
-    nsString uriAStr;
-
-    if(!(nsCRT::strcmp(operation, "back")))
-    {
-        // Going back. XXX Get string from a resource file
-        uriAStr.AppendLiteral("Going back to url:");
-        AppendUTF8toUTF16(uriCStr, uriAStr);
-    }
-    else if (!(nsCRT::strcmp(operation, "forward")))
-    {
-        // Going forward. XXX Get string from a resource file
-        uriAStr.AppendLiteral("Going forward to url:");
-        AppendUTF8toUTF16(uriCStr, uriAStr);
-    }
-    else if (!(nsCRT::strcmp(operation, "reload")))
-    {
-        // Reloading. XXX Get string from a resource file
-        if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY && 
-            aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
-        {
-            uriAStr.Append(NS_LITERAL_STRING("Reloading url,(bypassing proxy and cache) :"));
-        }
-        else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_PROXY)
-        {
-            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing proxy):"));
-        }
-        else if (aReloadFlags & nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE)
-        {
-            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (bypassing cache):"));
-        }
-        else
-        {
-            uriAStr.Append(NS_LITERAL_STRING("Reloading url, (normal):"));
-        }
-        AppendUTF8toUTF16(uriCStr, uriAStr);
-    }
-    else if (!(nsCRT::strcmp(operation, "add")))
-    {
-        // Adding new entry. XXX Get string from a resource file
-        AppendUTF8toUTF16(uriCStr, uriAStr);
-        uriAStr.AppendLiteral(" added to session History");
-    }
-    else if (!(nsCRT::strcmp(operation, "goto")))
-    {
-        // Goto. XXX Get string from a resource file
-        uriAStr.AppendLiteral("Going to HistoryIndex:");
-        uriAStr.AppendInt(info1);
-        uriAStr.AppendLiteral(" Url:");
-        AppendUTF8toUTF16(uriCStr, uriAStr);
-    }
-    else if (!(nsCRT::strcmp(operation, "purge")))
-    {
-        // Purging old entries
-        uriAStr.AppendInt(info1);
-        uriAStr.AppendLiteral(" purged from Session History");
-    }
-
-    WebBrowserChromeUI::UpdateStatusBarText(this, uriAStr.get());
-
-    return NS_OK;
-}
-
-void WebBrowserChrome::ContentFinishedLoading()
-{
-  // if it was a chrome window and no one has already specified a size,
-  // size to content
-  if (mWebBrowser && !mSizeSet &&
-     (mChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME)) {
-    nsCOMPtr<nsIDOMWindow> contentWin;
-    mWebBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
-    if (contentWin)
-        contentWin->SizeToContent();
-    WebBrowserChromeUI::ShowWindow(this, PR_TRUE);
-  }
-}
-
-
-//*****************************************************************************
-// WebBrowserChrome::nsIEmbeddingSiteWindow
-//*****************************************************************************   
-
-NS_IMETHODIMP WebBrowserChrome::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP WebBrowserChrome::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
-{
-    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
-    {
-        *x = 0;
-        *y = 0;
-    }
-    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER ||
-        aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
-    {
-        *cx = 0;
-        *cy = 0;
-    }
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* void setFocus (); */
-NS_IMETHODIMP WebBrowserChrome::SetFocus()
-{
-    WebBrowserChromeUI::SetFocus(this);
-    return NS_OK;
-}
-
-/* attribute wstring title; */
-NS_IMETHODIMP WebBrowserChrome::GetTitle(PRUnichar * *aTitle)
-{
-   NS_ENSURE_ARG_POINTER(aTitle);
-
-   *aTitle = nsnull;
-   
-   return NS_ERROR_NOT_IMPLEMENTED;
-}
-NS_IMETHODIMP WebBrowserChrome::SetTitle(const PRUnichar * aTitle)
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* attribute boolean visibility; */
-NS_IMETHODIMP WebBrowserChrome::GetVisibility(PRBool * aVisibility)
-{
-    NS_ENSURE_ARG_POINTER(aVisibility);
-    *aVisibility = PR_TRUE;
-    return NS_OK;
-}
-NS_IMETHODIMP WebBrowserChrome::SetVisibility(PRBool aVisibility)
-{
-    return NS_OK;
-}
-
-/* attribute nativeSiteWindow siteWindow */
-NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void * *aSiteWindow)
-{
-   NS_ENSURE_ARG_POINTER(aSiteWindow);
-
-   *aSiteWindow = mNativeWindow;
-   return NS_OK;
-}
-
-
-//*****************************************************************************
-// WebBrowserChrome::nsIObserver
-//*****************************************************************************   
-
-NS_IMETHODIMP WebBrowserChrome::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
-{
-    nsresult rv = NS_OK;
-    if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0)
-    {
-        // A profile change means death for this window
-        WebBrowserChromeUI::Destroy(this);
-    }
-    return rv;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsIContextMenuListener
-//*****************************************************************************   
-
-/* void OnShowContextMenu (in unsigned long aContextFlags, in nsIDOMEvent aEvent, in nsIDOMNode aNode); */
-NS_IMETHODIMP WebBrowserChrome::OnShowContextMenu(PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode)
-{
-    WebBrowserChromeUI::ShowContextMenu(this, aContextFlags, aEvent, aNode);
-    return NS_OK;
-}
-
-//*****************************************************************************
-// WebBrowserChrome::nsITooltipListener
-//*****************************************************************************   
-
-/* void OnShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */
-NS_IMETHODIMP WebBrowserChrome::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
-{
-    WebBrowserChromeUI::ShowTooltip(this, aXCoords, aYCoords, aTipText);
-    return NS_OK;
-}
-
-/* void OnHideTooltip (); */
-NS_IMETHODIMP WebBrowserChrome::OnHideTooltip()
-{
-    WebBrowserChromeUI::HideTooltip(this);
-    return NS_OK;
-}
deleted file mode 100644
--- a/embedding/tests/os2Embed/WebBrowserChrome.h
+++ /dev/null
@@ -1,121 +0,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __WebBrowserChrome__
-#define __WebBrowserChrome__
-
-#include "nsCOMPtr.h"
-#include "nsIGenericFactory.h"
-#include "nsString.h"
-#include "nsIWebBrowserChrome.h"
-#include "nsIWebBrowserChromeFocus.h"
-
-#include "nsIDocShell.h"
-#include "nsIContentViewer.h"
-#include "nsIContentViewerFile.h"
-#include "nsIBaseWindow.h"
-#include "nsIEmbeddingSiteWindow.h"
-#include "nsIWebNavigation.h"
-#include "nsIWebProgressListener.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIWebBrowser.h"
-#include "nsIObserver.h"
-#include "nsWeakReference.h"
-#include "nsISHistoryListener.h"
-#include "nsIContextMenuListener.h"
-#include "nsITooltipListener.h"
-
-class WebBrowserChromeUI
-{
-public:
-    static nativeWindow CreateNativeWindow(nsIWebBrowserChrome* chrome);
-    static void Destroy(nsIWebBrowserChrome* chrome);
-    static void Destroyed(nsIWebBrowserChrome* chrome);
-    static void SetFocus(nsIWebBrowserChrome *chrome);
-    static void UpdateStatusBarText(nsIWebBrowserChrome *aChrome, const PRUnichar* aStatusText);
-    static void UpdateCurrentURI(nsIWebBrowserChrome *aChrome);
-    static void UpdateBusyState(nsIWebBrowserChrome *aChrome, PRBool aBusy);
-    static void UpdateProgress(nsIWebBrowserChrome *aChrome, PRInt32 aCurrent, PRInt32 aMax);
-    static void GetResourceStringById(PRInt32 aID, char ** aReturn);
-    static void ShowContextMenu(nsIWebBrowserChrome *aChrome, PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode);
-    static void ShowTooltip(nsIWebBrowserChrome *aChrome, PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText);
-    static void HideTooltip(nsIWebBrowserChrome *aChrome);
-    static void ShowWindow(nsIWebBrowserChrome *aChrome, PRBool aShow);
-    static void SizeTo(nsIWebBrowserChrome *aChrome, PRInt32 aWidth, PRInt32 aHeight);
-};
-
-class WebBrowserChrome   : public nsIWebBrowserChrome,
-                           public nsIWebBrowserChromeFocus,
-                           public nsIWebProgressListener,
-                           public nsIEmbeddingSiteWindow,
-                           public nsIInterfaceRequestor,
-                           public nsISHistoryListener,
-                           public nsIObserver,
-                           public nsIContextMenuListener,
-                           public nsITooltipListener,
-                           public nsSupportsWeakReference
-
-{
-public:
-    WebBrowserChrome();
-    virtual ~WebBrowserChrome();
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIWEBBROWSERCHROME
-    NS_DECL_NSIWEBBROWSERCHROMEFOCUS
-    NS_DECL_NSIWEBPROGRESSLISTENER
-    NS_DECL_NSIEMBEDDINGSITEWINDOW
-    NS_DECL_NSIINTERFACEREQUESTOR
-    NS_DECL_NSISHISTORYLISTENER
-    NS_DECL_NSIOBSERVER
-    NS_DECL_NSICONTEXTMENULISTENER
-    NS_DECL_NSITOOLTIPLISTENER
-
-    nsresult CreateBrowser(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY,
-                           nsIWebBrowser **aBrowser);
-
-    void     SetParent(nsIWebBrowserChrome *aParent)
-               { mDependentParent = aParent; }
-   
-protected:
-    nsresult SendHistoryStatusMessage(nsIURI * aURI, char * operation, PRInt32 info1=0, PRUint32 info2=0);
-
-    void ContentFinishedLoading();
-
-    nativeWindow mNativeWindow;
-    PRUint32     mChromeFlags;
-    PRBool       mContinueModalLoop;
-    PRBool       mSizeSet;
-
-    nsCOMPtr<nsIWebBrowser> mWebBrowser;
-    nsCOMPtr<nsIWebBrowserChrome> mDependentParent; // opener (for dependent windows only)
-};
-
-#endif /* __WebBrowserChrome__ */
deleted file mode 100644
--- a/embedding/tests/os2Embed/WindowCreator.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "nsIWebBrowserChrome.h"
-#include "WindowCreator.h"
-#include "os2Embed.h"
-
-WindowCreator::WindowCreator()
-{
-}
-
-WindowCreator::~WindowCreator()
-{
-}
-
-NS_IMPL_ISUPPORTS1(WindowCreator, nsIWindowCreator)
-
-NS_IMETHODIMP
-WindowCreator::CreateChromeWindow(nsIWebBrowserChrome *parent,
-                                  PRUint32 chromeFlags,
-                                  nsIWebBrowserChrome **_retval)
-{
-    NS_ENSURE_ARG_POINTER(_retval);
-    CreateBrowserWindow(PRInt32(chromeFlags), parent, _retval);
-    return *_retval ? NS_OK : NS_ERROR_FAILURE;
-}
deleted file mode 100644
--- a/embedding/tests/os2Embed/WindowCreator.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __WindowCreator_h_
-#define __WindowCreator_h_
-
-#include "nsIWindowCreator.h"
-
-class WindowCreator :
-      public nsIWindowCreator
-{
-public:
-    WindowCreator();
-    virtual ~WindowCreator();
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIWINDOWCREATOR
-};
-
-#endif
-
deleted file mode 100644
index 2f28f20e1466692053ba37c12ef4748d065095fc..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
--- a/embedding/tests/os2Embed/os2Embed.cpp
+++ /dev/null
@@ -1,1479 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *   Doug Turner <dougt@netscape.com>
- *   Adam Lock <adamlock@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include <stdio.h>
-
-// OS/2 header files
-#define INCL_WIN
-#define INCL_DOS
-#include <os2.h>
-
-// Mozilla header files
-#include "nsEmbedAPI.h"
-#include "nsWeakReference.h"
-#include "nsIClipboardCommands.h"
-#include "nsXPIDLString.h"
-#include "nsIWebBrowserPersist.h"
-#include "nsIWebBrowserFocus.h"
-#include "nsIWindowWatcher.h"
-#include "nsIProfile.h"
-#include "nsIObserverService.h"
-#include "nsIObserver.h"
-#include "nsIProfileChangeStatus.h"
-#include "nsIURI.h"
-#include "plstr.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsCRT.h"
-
-// Local header files
-#include "os2Embed.h"
-#include "WebBrowserChrome.h"
-#include "WindowCreator.h"
-#include "resource.h"
-#include "nsStaticComponents.h"
-
-// Printing header files
-#include "nsIPrintSettings.h"
-#include "nsIWebBrowserPrint.h"
-
-#define MAX_LOADSTRING 100
-
-
-#ifndef _BUILD_STATIC_BIN
-nsStaticModuleInfo const *const kPStaticModules = nsnull;
-PRUint32 const kStaticModuleCount = 0;
-#endif
-
-const CHAR *szWindowClass = "OS2EMBED";
-
-// Foward declarations of functions included in this code module:
-static void             MyRegisterClass();
-static MRESULT EXPENTRY BrowserWndProc(HWND, ULONG, MPARAM, MPARAM);
-static MRESULT EXPENTRY BrowserDlgProc(HWND hwndDlg, ULONG uMsg, MPARAM wParam, MPARAM lParam);
-
-static nsresult InitializeWindowCreator();
-static nsresult OpenWebPage(const char * url);
-static nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome);
-
-// Profile chooser stuff
-static BOOL ChooseNewProfile(BOOL bShowForMultipleProfilesOnly, const char *szDefaultProfile);
-static MRESULT EXPENTRY ChooseProfileDlgProc(HWND, ULONG, MPARAM, MPARAM);
-
-// Global variables
-static UINT gDialogCount = 0;
-static BOOL gProfileSwitch = FALSE;
-static HMODULE ghInstanceResources = NULL;
-static char gFirstURL[1024];
-
-// A list of URLs to populate the URL drop down list with
-static const CHAR *gDefaultURLs[] = 
-{
-    ("http://www.mozilla.org/"),
-    ("http://www.netscape.com/"),
-    ("http://browsertest.web.aol.com/tests/javascript/javascpt/index.htm"),
-    ("http://127.0.0.1/"),
-    ("http://www.yahoo.com/"),
-    ("http://www.travelocity.com/"),
-    ("http://www.disney.com/"),
-    ("http://www.go.com/"),
-    ("http://www.google.com/"),
-    ("http://www.ebay.com/"),
-    ("http://www.shockwave.com/"),
-    ("http://www.slashdot.org/"),
-    ("http://www.quicken.com/"),
-    ("http://www.hotmail.com/"),
-    ("http://www.cnn.com/"),
-    ("http://www.javasoft.com/")
-};
-
-class ProfileChangeObserver : public nsIObserver,
-                              public nsSupportsWeakReference
-
-{
-public:
-	 ProfileChangeObserver();
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIOBSERVER
-};
-
-
-int main(int argc, char *argv[])
-{
-    printf("You are embedded, man!\n\n");
-
-    // Sophisticated command-line parsing in action
-    char *szFirstURL = "http://www.mozilla.org/projects/embedding";
-    char *szDefaultProfile = nsnull;
-    int argn;
-    for (argn = 1; argn < argc; argn++)
-    {
-        if (stricmp("-P", argv[argn]) == 0)
-        {
-            if (argn + 1 < argc)
-            {
-                szDefaultProfile = argv[++argn];
-            }
-        }
-        else
-        {
-            szFirstURL = argv[argn];
-        }
-    }
-    strncpy(gFirstURL, szFirstURL, sizeof(gFirstURL) - 1);
-
-    // Initialize global strings
-    CHAR szTitle[MAX_LOADSTRING];
-    WinLoadString((HAB)0, ghInstanceResources, IDS_APP_TITLE, MAX_LOADSTRING, szTitle);
-    MyRegisterClass();
-
-    // Init Embedding APIs
-    NS_InitEmbedding(nsnull, nsnull, kPStaticModules, kStaticModuleCount);
-
-    // Choose the new profile
-    if (!ChooseNewProfile(TRUE, szDefaultProfile))
-    {
-        NS_TermEmbedding();
-        return 1;
-    }
-    MPARAM rv;
-    {    
-    	// Now register an observer to watch for profile changes
-        nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1"));
-
-        ProfileChangeObserver *observer = new ProfileChangeObserver;
-        observer->AddRef();
-        observerService->AddObserver(static_cast<nsIObserver *>(observer), "profile-approve-change", PR_TRUE);
-        observerService->AddObserver(static_cast<nsIObserver *>(observer), "profile-change-teardown", PR_TRUE);
-        observerService->AddObserver(static_cast<nsIObserver *>(observer), "profile-after-change", PR_TRUE);
-
-        InitializeWindowCreator();
-
-        // Open the initial browser window
-        OpenWebPage(gFirstURL);
-
-        // Main message loop.
-        // NOTE: We use a fake event and a timeout in order to process idle stuff for
-        //       Mozilla every 1/10th of a second.
-        PRBool runCondition = PR_TRUE;
-
-        rv = (MPARAM)RunEventLoop(runCondition);
-
-        observer->Release();
-    }
-    // Close down Embedding APIs
-    NS_TermEmbedding();
-
-    return (int)rv;
-}
-
-//-----------------------------------------------------------------------------
-// ProfileChangeObserver
-//-----------------------------------------------------------------------------
-
-NS_IMPL_THREADSAFE_ISUPPORTS2(ProfileChangeObserver, nsIObserver, nsISupportsWeakReference)
-
-ProfileChangeObserver::ProfileChangeObserver()
-{
-}
-
-// ---------------------------------------------------------------------------
-//  CMfcEmbedApp : nsIObserver
-// ---------------------------------------------------------------------------
-
-NS_IMETHODIMP ProfileChangeObserver::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
-{
-    nsresult rv = NS_OK;
-
-    if (nsCRT::strcmp(aTopic, "profile-approve-change") == 0)
-    {
-		// The profile is about to change!
-
-        // Ask the user if they want to
-        int result = ::WinMessageBox(HWND_DESKTOP, NULL, "Do you want to close all windows in order to switch the profile?", "Confirm", 101, MB_YESNO | MB_ICONQUESTION);
-        if (result != MBID_YES)
-        {
-            nsCOMPtr<nsIProfileChangeStatus> status = do_QueryInterface(aSubject);
-            NS_ENSURE_TRUE(status, NS_ERROR_FAILURE);
-            status->VetoChange();
-        }
-    }
-    else if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0)
-    {
-		// The profile is changing!
-
-		// Prevent WM_QUIT by incrementing the dialog count
-		gDialogCount++;
-    }
-    else if (nsCRT::strcmp(aTopic, "profile-after-change") == 0)
-    {
-		// Decrease the dialog count so WM_QUIT can once more happen
-		gDialogCount--;
-        if (gDialogCount == 0)
-        {
-            // All the dialogs have been torn down so open new page
-            OpenWebPage(gFirstURL);
-        }
-        else
-        {
-		    // The profile has changed, but dialogs are still being
-            // torn down. Set this flag so when the last one goes
-            // it can finish the switch.
-            gProfileSwitch = TRUE;
-        }
-    }
-
-    return rv;
-}
-
-/* InitializeWindowCreator creates and hands off an object with a callback
-   to a window creation function. This is how all new windows are opened,
-   except any created directly by the embedding app. */
-nsresult InitializeWindowCreator()
-{
-    // create an nsWindowCreator and give it to the WindowWatcher service
-    WindowCreator *creatorCallback = new WindowCreator();
-    if (creatorCallback)
-    {
-        nsCOMPtr<nsIWindowCreator> windowCreator(static_cast<nsIWindowCreator *>(creatorCallback));
-        if (windowCreator)
-        {
-            nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
-            if (wwatch)
-            {
-                wwatch->SetWindowCreator(windowCreator);
-                return NS_OK;
-            }
-        }
-    }
-    return NS_ERROR_FAILURE;
-}
-
-//-----------------------------------------------------------------------------
-
-//
-//  FUNCTION: OpenWebPage()
-//
-//  PURPOSE: Opens a new browser dialog and starts it loading to the
-//           specified url.
-//
-nsresult OpenWebPage(const char *url)
-{
-    nsresult  rv;
-
-    // Create the chrome object. Note that it leaves this function
-    // with an extra reference so that it can released correctly during
-    // destruction (via Win32UI::Destroy)
-
-    nsCOMPtr<nsIWebBrowserChrome> chrome;
-    rv = CreateBrowserWindow(nsIWebBrowserChrome::CHROME_ALL,
-           nsnull, getter_AddRefs(chrome));
-    if (NS_SUCCEEDED(rv))
-    {
-        // Start loading a page
-        nsCOMPtr<nsIWebBrowser> newBrowser;
-        chrome->GetWebBrowser(getter_AddRefs(newBrowser));
-        nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(newBrowser));
-        return webNav->LoadURI(NS_ConvertASCIItoUTF16(url).get(),
-                               nsIWebNavigation::LOAD_FLAGS_NONE,
-                               nsnull,
-                               nsnull,
-                               nsnull);
-    }
-
-    return rv;
-}   
-
-//
-//  FUNCTION: GetBrowserFromChrome()
-//
-//  PURPOSE: Returns the HWND for the webbrowser container associated
-//           with the specified chrome.
-//
-HWND GetBrowserFromChrome(nsIWebBrowserChrome *aChrome)
-{
-    if (!aChrome)
-    {
-        return NULL;
-    }
-    nsCOMPtr<nsIEmbeddingSiteWindow> baseWindow = do_QueryInterface(aChrome);
-    HWND hwnd = NULL;
-    baseWindow->GetSiteWindow((void **) & hwnd);
-    return hwnd;
-}
-
-
-//
-//  FUNCTION: GetBrowserDlgFromChrome()
-//
-//  PURPOSE: Returns the HWND for the browser dialog associated with
-//           the specified chrome.
-//
-HWND GetBrowserDlgFromChrome(nsIWebBrowserChrome *aChrome)
-{
-    return WinQueryWindow(GetBrowserFromChrome(aChrome), QW_PARENT);
-}
-
-
-//
-//  FUNCTION: SaveWebPage()
-//
-//  PURPOSE: Saves the contents of the web page to a file
-//
-void SaveWebPage(HWND hDlg, nsIWebBrowser *aWebBrowser)
-{
-    // Use the browser window title as the initial file name
-    nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(aWebBrowser);
-    nsXPIDLString windowTitle;
-    webBrowserAsWin->GetTitle(getter_Copies(windowTitle));
-    nsCString fileName; fileName.AssignWithConversion(windowTitle);
-
-	// Sanitize the title of all illegal characters
-    fileName.CompressWhitespace();     // Remove whitespace from the ends
-    fileName.StripChars("\\*|:\"><?"); // Strip illegal characters
-    fileName.ReplaceChar('.', L'_');   // Dots become underscores
-    fileName.ReplaceChar('/', L'-');   // Forward slashes become hyphens
-    fileName.ReplaceChar(' ', L'_');   // Spaces become underscores
-
-    // Initialize the file save as information structure
-    FILEDLG saveFileNameInfo;
-    memset(&saveFileNameInfo, 0, sizeof(saveFileNameInfo));
-    saveFileNameInfo.cbSize = sizeof(saveFileNameInfo);
-    PL_strncpyz(saveFileNameInfo.szFullFile, fileName.get(), CCHMAXPATH);
-    strcat(saveFileNameInfo.szFullFile, ".html");
-
-    PSZ *apszTypeList = (PSZ *)malloc(3 * sizeof(PSZ) + 1);
-    apszTypeList[0] = "Web Page, HTML Only (*.htm;*.html)";
-    apszTypeList[1] = "Web Page, Complete (*.htm;*.html)";
-    apszTypeList[2] = "Text File (*.txt)";
-    apszTypeList[3] = 0;
-    saveFileNameInfo.papszITypeList = (PAPSZ)apszTypeList; 
-    saveFileNameInfo.pszTitle = NULL; 
-    saveFileNameInfo.fl = FDS_SAVEAS_DIALOG | FDS_CENTER | FDS_ENABLEFILELB; 
-    saveFileNameInfo.pszIType = apszTypeList[0];
-
-    WinFileDlg(HWND_DESKTOP, hDlg, &saveFileNameInfo);
-    if (saveFileNameInfo.lReturn == DID_OK)  
-    {
-        char *pszDataPath = NULL;
-        static char szDataFile[_MAX_PATH];
-        char szDataPath[_MAX_PATH];
-        char drive[_MAX_DRIVE];
-        char dir[_MAX_DIR];
-        char fname[_MAX_FNAME];
-        char ext[_MAX_EXT];
-
-        _splitpath(saveFileNameInfo.szFullFile, drive, dir, fname, ext);
-        //add the extension to the filename if there is no extension already
-        if (strcmp(ext, "") == 0) {
-          if ((saveFileNameInfo.sEAType == 2) && (stricmp(ext, ".txt") != 0)) {
-            strcat(saveFileNameInfo.szFullFile, ".txt");
-            strcpy(ext, ".txt");
-          } else 
-            if ((stricmp(ext, ".html") != 0) && (stricmp(ext, ".htm") != 0)) {
-              strcat(saveFileNameInfo.szFullFile, ".html");
-              strcpy(ext, ".html");
-          }
-        }
-
-        // Does the user want to save the complete document including
-        // all frames, images, scripts, stylesheets etc. ?
-        if (saveFileNameInfo.sEAType == 1) //apszTypeList[1] means save everything
-        {
-            sprintf(szDataFile, "%s_files", fname);
-            _makepath(szDataPath, drive, dir, szDataFile, "");
-
-            pszDataPath = szDataPath;
-       }
-
-        // Save away
-        nsCOMPtr<nsIWebBrowserPersist> persist(do_QueryInterface(aWebBrowser));
-
-        nsCOMPtr<nsILocalFile> file;
-        NS_NewNativeLocalFile(nsDependentCString(saveFileNameInfo.szFullFile), TRUE, getter_AddRefs(file));
-
-        nsCOMPtr<nsILocalFile> dataPath;
-        if (pszDataPath)
-        {
-            NS_NewNativeLocalFile(nsDependentCString(pszDataPath), TRUE, getter_AddRefs(dataPath));
-        }
-
-        persist->SaveDocument(nsnull, file, dataPath, nsnull, 0, 0);
-    }
-    if (saveFileNameInfo.papszFQFilename) 
-       WinFreeFileDlgList(saveFileNameInfo.papszFQFilename);
-    for (int i = 0; i < 3; i++)
-       free(saveFileNameInfo.papszITypeList[i]);
-    free(saveFileNameInfo.papszITypeList);
-}
-
-
-//
-//  FUNCTION: ResizeEmbedding()
-//
-//  PURPOSE: Resizes the webbrowser window to fit its container.
-//
-nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome)
-{
-    if (!chrome)
-        return NS_ERROR_FAILURE;
-    
-    nsCOMPtr<nsIEmbeddingSiteWindow> embeddingSite = do_QueryInterface(chrome);
-    HWND hWnd;
-	embeddingSite->GetSiteWindow((void **) & hWnd);
-    
-    if (!hWnd)
-        return NS_ERROR_NULL_POINTER;
-    
-    RECTL rect;
-    WinQueryWindowRect(hWnd, &rect);
-    
-    // Make sure the browser is visible and sized
-    nsCOMPtr<nsIWebBrowser> webBrowser;
-    chrome->GetWebBrowser(getter_AddRefs(webBrowser));
-    nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(webBrowser);
-    if (webBrowserAsWin)
-    {
-        webBrowserAsWin->SetPositionAndSize(rect.xLeft, 
-                                            rect.yBottom, 
-                                            rect.xRight - rect.xLeft,
-                                            rect.yTop - rect.yBottom,
-                                            PR_TRUE);
-        webBrowserAsWin->SetVisibility(PR_TRUE);
-	}
-
-    return NS_OK;
-}
-
-
-//
-//  FUNCTION: MyRegisterClass()
-//
-//  PURPOSE: Registers the window class.
-//
-//  COMMENTS:
-//
-//
-void MyRegisterClass()
-{
-    WinRegisterClass((HAB)0, szWindowClass, BrowserWndProc, CS_SIZEREDRAW, sizeof(ULONG));
-}
-
-
-//
-//  FUNCTION: UpdateUI()
-//
-//  PURPOSE: Refreshes the buttons and menu items in the browser dialog
-//
-void UpdateUI(nsIWebBrowserChrome *aChrome)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(aChrome);
-    nsCOMPtr<nsIWebBrowser> webBrowser;
-    nsCOMPtr<nsIWebNavigation> webNavigation;
-    aChrome->GetWebBrowser(getter_AddRefs(webBrowser));
-    webNavigation = do_QueryInterface(webBrowser);
-
-    PRBool canGoBack = PR_FALSE;
-    PRBool canGoForward = PR_FALSE;
-    if (webNavigation)
-    {
-        webNavigation->GetCanGoBack(&canGoBack);
-        webNavigation->GetCanGoForward(&canGoForward);
-    }
-
-    PRBool canCutSelection = PR_FALSE;
-    PRBool canCopySelection = PR_FALSE;
-    PRBool canPaste = PR_FALSE;
-
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-    if (clipCmds)
-    {
-        clipCmds->CanCutSelection(&canCutSelection);
-        clipCmds->CanCopySelection(&canCopySelection);
-        clipCmds->CanPaste(&canPaste);
-    }
-
-    HWND hmenu = WinWindowFromID(hwndDlg, FID_MENU);
-    if (hmenu)
-    {
-        MENUITEM goMenu, editMenu;
-        WinSendMsg(hmenu, MM_QUERYITEM, MPFROM2SHORT(MOZ_Go, TRUE), (MPARAM)&goMenu);
-        WinEnableMenuItem(goMenu.hwndSubMenu, MOZ_GoBack, canGoBack);
-        WinEnableMenuItem(goMenu.hwndSubMenu, MOZ_GoForward, canGoForward);
-
-        WinSendMsg(hmenu, MM_QUERYITEM, MPFROM2SHORT(MOZ_Edit, TRUE), (MPARAM)&editMenu);
-        WinEnableMenuItem(editMenu.hwndSubMenu, MOZ_Cut, canCutSelection);
-        WinEnableMenuItem(editMenu.hwndSubMenu, MOZ_Copy, canCopySelection);
-        WinEnableMenuItem(editMenu.hwndSubMenu, MOZ_Paste, canPaste);
-    }
-
-    HWND button;
-    button = WinWindowFromID(hwndDlg, IDC_BACK);
-    if (button)
-      WinEnableWindow(button, canGoBack);
-    button = WinWindowFromID(hwndDlg, IDC_FORWARD);
-    if (button)
-      WinEnableWindow(button, canGoForward);
-}
-
-
-//
-//  FUNCTION: BrowserDlgProc()
-//
-//  PURPOSE: Browser dialog windows message handler.
-//
-//  COMMENTS:
-//
-//    The code for handling buttons and menu actions is here.
-//
-MRESULT EXPENTRY BrowserDlgProc(HWND hwndDlg, ULONG uMsg, MPARAM wParam, MPARAM lParam)
-{
-    if (uMsg == WM_COMMAND && SHORT1FROMMP(wParam) == MOZ_SwitchProfile)
-    {
-       ChooseNewProfile(FALSE, NULL);
-       return (MRESULT)FALSE;
-    }
-
-    // Get the browser and other pointers since they are used a lot below
-    HWND hwndBrowser = WinWindowFromID(hwndDlg, IDC_BROWSER);
-    nsIWebBrowserChrome *chrome = nsnull ;
-    if (hwndBrowser)
-    {
-        chrome = (nsIWebBrowserChrome *) WinQueryWindowULong(hwndBrowser, QWL_USER);
-    }
-    nsCOMPtr<nsIWebBrowser> webBrowser;
-    nsCOMPtr<nsIWebNavigation> webNavigation;
-    nsCOMPtr<nsIWebBrowserPrint> webBrowserPrint;
-    if (chrome)
-    {
-        chrome->GetWebBrowser(getter_AddRefs(webBrowser));
-        webNavigation = do_QueryInterface(webBrowser);
-        webBrowserPrint = do_GetInterface(webBrowser);
-    }
-
-    // Test the message
-    switch (uMsg)
-    {
-    case WM_INITDLG:
-        return (MRESULT)TRUE;
-
-    case WM_INITMENU:
-        UpdateUI(chrome);
-        return (MRESULT)TRUE;
-
-    case WM_SYSCOMMAND:
-        if (SHORT1FROMMP(wParam) == SC_CLOSE)
-        {
-            WebBrowserChromeUI::Destroy(chrome);
-            return (MRESULT)TRUE;
-        }
-        break;
-
-    case WM_DESTROY:
-	    return (MRESULT)TRUE;
-
-    case WM_COMMAND:
-        if (!webBrowser)
-        {
-            return (MRESULT)TRUE;
-        }
-
-        // Test which command was selected
-        switch (SHORT1FROMMP(wParam))
-		{
-        case IDC_ADDRESS:
-            if (SHORT1FROMMP(wParam) == CBN_EFCHANGE || SHORT1FROMMP(wParam) == CBN_LBSELECT)
-            {
-                // User has changed the address field so enable the Go button
-                WinEnableWindow(WinWindowFromID(hwndDlg, IDC_GO), TRUE);
-            }
-            break;
-
-        case IDC_GO:
-            {
-                char szURL[2048];
-                memset(szURL, 0, sizeof(szURL));
-                WinQueryDlgItemText(hwndDlg, IDC_ADDRESS, sizeof(szURL) / sizeof(szURL[0]) - 1, szURL);
-                webNavigation->LoadURI(
-                    NS_ConvertASCIItoUTF16(szURL).get(),
-                    nsIWebNavigation::LOAD_FLAGS_NONE,
-                    nsnull,
-                    nsnull,
-                    nsnull);
-            }
-            break;
-
-        case IDC_STOP:
-            webNavigation->Stop(nsIWebNavigation::STOP_ALL);
-            UpdateUI(chrome);
-            break;
-
-        case IDC_RELOAD:
-            webNavigation->Reload(nsIWebNavigation::LOAD_FLAGS_NONE);
-            break;
-
-        case IDM_EXIT:
-            WinPostMsg(hwndDlg, WM_SYSCOMMAND, MPFROMSHORT(SC_CLOSE), 0);
-            break;
-
-        // File menu commands
-
-        case MOZ_NewBrowser:
-            OpenWebPage(gFirstURL);
-            break;
-
-        case MOZ_Save:
-            SaveWebPage(hwndDlg, webBrowser);
-            break;
-
-        case MOZ_Print:
-            {
-                // NOTE: Embedding code shouldn't need to get the docshell or
-                //       contentviewer AT ALL. This code below will break one
-                //       day but will have to do until the embedding API has
-                //       a cleaner way to do the same thing.
-              if (webBrowserPrint)
-              {
-                  nsCOMPtr<nsIPrintSettings> printSettings;
-                  webBrowserPrint->GetGlobalPrintSettings(getter_AddRefs(printSettings));
-                  NS_ASSERTION(printSettings, "You can't PrintPreview without a PrintSettings!");
-                  if (printSettings) 
-                  {
-                      printSettings->SetPrintSilent(PR_TRUE);
-                      webBrowserPrint->Print(printSettings, (nsIWebProgressListener*)nsnull);
-                  }
-              }
-            }
-            break;
-
-        // Edit menu commands
-
-        case MOZ_Cut:
-            {
-                nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-                clipCmds->CutSelection();
-            }
-            break;
-
-        case MOZ_Copy:
-            {
-                nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-                clipCmds->CopySelection();
-            }
-            break;
-
-        case MOZ_Paste:
-            {
-                nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-                clipCmds->Paste();
-            }
-            break;
-
-        case MOZ_SelectAll:
-            {
-                nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-                clipCmds->SelectAll();
-            }
-            break;
-
-        case MOZ_SelectNone:
-            {
-                nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(webBrowser);
-                clipCmds->SelectNone();
-            }
-            break;
-
-        // Go menu commands
-        case IDC_BACK:
-        case MOZ_GoBack:
-            webNavigation->GoBack();
-            UpdateUI(chrome);
-            break;
-
-        case IDC_FORWARD:
-        case MOZ_GoForward:
-            webNavigation->GoForward();
-            UpdateUI(chrome);
-            break;
-
-        // Help menu commands
-        case MOZ_About:
-            {
-                char szAboutTitle[MAX_LOADSTRING];
-                char szAbout[MAX_LOADSTRING];
-                WinLoadString((HAB)0, ghInstanceResources, IDS_ABOUT_TITLE, MAX_LOADSTRING, szAboutTitle);
-                WinLoadString((HAB)0, ghInstanceResources, IDS_ABOUT, MAX_LOADSTRING, szAbout);
-                WinMessageBox(HWND_DESKTOP, NULL, szAbout, szAboutTitle, 0, MB_OK | MB_APPLMODAL);
-            }
-            break;
-		}
-
-	    return (MRESULT)TRUE;
-
-    case WM_ACTIVATE:
-        {
-            nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(webBrowser));
-            if(focus)
-            {
-                switch (SHORT1FROMMP(wParam))
-                {
-                case TRUE: //WA_ACTIVE:
-                    focus->Activate();
-                    break;
-                case FALSE: //WA_INACTIVE:
-                    focus->Deactivate();
-                    break;
-                default:
-                    break;
-                }
-            }
-        }
-        break;
-
-    case WM_ADJUSTWINDOWPOS: 
-        {
-            PSWP swp = (PSWP)wParam;
-            if (swp->fl & (SWP_SIZE)) {
-               UINT newDlgWidth = swp->cx;
-               UINT newDlgHeight = swp->cy;
-
-               // TODO Reposition the control bar - for the moment it's fixed size
-               // Reposition all buttons, combobox, status, progress bar, and browser
-               // Status bar gets any space that the fixed size progress bar doesn't use.
-               // Address combobox gets any space not used by buttons and 'Address:'
-               int progressWidth, statusWidth, addressWidth, goWidth, forwardWidth, reloadWidth, stopWidth, backWidth, staticWidth;
-               int statusHeight, backHeight, buttonHeight, addressHeight, comboboxHeight;
-
-               HWND hwndStatus = WinWindowFromID(hwndDlg, IDC_STATUS);
-               if (hwndStatus) {
-                 RECTL rcStatus;
-                 WinQueryWindowRect(hwndStatus, &rcStatus);
-                 statusHeight = rcStatus.yTop - rcStatus.yBottom;
-               } else
-                 statusHeight = 0;
-   
-               HWND hwndProgress = WinWindowFromID(hwndDlg, IDC_PROGRESS);
-               if (hwndProgress) {
-                 RECTL rcProgress;
-                 WinQueryWindowRect(hwndProgress, &rcProgress);
-                 progressWidth = rcProgress.xRight - rcProgress.xLeft;
-               } else
-                 progressWidth = 0;
-               statusWidth = newDlgWidth - progressWidth;
-   
-               HWND hwndBack = WinWindowFromID(hwndDlg, IDC_BACK);
-               if (hwndBack) {
-                 RECTL rcBack;
-                 WinQueryWindowRect(hwndBack, &rcBack);
-                 backHeight = rcBack.yTop - rcBack.yBottom;
-                 backWidth = rcBack.xRight - rcBack.xLeft;
-               } else {
-                 backHeight = 0;
-                 backWidth = 0;
-               }
-               buttonHeight = newDlgHeight - backHeight - 50;//24;
-
-               HWND hwndForward = WinWindowFromID(hwndDlg, IDC_FORWARD);
-               if (hwndForward) {
-                 RECTL rcForward;
-                 WinQueryWindowRect(hwndForward, &rcForward);
-                 forwardWidth = rcForward.xRight - rcForward.xLeft;
-               } else
-                 forwardWidth = 0;
-
-               HWND hwndReload = WinWindowFromID(hwndDlg, IDC_RELOAD);
-               if (hwndReload) {
-                 RECTL rcReload;
-                 WinQueryWindowRect(hwndReload, &rcReload);
-                 reloadWidth = rcReload.xRight - rcReload.xLeft;
-               } else
-                 reloadWidth = 0;
-
-               HWND hwndStop = WinWindowFromID(hwndDlg, IDC_STOP);
-               if (hwndStop) {
-                 RECTL rcStop;
-                 WinQueryWindowRect(hwndStop, &rcStop);
-                 stopWidth = rcStop.xRight - rcStop.xLeft;
-               } else
-                 stopWidth = 0;
-
-               HWND hwndStatic = WinWindowFromID(hwndDlg, IDC_ADDRESSLABEL);
-               if (hwndStatic) {
-                 RECTL rcStatic;
-                 WinQueryWindowRect(hwndStatic, &rcStatic);
-                 staticWidth = rcStatic.xRight - rcStatic.xLeft;
-               } else
-                 staticWidth = 0;
-
-               HWND hwndGo = WinWindowFromID(hwndDlg, IDC_GO);
-               if (hwndGo) {
-                 RECTL rcGo;
-                 WinQueryWindowRect(hwndGo, &rcGo);
-                 goWidth = rcGo.xRight - rcGo.xLeft;
-               } else
-                 goWidth = 0;
-
-               HWND hwndAddress = WinWindowFromID(hwndDlg, IDC_ADDRESS);
-               if (hwndAddress) {
-                 RECTL rcAddress;
-                 WinQueryWindowRect(hwndAddress, &rcAddress);
-                 addressHeight = rcAddress.yTop - rcAddress.yBottom;
-                 comboboxHeight = buttonHeight + backHeight - addressHeight;
-               } else {
-                 addressHeight = 0;
-                 comboboxHeight = 0;
-               }
-               addressWidth = newDlgWidth - goWidth - backWidth - forwardWidth - reloadWidth - stopWidth - staticWidth - 15;
-
-               if (hwndStatus)
-                 WinSetWindowPos(hwndStatus,
-                                 HWND_TOP,
-                                 0, 0, 
-                                 statusWidth,
-                                 statusHeight,
-                                 SWP_MOVE | SWP_SIZE | SWP_SHOW);
-               if (hwndProgress)
-                 WinSetWindowPos(hwndProgress,
-                                 HWND_TOP,
-                                 statusWidth, 0, 
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndBack)
-                 WinSetWindowPos(hwndBack,
-                                 HWND_TOP,
-                                 2, buttonHeight,
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndForward)
-                 WinSetWindowPos(hwndForward,
-                                 HWND_TOP,
-                                 2 + backWidth, buttonHeight, 
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndReload)
-                 WinSetWindowPos(hwndReload,
-                                 HWND_TOP,
-                                 4 + backWidth + forwardWidth, buttonHeight,
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndStop)
-                 WinSetWindowPos(hwndStop,
-                                 HWND_TOP,
-                                 5 + backWidth + forwardWidth + reloadWidth, buttonHeight, 
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndStatic)
-                 WinSetWindowPos(hwndStatic,
-                                 HWND_TOP,
-                                 9 + backWidth + forwardWidth + reloadWidth + stopWidth, buttonHeight + 3,
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-               if (hwndAddress)
-                 WinSetWindowPos(hwndAddress,
-                                 HWND_TOP,
-                                 12 + backWidth + forwardWidth + reloadWidth + stopWidth + staticWidth, comboboxHeight,
-                                 addressWidth, addressHeight,
-                                 SWP_MOVE | SWP_SIZE | SWP_SHOW);
-               if (hwndGo)
-                 WinSetWindowPos(hwndGo,
-                                 HWND_TOP,
-                                 13 + backWidth + forwardWidth + reloadWidth + stopWidth + staticWidth + addressWidth, buttonHeight,
-                                 0, 0,
-                                 SWP_MOVE | SWP_SHOW);
-
-               // Resize the browser area (assuming the browser is
-               // sandwiched between the control bar and status area)
-               WinSetWindowPos(hwndBrowser,
-                               HWND_TOP,
-                               2, statusHeight,
-                               newDlgWidth - 4,
-                               newDlgHeight - backHeight - statusHeight - 52,
-                               SWP_MOVE | SWP_SIZE | SWP_SHOW);
-            }
-        }
-        return (MRESULT)TRUE;
-    }
-    return WinDefDlgProc(hwndDlg, uMsg, wParam, lParam);
-}
-
-
-//
-//  FUNCTION: BrowserWndProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Processes messages for the browser container window.
-//
-MRESULT EXPENTRY BrowserWndProc(HWND hWnd, ULONG message, MPARAM wParam, MPARAM lParam)
-{
-    nsIWebBrowserChrome *chrome = (nsIWebBrowserChrome *) WinQueryWindowULong(hWnd, QWL_USER);
-	switch (message) 
-	{
-    case WM_SIZE:
-        // Resize the embedded browser
-        ResizeEmbedding(chrome);
-        return (MRESULT)0;
-    case WM_ERASEBACKGROUND:
-        // Reduce flicker by not painting the non-visible background
-        return (MRESULT)1;
-    }
-    return WinDefWindowProc(hWnd, message, wParam, lParam);
-}
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Profile chooser dialog
-
-
-//
-//  FUNCTION: ChooseNewProfile()
-//
-//  PURPOSE: Allows the user to select a new profile from a list.
-//           The bShowForMultipleProfilesOnly argument specifies whether the
-//           function should automatically select the first profile and return
-//           without displaying a dialog box if there is only one profile to
-//           select.
-//
-BOOL ChooseNewProfile(BOOL bShowForMultipleProfilesOnly, const char *szDefaultProfile)
-{
-    nsresult rv;
-    nsCOMPtr<nsIProfile> profileService = 
-             do_GetService(NS_PROFILE_CONTRACTID, &rv);
-    if (NS_FAILED(rv))
-    {
-        return FALSE;
-    }
-
-    if (szDefaultProfile)
-    {
-        // Make a new default profile
-        nsAutoString newProfileName; newProfileName.AssignWithConversion(szDefaultProfile);
-        rv = profileService->CreateNewProfile(newProfileName.get(), nsnull, nsnull, PR_FALSE);
-        if (NS_FAILED(rv)) return FALSE;
-        rv = profileService->SetCurrentProfile(newProfileName.get());
-        if (NS_FAILED(rv)) return FALSE;
-        return TRUE;
-    }
-
-    PRInt32 profileCount = 0;
-    rv = profileService->GetProfileCount(&profileCount);
-    if (profileCount == 0)
-    {
-        // Make a new default profile
-        NS_NAMED_LITERAL_STRING(newProfileName, "os2Embed");
-        rv = profileService->CreateNewProfile(newProfileName.get(), nsnull, nsnull, PR_FALSE);
-        if (NS_FAILED(rv)) return FALSE;
-        rv = profileService->SetCurrentProfile(newProfileName.get());
-        if (NS_FAILED(rv)) return FALSE;
-        return TRUE;
-    }
-    else if (profileCount == 1 && bShowForMultipleProfilesOnly)
-    {
-        // GetCurrentProfile returns the profile which was last used but is not nescesarily
-        // active. Call SetCurrentProfile to make it installed and active.
-        
-        nsXPIDLString   currProfileName;
-        rv = profileService->GetCurrentProfile(getter_Copies(currProfileName));
-        if (NS_FAILED(rv)) return FALSE;
-        rv = profileService->SetCurrentProfile(currProfileName);
-        if (NS_FAILED(rv)) return FALSE;
-        return TRUE;
-    }
-
-    INT nResult;
-    nResult = WinDlgBox(HWND_DESKTOP, HWND_DESKTOP, (PFNWP)ChooseProfileDlgProc, NULL, IDD_CHOOSEPROFILE, (PVOID)ghInstanceResources);
-    return (nResult == DID_OK) ? TRUE : FALSE;
-}
-
-
-//
-//  FUNCTION: ChooseProfileDlgProc(HWND, unsigned, WORD, LONG)
-//
-//  PURPOSE:  Dialog handler procedure for the open uri dialog.
-//
-MRESULT EXPENTRY ChooseProfileDlgProc(HWND hDlg, ULONG message, MPARAM wParam, MPARAM lParam)
-{
-    nsresult rv;
-	switch (message)
-	{
-	case WM_INITDLG:
-        {
-            WinSetActiveWindow(HWND_DESKTOP, hDlg);
-            HWND hwndProfileList = WinWindowFromID(hDlg, IDC_PROFILELIST);
-
-            nsCOMPtr<nsIProfile> profileService = 
-                     do_GetService(NS_PROFILE_CONTRACTID, &rv);
-
-            // Get the list of profile names and add them to the list box
-            PRUint32 listLen = 0;
-            PRUnichar **profileList = nsnull;
-            rv = profileService->GetProfileList(&listLen, &profileList);
-            for (PRUint32 index = 0; index < listLen; index++)
-            {
-#ifdef UNICODE
-                WinSendMsg(hwndProfileList, LM_INSERTITEM, (MPARAM)LIT_END, (MPARAM) profileList[index]);
-#else
-                nsCAutoString profile; profile.AssignWithConversion(profileList[index]);
-                WinSendMsg(hwndProfileList, LM_INSERTITEM, (MPARAM)LIT_END, (MPARAM) profile.get());
-#endif
-            }
-
-            // Select the current profile (if there is one)
-
-            // Get the current profile
-#ifdef UNICODE
-            nsXPIDLString currProfile;
-            profileService->GetCurrentProfile(getter_Copies(currProfile));
-#else
-            nsXPIDLString currProfileUnicode;
-            profileService->GetCurrentProfile(getter_Copies(currProfileUnicode));
-            nsCAutoString currProfile; currProfile.AssignWithConversion(currProfileUnicode);
-#endif
-
-            // Now find and select it
-            LONG currentProfileIndex = LIT_ERROR;
-            currentProfileIndex = (LONG)WinSendMsg(hwndProfileList, LM_SEARCHSTRING, MPFROM2SHORT(LSS_CASESENSITIVE, LIT_FIRST), (MPARAM) currProfile.get());
-            if (currentProfileIndex != LIT_ERROR)
-            {
-                WinSendMsg(hwndProfileList, LM_SELECTITEM, (MPARAM)currentProfileIndex, (MPARAM)TRUE);
-            }
-        
-		return (MRESULT)TRUE;
-        }
-     case WM_COMMAND:
-        if (SHORT1FROMMP(wParam) == DID_OK)
-        {
-            HWND hwndProfileList = WinWindowFromID(hDlg, IDC_PROFILELIST);
-
-            // Get the selected profile from the list box and make it current
-            LONG currentProfileIndex = (LONG)WinSendMsg(hwndProfileList, LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0);
-            if (currentProfileIndex != LIT_ERROR)
-            {
-                nsCOMPtr<nsIProfile> profileService = 
-                         do_GetService(NS_PROFILE_CONTRACTID, &rv);
-                // Convert TCHAR name to unicode and make it current
-                INT profileNameLen = (INT)WinSendMsg(hwndProfileList, LM_QUERYITEMTEXTLENGTH, (MPARAM)currentProfileIndex, 0);
-                char *profileName = new char[profileNameLen + 1];
-                WinSendMsg(hwndProfileList, LM_QUERYITEMTEXT, MPFROM2SHORT(currentProfileIndex, profileNameLen + 1) ,(MPARAM)profileName);
-                nsAutoString newProfile; newProfile.AssignWithConversion(profileName);
-                rv = profileService->SetCurrentProfile(newProfile.get());
-            }
-	        WinDismissDlg(hDlg, DID_OK);
-        }
-		else if (SHORT1FROMMP(wParam) == DID_CANCEL)
-		{
-	        WinDismissDlg(hDlg, SHORT1FROMMP(wParam));
-		}
-        return (MRESULT)TRUE;
-	}
-
-    return WinDefDlgProc(hDlg, message, wParam, lParam);
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// WebBrowserChromeUI
-
-//
-//  FUNCTION: CreateNativeWindow()
-//
-//  PURPOSE: Creates a new browser dialog.
-//
-//  COMMENTS:
-//
-//    This function loads the browser dialog from a resource template
-//    and returns the HWND for the webbrowser container dialog item
-//    to the caller.
-//
-nativeWindow WebBrowserChromeUI::CreateNativeWindow(nsIWebBrowserChrome* chrome)
-{
-  // Load the browser dialog from resource
-  HWND hwndDialog;
-  PRUint32 chromeFlags;
-
-  chrome->GetChromeFlags(&chromeFlags);
-  if ((chromeFlags & nsIWebBrowserChrome::CHROME_ALL) == nsIWebBrowserChrome::CHROME_ALL)
-    hwndDialog = WinLoadDlg(HWND_DESKTOP, HWND_DESKTOP, BrowserDlgProc, ghInstanceResources, IDD_BROWSER, NULL);
-  else
-    hwndDialog = WinLoadDlg(HWND_DESKTOP, HWND_DESKTOP, BrowserDlgProc, ghInstanceResources, IDD_BROWSER_NC, NULL);
-  if (!hwndDialog)
-    return NULL;
-
-  // Stick a menu onto it
-  if (chromeFlags & nsIWebBrowserChrome::CHROME_MENUBAR) {
-    HWND hmenuDlg = WinLoadMenu(hwndDialog, 0, IDC_OS2EMBED);
-    WinSendMsg(hwndDialog, WM_UPDATEFRAME, MPFROMLONG(FCF_MENU), 0);
-  } else
-    WinSendMsg(hwndDialog, WM_UPDATEFRAME, 0, 0);
-
-  // Add some interesting URLs to the address drop down
-  HWND hwndAddress = WinWindowFromID(hwndDialog, IDC_ADDRESS);
-  if (hwndAddress) {
-    for (int i = 0; i < sizeof(gDefaultURLs) / sizeof(gDefaultURLs[0]); i++)
-    {
-      WinSendMsg(hwndAddress, LM_INSERTITEM, (MPARAM)LIT_SORTASCENDING, (MPARAM)gDefaultURLs[i]);
-    }
-  }
-
-  // Fetch the browser window handle
-  HWND hwndBrowser = WinWindowFromID(hwndDialog, IDC_BROWSER);
-  WinSetWindowULong(hwndBrowser, QWL_USER, (ULONG)chrome);  // save the browser LONG_PTR.
-  WinSetWindowULong(hwndBrowser, QWL_STYLE, WinQueryWindowULong(hwndBrowser, QWL_STYLE) | WS_CLIPCHILDREN);
-
-  // Activate the window
-  WinPostMsg(hwndDialog, WM_ACTIVATE, MPFROMSHORT(TRUE), (MPARAM)0);
-
-  gDialogCount++;
-
-  return (void *)hwndBrowser;
-}
-
-
-//
-// FUNCTION: Destroy()
-//
-// PURPOSE: Destroy the window specified by the chrome
-//
-void WebBrowserChromeUI::Destroy(nsIWebBrowserChrome* chrome)
-{
-  nsCOMPtr<nsIWebBrowser> webBrowser;
-  nsCOMPtr<nsIWebNavigation> webNavigation;
-
-  chrome->GetWebBrowser(getter_AddRefs(webBrowser));
-  webNavigation = do_QueryInterface(webBrowser);
-  if (webNavigation)
-    webNavigation->Stop(nsIWebNavigation::STOP_ALL);
-
-  chrome->ExitModalEventLoop(NS_OK);
-
-  HWND hwndDlg = GetBrowserDlgFromChrome(chrome);
-  if (hwndDlg == NULL)
-    return;
-
-  // Explicitly destroy the embedded browser and then the chrome
-
-  // First the browser
-  nsCOMPtr<nsIWebBrowser> browser = nsnull;
-  chrome->GetWebBrowser(getter_AddRefs(browser));
-  nsCOMPtr<nsIBaseWindow> browserAsWin = do_QueryInterface(browser);
-  if (browserAsWin)
-    browserAsWin->Destroy();
-
-      // Now the chrome
-  chrome->SetWebBrowser(nsnull);
-  NS_RELEASE(chrome);
-}
-
-
-//
-// FUNCTION: Called as the final act of a chrome object during its destructor
-//
-void WebBrowserChromeUI::Destroyed(nsIWebBrowserChrome* chrome)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(chrome);
-	if (hwndDlg == NULL)
-	{
-		return;
-	}
-
-    // Clear the window user data
-    HWND hwndBrowser = WinWindowFromID(hwndDlg, IDC_BROWSER);
-    WinSetWindowULong(hwndBrowser, QWL_USER, nsnull);
-    WinDestroyWindow(hwndBrowser);
-    WinDestroyWindow(hwndDlg);
-
-    --gDialogCount;
-    if (gDialogCount == 0)
-    {
-        if (gProfileSwitch)
-        {
-            gProfileSwitch = FALSE;
-            OpenWebPage(gFirstURL);
-        }
-        else
-        {
-            // Quit when there are no more browser objects
-            WinPostQueueMsg(0, WM_QUIT, 0, 0);
-        }
-    }
-}
-
-
-//
-// FUNCTION: Set the input focus onto the browser window
-//
-void WebBrowserChromeUI::SetFocus(nsIWebBrowserChrome *chrome)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(chrome);
-	if (hwndDlg == NULL)
-	{
-		return;
-	}
-    
-    HWND hwndBrowser = WinWindowFromID(hwndDlg, IDC_BROWSER);
-    ::WinSetFocus(HWND_DESKTOP, hwndBrowser);
-}
-
-//
-//  FUNCTION: UpdateStatusBarText()
-//
-//  PURPOSE: Set the status bar text.
-//
-void WebBrowserChromeUI::UpdateStatusBarText(nsIWebBrowserChrome *aChrome, const PRUnichar* aStatusText)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(aChrome);
-    nsCString status; 
-    if (aStatusText)
-        status.AssignWithConversion(aStatusText);
-    WinSetDlgItemText(hwndDlg, IDC_STATUS, status.get());
-}
-
-
-//
-//  FUNCTION: UpdateCurrentURI()
-//
-//  PURPOSE: Updates the URL address field
-//
-void WebBrowserChromeUI::UpdateCurrentURI(nsIWebBrowserChrome *aChrome)
-{
-    nsCOMPtr<nsIWebBrowser> webBrowser;
-    nsCOMPtr<nsIWebNavigation> webNavigation;
-    aChrome->GetWebBrowser(getter_AddRefs(webBrowser));
-    webNavigation = do_QueryInterface(webBrowser);
-
-    nsCOMPtr<nsIURI> currentURI;
-    webNavigation->GetCurrentURI(getter_AddRefs(currentURI));
-    if (currentURI)
-    {
-        nsCAutoString uriString;
-        currentURI->GetAsciiSpec(uriString);
-        HWND hwndDlg = GetBrowserDlgFromChrome(aChrome);
-        WinSetDlgItemText(hwndDlg, IDC_ADDRESS, uriString.get());
-    }
-}
-
-
-//
-//  FUNCTION: UpdateBusyState()
-//
-//  PURPOSE: Refreshes the stop/go buttons in the browser dialog
-//
-void WebBrowserChromeUI::UpdateBusyState(nsIWebBrowserChrome *aChrome, PRBool aBusy)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(aChrome);
-    HWND button;
-    button = WinWindowFromID(hwndDlg, IDC_STOP);
-    if (button)
-        WinEnableWindow(button, aBusy);
-    button = WinWindowFromID(hwndDlg, IDC_GO);
-    if (button)
-        WinEnableWindow(button, !aBusy);
-    UpdateUI(aChrome);
-}
-
-
-//
-//  FUNCTION: UpdateProgress()
-//
-//  PURPOSE: Refreshes the progress bar in the browser dialog
-//
-void WebBrowserChromeUI::UpdateProgress(nsIWebBrowserChrome *aChrome, PRInt32 aCurrent, PRInt32 aMax)
-{
-    HWND hwndDlg = GetBrowserDlgFromChrome(aChrome);
-    HWND hwndProgress = WinWindowFromID(hwndDlg, IDC_PROGRESS);
-    if (aCurrent < 0)
-    {
-        aCurrent = 0;
-    }
-    if (aCurrent > aMax)
-    {
-        aMax = aCurrent + 20; // What to do?
-    }
-    if (hwndProgress)
-    {
-        ULONG value = (double)aCurrent/(double)aMax*(double)100;
-        WinSendMsg(hwndProgress, SLM_SETSLIDERINFO, MPFROM2SHORT(SMA_SLIDERARMPOSITION, SMA_INCREMENTVALUE), (MPARAM)(value == 100? value-1: value));
-    }
-}
-
-//
-//  FUNCTION: ShowContextMenu()
-//
-//  PURPOSE: Display a context menu for the given node
-//
-void WebBrowserChromeUI::ShowContextMenu(nsIWebBrowserChrome *aChrome, PRUint32 aContextFlags, nsIDOMEvent *aEvent, nsIDOMNode *aNode)
-{
-    // TODO code to test context flags and display a popup menu should go here
-}
-
-//
-//  FUNCTION: ShowTooltip()
-//
-//  PURPOSE: Show a tooltip
-//
-void WebBrowserChromeUI::ShowTooltip(nsIWebBrowserChrome *aChrome, PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
-{
-    // TODO code to show a tooltip should go here
-}
-
-//
-//  FUNCTION: HideTooltip()
-//
-//  PURPOSE: Hide the tooltip
-//
-void WebBrowserChromeUI::HideTooltip(nsIWebBrowserChrome *aChrome)
-{
-    // TODO code to hide a tooltip should go here
-}
-
-void WebBrowserChromeUI::ShowWindow(nsIWebBrowserChrome *aChrome, PRBool aShow)
-{
-  HWND win = GetBrowserDlgFromChrome(aChrome);
-  ::WinShowWindow(win, aShow);
-}
-
-void WebBrowserChromeUI::SizeTo(nsIWebBrowserChrome *aChrome, PRInt32 aWidth, PRInt32 aHeight)
-{
-  HWND hchrome = GetBrowserDlgFromChrome(aChrome);
-  HWND hbrowser = GetBrowserFromChrome(aChrome);
-  RECTL chromeRect, browserRect;
-
-  ::WinQueryWindowRect(hchrome,  &chromeRect);
-  ::WinQueryWindowRect(hbrowser, &browserRect);
-
-  PRInt32 decoration_x = (browserRect.xLeft - chromeRect.xLeft) + 
-                         (chromeRect.xRight - browserRect.xRight);
-  PRInt32 decoration_y = (chromeRect.yTop - browserRect.yTop) + 
-                         (browserRect.yBottom - chromeRect.yBottom);
-
-  ::WinSetWindowPos(hchrome, HWND_TOP, WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN)/2 - (aWidth+decoration_x)/2,
-                    WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN)/2 - (aHeight+decoration_y)/2, 
-                    aWidth+decoration_x, aHeight+decoration_y, SWP_SIZE | SWP_MOVE | SWP_SHOW);
-}
-
-//
-//  FUNCTION: GetResourceStringByID()
-//
-//  PURPOSE: Get the resource string for the ID
-//
-void WebBrowserChromeUI::GetResourceStringById(PRInt32 aID, char ** aReturn)
-{
-    char resBuf[MAX_LOADSTRING];
-    int retval = WinLoadString((HAB)0, ghInstanceResources, aID, sizeof(resBuf), (PSZ)resBuf );
-    if (retval != 0)
-    {
-        int resLen = strlen(resBuf);
-        *aReturn = (char *)calloc(resLen+1, sizeof(char *));
-        if (!*aReturn) return;
-            PL_strncpy(*aReturn, (char *) resBuf, resLen);
-    }
-    return;
-}
-
-//-----------------------------------------------------------------------------
-
-nsresult CreateBrowserWindow(PRUint32 aChromeFlags,
-                             nsIWebBrowserChrome *aParent,
-                             nsIWebBrowserChrome **aNewWindow)
-{
-  WebBrowserChrome * chrome = new WebBrowserChrome();
-  if (!chrome)
-    return NS_ERROR_FAILURE;
-
-  // the interface to return and one addref, which we assume will be
-  // immediately released
-  CallQueryInterface(static_cast<nsIWebBrowserChrome*>(chrome), aNewWindow);
-  // now an extra addref; the window owns itself (to be released by
-  // WebBrowserChromeUI::Destroy)
-  NS_ADDREF(*aNewWindow);
-
-  chrome->SetChromeFlags(aChromeFlags);
-  chrome->SetParent(aParent);
-
-  // Insert the browser
-  nsCOMPtr<nsIWebBrowser> newBrowser;
-  chrome->CreateBrowser(-1, -1, -1, -1, getter_AddRefs(newBrowser));
-  if (!newBrowser)
-    return NS_ERROR_FAILURE;
-
-  // Place it where we want it.
-  ResizeEmbedding(static_cast<nsIWebBrowserChrome*>(chrome));
-
-  // Subscribe new window to profile changes so it can kill itself when one happens
-  nsCOMPtr<nsIObserverService> observerService(do_GetService("@mozilla.org/observer-service;1"));
-  if (observerService)
-    observerService->AddObserver(static_cast<nsIObserver *>(chrome),
-                                 "profile-change-teardown", PR_TRUE);
-
-  // if opened as chrome, it'll be made visible after the chrome has loaded.
-  // otherwise, go ahead and show it now.
-  if (!(aChromeFlags & nsIWebBrowserChrome::CHROME_OPENAS_CHROME))
-    WebBrowserChromeUI::ShowWindow(*aNewWindow, PR_TRUE);
-
-  return NS_OK;
-}
-
-void EnableChromeWindow(nsIWebBrowserChrome *aWindow,
-                        PRBool aEnabled)
-{
-  HWND hwnd = GetBrowserDlgFromChrome(aWindow);
-  ::WinEnableWindow(hwnd, aEnabled ? TRUE : FALSE);
-}
-
-PRUint32 RunEventLoop(PRBool &aRunCondition)
-{
-  QMSG msg;
-  HEV hFakeEvent = 0; 
-  ::DosCreateEventSem(NULL, &hFakeEvent, 0L, FALSE);
-
-  while (aRunCondition ) {
-    // Process pending messages
-    while (::WinPeekMsg((HAB)0, &msg, NULL, 0, 0, PM_NOREMOVE)) {
-      if (!::WinGetMsg((HAB)0, &msg, NULL, 0, 0)) {
-        // WM_QUIT
-        aRunCondition = PR_FALSE;
-        break;
-      }
-
-      PRBool wasHandled = PR_FALSE;
-      ::NS_HandleEmbeddingEvent(msg, wasHandled);
-      if (wasHandled)
-        continue;
-
-      ::WinDispatchMsg((HAB)0, &msg);
-    }
-
-    // Do idle stuff
-    ::DosWaitEventSem(hFakeEvent, 100);
-  }
-  ::DosCloseEventSem(hFakeEvent);
-  return LONGFROMMP(msg.mp1);
-}
deleted file mode 100644
--- a/embedding/tests/os2Embed/os2Embed.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
- * Version: Mozilla-sample-code 1.0
- *
- * Copyright (c) 2002 Netscape Communications Corporation and
- * other contributors
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this Mozilla sample software and associated documentation files
- * (the "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to permit
- * persons to whom the Software is furnished to do so, subject to the
- * following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Contributor(s):
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "prtypes.h"
-
-class nsIWebBrowserChrome;
-
-nsresult CreateBrowserWindow(PRUint32 aChromeFlags,
-                             nsIWebBrowserChrome *aParent,
-                             nsIWebBrowserChrome **aNewWindow);
-
-void     EnableChromeWindow(nsIWebBrowserChrome *aWindow, PRBool aEnabled);
-
-PRUint32 RunEventLoop(PRBool &aRunCondition);
-
deleted file mode 100644
--- a/embedding/tests/os2Embed/os2Embed.rc
+++ /dev/null
@@ -1,141 +0,0 @@
-
-#include "resource.h"
-#include "os2.h"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-ICON            IDI_OS2EMBED    DISCARDABLE     "os2Embed.ICO"
-ICON               IDI_SMALL    DISCARDABLE     "SMALL.ICO"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-MENU IDC_OS2EMBED DISCARDABLE 
-BEGIN
-    SUBMENU "~File", MOZ_File
-    BEGIN
-        MENUITEM "New Browser...",              MOZ_NewBrowser
-        MENUITEM SEPARATOR
-        MENUITEM "Switch Profile...",           MOZ_SwitchProfile
-        MENUITEM SEPARATOR
-        MENUITEM "~Save As...",                 MOZ_Save
-        MENUITEM "Print Page",                  MOZ_Print
-        MENUITEM "E~xit",                       IDM_EXIT
-    END
-    SUBMENU "~Edit", MOZ_Edit
-    BEGIN
-        MENUITEM "Cu~t",                        MOZ_Cut
-        MENUITEM "~Copy",                       MOZ_Copy
-        MENUITEM "~Paste",                      MOZ_Paste
-        MENUITEM SEPARATOR
-        MENUITEM "Select All",                  MOZ_SelectAll
-        MENUITEM "Select None",                 MOZ_SelectNone
-    END
-    SUBMENU "~Go", MOZ_Go
-    BEGIN
-        MENUITEM "~Back",                       MOZ_GoBack
-        MENUITEM "~Forward",                    MOZ_GoForward
-    END
-    SUBMENU "~Debug", MOZ_Debug
-    BEGIN
-        MENUITEM "~This space for rent",        ID_DEBUG_THISSPACEFORRENT
-,         ,MIA_DISABLED
-    END
-    SUBMENU "~Help", MOZ_Help
-    BEGIN
-        MENUITEM "~About os2Embed...",          MOZ_About
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_APP_TITLE           "os2Embed"
-    IDS_HELLO               "Embedding Mozilla is so much fun!!"
-    IDS_ABOUT               "os2Embed - Gecko embedding sample"
-    IDS_ABOUT_TITLE         "About os2Embed"
-    IDS_HIST_BACK           "Going Back to: "
-    IDS_HIST_FORWARD        "Going Forward to: "
-    IDS_HIST_RELOAD_NORMAL  "Reloading url, (normal) :"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    IDS_HIST_RELOAD_BYPASSPROXY "Reloading url, (bypassing Proxy) :"
-    IDS_HIST_RELOAD_BYPASSCACHE "Reloading url, (bypassing cache) :"
-    IDS_HIST_ADDURL         " added to Session History"
-    IDS_HIST_RELOAD_BYPASSPROXYANDCACHE 
-                            "Reloading url, (bypassing Proxy and cache) :"
-    IDS_HIST_PURGE          "purged from session history"
-    IDS_HIST_GOTO           "Going to history index : "
-    IDS_HIST_URL            " URL : "
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-DLGTEMPLATE IDD_BROWSER DISCARDABLE  
-BEGIN
-  DIALOG "os2Embed sample - UNSUPPORTED", IDD_BROWSER, 0, 90, 500, 217,
-  WS_VISIBLE | WS_CLIPSIBLINGS | NOT FS_DLGBORDER | FS_SIZEBORDER | FS_SCREENALIGN,
-  FCF_TITLEBAR | FCF_SYSMENU | FCF_MINBUTTON | FCF_MAXBUTTON 
-  BEGIN
-    PUSHBUTTON    "Back",           IDC_BACK,   2, 193,  27,  13
-    PUSHBUTTON    "Forward",     IDC_FORWARD,  29, 193,  41,  13
-    PUSHBUTTON    "Reload",       IDC_RELOAD,  72, 193,  35,  13
-    PUSHBUTTON    "Stop",           IDC_STOP, 108, 193,  32,  13             
-    LTEXT         "Address:",     IDC_ADDRESSLABEL, 144, 196,  35,   8, SS_TEXT | DT_WORDBREAK | DT_MNEMONIC
-    COMBOBOX      "",            IDC_ADDRESS, 182, 154, 242,  52, CBS_DROPDOWN | WS_TABSTOP
-    DEFPUSHBUTTON "Go",               IDC_GO, 425, 193,  32,  13
-    CONTROL       "Embedded Browser",IDC_BROWSER,0,  9, 500, 182, "OS2EMBED", WS_TABSTOP | WS_VISIBLE
-    CONTROL       "Status",       IDC_STATUS,   0,   0, 395,   9, WC_STATIC, SS_TEXT | DT_LEFT | WS_GROUP | DT_MNEMONIC | WS_VISIBLE
-    SLIDER                      IDC_PROGRESS, 395,   0, 105,   9, SLS_RIBBONSTRIP | SLS_READONLY | WS_VISIBLE
-                                              CTLDATA 12, 0, 100, 0, 0, 0
-  END
-END
-
-DLGTEMPLATE IDD_BROWSER_NC DISCARDABLE  
-BEGIN
-  DIALOG "os2Embed chromeless sample", IDD_BROWSER_NC, 0, 90, 500, 217,
-  WS_VISIBLE | WS_CLIPCHILDREN | NOT FS_DLGBORDER | FS_SIZEBORDER | FS_SCREENALIGN,
-  FCF_TITLEBAR | FCF_SYSMENU | FCF_MINBUTTON | FCF_MAXBUTTON | FCF_NOMOVEWITHOWNER
-  BEGIN
-    CONTROL       "Embedded Browser",IDC_BROWSER,0,  0, 500, 217, "OS2EMBED", WS_TABSTOP | WS_VISIBLE
-  END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-DLGTEMPLATE IDD_CHOOSEPROFILE DISCARDABLE  
-BEGIN
-  DIALOG "Choose Profile", IDD_CHOOSEPROFILE, 0, 182, 233, 154,
-  WS_VISIBLE | FS_DLGBORDER | FS_SCREENALIGN,
-  FCF_TITLEBAR | FCF_SYSMENU | FCF_NOMOVEWITHOWNER
-  BEGIN
-    LTEXT         "Available Profiles:",IDC_STATIC,9,139,78,   8, SS_TEXT | DT_WORDBREAK | DT_MNEMONIC
-    LISTBOX                  IDC_PROFILELIST,   9,   7, 147, 129, LS_NOADJUSTPOS | WS_TABSTOP
-    DEFPUSHBUTTON "Select",           DID_OK, 162, 122,  63,  14
-    PUSHBUTTON    "Cancel",       DID_CANCEL, 162, 104,  63,  14
-  END
-END
-
-
deleted file mode 100644
--- a/embedding/tests/os2Embed/resource.h
+++ /dev/null
@@ -1,77 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by winEmbed.rc
-//
-#define IDC_MYICON                      2
-#define IDD_OS2EMBED_DIALOG             102
-#define IDD_ABOUTBOX                    103
-#define IDS_APP_TITLE                   103
-#define IDM_ABOUT                       104
-#define MOZ_OpenURI                     104
-#define MOZ_GetURI                      104
-#define IDM_EXIT                        105
-#define IDS_HELLO                       106
-#define IDI_OS2EMBED                    107
-#define IDS_ABOUT                       107
-#define IDI_SMALL                       108
-#define IDS_ABOUT_TITLE                 108
-#define IDC_OS2EMBED                    109
-#define IDS_HIST_BACK                   109
-#define IDS_HIST_FORWARD                110
-#define IDS_HIST_RELOAD_NORMAL          111
-#define IDS_HIST_RELOAD_BYPASSPROXY     112
-#define IDS_HIST_RELOAD_BYPASSCACHE     113
-#define IDS_HIST_ADDURL                 114
-#define IDS_HIST_RELOAD_BYPASSPROXYANDCACHE 115
-#define IDS_HIST_PURGE                  116
-#define IDS_HIST_GOTO                   117
-#define IDS_HIST_URL                    118
-#define IDR_MAINFRAME                   128
-#define IDD_BROWSER                     130
-#define IDD_BROWSER_NC                  131
-#define IDD_CHOOSEPROFILE               132
-#define MOZ_EDIT_URI                    1001
-#define IDC_GO                          1003
-#define IDC_BROWSER                     1004
-#define IDC_ADDRESS                     1005
-#define IDC_STOP                        1006
-#define IDC_STATUS                      1007
-#define IDC_BACK                        1008
-#define IDC_FORWARD                     1009
-#define IDC_PROGRESS                    1010
-#define IDC_RELOAD                      1011
-#define IDC_PROFILELIST                 1011
-#define IDC_ADDRESSLABEL                1012
-#define MOZ_File                        201
-#define MOZ_Edit                        202
-#define MOZ_Go                          203
-#define MOZ_Debug                       204
-#define MOZ_Help                        205
-#define MOZ_Open                        32771
-#define MOZ_Print                       32772
-#define MOZ_NewBrowser                  32773
-#define MOZ_NewEditor                   32774
-#define MOZ_Save                        32775
-#define MOZ_Cut                         32776
-#define MOZ_Copy                        32777
-#define MOZ_Paste                       32778
-#define MOZ_Delete                      32779
-#define MOZ_SelectAll                   32780
-#define MOZ_SelectNone                  32781
-#define MOZ_GoBack                      32782
-#define MOZ_GoForward                   32783
-#define MOZ_About                       32784
-#define ID_DEBUG_THISSPACEFORRENT       32786
-#define MOZ_SwitchProfile               32787
-#define IDC_STATIC                      -1
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        133
-#define _APS_NEXT_COMMAND_VALUE         32788
-#define _APS_NEXT_CONTROL_VALUE         1012
-#define _APS_NEXT_SYMED_VALUE           110
-#endif
-#endif
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -244,17 +244,16 @@ NO_PKG_FILES += \
 	rebasedlls* \
 	res/samples \
 	res/throbber \
 	shlibsign* \
 	ssltunnel* \
 	certutil* \
 	pk12util* \
 	winEmbed.exe \
-	os2Embed.exe \
 	chrome/chrome.rdf \
 	chrome/app-chrome.manifest \
 	chrome/overlayinfo \
 	components/compreg.dat \
 	components/xpti.dat \
 	content_unit_tests \
 	necko_unit_tests \
 	*.dSYM \
--- a/xulrunner/build.mk
+++ b/xulrunner/build.mk
@@ -57,23 +57,16 @@ endif # LIBXUL_SDK
 
 # winembed, mfcembed
 ifeq ($(OS_ARCH),WINNT)
 ifneq (,$(ENABLE_TESTS)$(MOZILLA_OFFICIAL))
 tier_app_dirs += embedding/tests
 endif
 endif
 
-# os2embed
-ifeq ($(OS_ARCH),OS2)
-ifdef ENABLE_TESTS
-tier_app_dirs += embedding/tests
-endif
-endif
-
 ifdef MOZ_JAVAXPCOM
 tier_app_dirs += extensions/java
 endif
 
 tier_app_dirs += xulrunner
 
 installer:
 	@echo "XULRunner doesn't have an installer yet."