Bug 377410 - remove mfcembed, r=dougt
authorbenjamin@smedbergs.us
Fri, 13 Apr 2007 10:22:42 -0700
changeset 517 8a7bce4e8a89b110ffb5ed1ec5e17650f4a01a55
parent 516 c99ff5af83be39c6a13c0dd866507827f9422cb4
child 518 46073ef230a219378e1bd8af834896fc73a4f4d4
push idunknown
push userunknown
push dateunknown
reviewersdougt
bugs377410
milestone1.9a4pre
Bug 377410 - remove mfcembed, r=dougt
embedding/tests/Makefile.in
embedding/tests/mfcembed/BrowserFrameGlue.cpp
embedding/tests/mfcembed/BrowserFrm.cpp
embedding/tests/mfcembed/BrowserFrm.h
embedding/tests/mfcembed/BrowserImpl.cpp
embedding/tests/mfcembed/BrowserImpl.h
embedding/tests/mfcembed/BrowserImplCtxMenuLstnr.cpp
embedding/tests/mfcembed/BrowserImplPrompt.cpp
embedding/tests/mfcembed/BrowserImplWebPrgrsLstnr.cpp
embedding/tests/mfcembed/BrowserToolTip.cpp
embedding/tests/mfcembed/BrowserToolTip.h
embedding/tests/mfcembed/BrowserView.cpp
embedding/tests/mfcembed/BrowserView.h
embedding/tests/mfcembed/CCustomPromptDialog.cpp
embedding/tests/mfcembed/CCustomPromptDialog.h
embedding/tests/mfcembed/CFormatOptionTab.cpp
embedding/tests/mfcembed/CFormatOptionTab.h
embedding/tests/mfcembed/CMarginHeaderFooter.cpp
embedding/tests/mfcembed/CMarginHeaderFooter.h
embedding/tests/mfcembed/CPageSetupPropSheet.cpp
embedding/tests/mfcembed/CPageSetupPropSheet.h
embedding/tests/mfcembed/Dialogs.cpp
embedding/tests/mfcembed/Dialogs.h
embedding/tests/mfcembed/EditorFrm.cpp
embedding/tests/mfcembed/EditorFrm.h
embedding/tests/mfcembed/IBrowserFrameGlue.h
embedding/tests/mfcembed/Makefile.in
embedding/tests/mfcembed/MfcEmbed.cpp
embedding/tests/mfcembed/MfcEmbed.h
embedding/tests/mfcembed/MfcEmbed.rc
embedding/tests/mfcembed/MostRecentUrls.cpp
embedding/tests/mfcembed/MostRecentUrls.h
embedding/tests/mfcembed/Preferences.cpp
embedding/tests/mfcembed/Preferences.h
embedding/tests/mfcembed/ProfileMgr.cpp
embedding/tests/mfcembed/ProfileMgr.h
embedding/tests/mfcembed/ProfilesDlg.cpp
embedding/tests/mfcembed/ProfilesDlg.h
embedding/tests/mfcembed/README.TXT
embedding/tests/mfcembed/StdAfx.cpp
embedding/tests/mfcembed/StdAfx.h
embedding/tests/mfcembed/components/Dialogs.cpp
embedding/tests/mfcembed/components/Dialogs.h
embedding/tests/mfcembed/components/Dialogs.rc
embedding/tests/mfcembed/components/HelperAppDlg.cpp
embedding/tests/mfcembed/components/HelperAppDlg.h
embedding/tests/mfcembed/components/HelperAppService.h
embedding/tests/mfcembed/components/Makefile.in
embedding/tests/mfcembed/components/PrintProgressDialog.cpp
embedding/tests/mfcembed/components/PrintProgressDialog.h
embedding/tests/mfcembed/components/PrintingPromptService.cpp
embedding/tests/mfcembed/components/PrintingPromptService.h
embedding/tests/mfcembed/components/PromptService.cpp
embedding/tests/mfcembed/components/PromptService.h
embedding/tests/mfcembed/components/nsPrintDialogUtil.cpp
embedding/tests/mfcembed/components/nsPrintDialogUtil.h
embedding/tests/mfcembed/components/nsPrintProgressParams.cpp
embedding/tests/mfcembed/components/nsPrintProgressParams.h
embedding/tests/mfcembed/components/resource.h
embedding/tests/mfcembed/components/stdafx.h
embedding/tests/mfcembed/mfcembed.dsp
embedding/tests/mfcembed/mfcembed.dsw
embedding/tests/mfcembed/mfcembed.htm
embedding/tests/mfcembed/mfcembed.pkg
embedding/tests/mfcembed/res/Toolbar.bmp
embedding/tests/mfcembed/res/broken.ico
embedding/tests/mfcembed/res/mainfram.bmp
embedding/tests/mfcembed/res/mfcembed.ico
embedding/tests/mfcembed/res/mfcembed.rc2
embedding/tests/mfcembed/res/sinsecur.ico
embedding/tests/mfcembed/res/ssecur.ico
embedding/tests/mfcembed/resource.h
embedding/tests/mfcembed/winEmbedFileLocProvider.cpp
embedding/tests/mfcembed/winEmbedFileLocProvider.h
--- a/embedding/tests/Makefile.in
+++ b/embedding/tests/Makefile.in
@@ -42,22 +42,11 @@ endif
 ifeq ($(OS_ARCH),WINNT)
 # disable winembed in non-libxul
 ifndef BUILD_STATIC_LIBS
 ifdef MOZ_XUL_APP
 DIRS = winEmbed
 endif
 endif
 
-# disable mfcembed in static builds
-ifndef BUILD_STATIC_LIBS
-ifndef GNU_CC
-ifndef NO_MFC
-ifndef MOZ_NO_XPCOM_OBSOLETE
-DIRS += mfcembed/components mfcembed
-endif
-endif
-endif
-endif
-
 endif
 
 include $(topsrcdir)/config/rules.mk
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserFrameGlue.cpp
+++ /dev/null
@@ -1,508 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File Overview....
-//
-// This file has the IBrowserFrameGlueObj implementation
-// This frame glue object is nested inside of the BrowserFrame
-// object(See BrowserFrm.h for more info)
-//
-// This is the place where all the platform specific interaction
-// with the browser frame window takes place in response to 
-// callbacks from Gecko interface methods
-// 
-// The main purpose of this interface is to separate the cross 
-// platform code in BrowserImpl*.cpp from the platform specific
-// code(which is in this file)
-//
-// You'll also notice the use of a macro named "METHOD_PROLOGUE"
-// through out this file. This macro essentially makes the pointer
-// to a "containing" class available inside of the class which is
-// being contained via a var named "pThis". In our case, the 
-// BrowserFrameGlue object is contained inside of the BrowserFrame
-// object so "pThis" will be a pointer to a BrowserFrame object
-// Refer to MFC docs for more info on METHOD_PROLOGUE macro
-
-
-#include "stdafx.h"
-#include "MfcEmbed.h"
-#include "BrowserFrm.h"
-#include "Dialogs.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// IBrowserFrameGlue implementation
-
-void CBrowserFrame::BrowserFrameGlueObj::UpdateStatusBarText(const PRUnichar *aMessage)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-    USES_CONVERSION;
-    pThis->m_wndStatusBar.SetPaneText(0, aMessage ? W2CT(aMessage) : _T(""));
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::UpdateProgress(PRInt32 aCurrent, PRInt32 aMax)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    pThis->m_wndProgressBar.SetRange32(0, aMax);
-    pThis->m_wndProgressBar.SetPos(aCurrent);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::UpdateBusyState(PRBool aBusy)
-{    
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    // Just notify the view of the busy state
-    // There's code in there which will take care of
-    // updating the STOP toolbar btn. etc
-
-    pThis->m_wndBrowserView.UpdateBusyState(aBusy);
-}
-
-// Called from the OnLocationChange() method in the nsIWebProgressListener 
-// interface implementation in CBrowserImpl to update the current URI
-// Will get called after a URI is successfully loaded in the browser
-// We use this info to update the URL bar's edit box
-//
-void CBrowserFrame::BrowserFrameGlueObj::UpdateCurrentURI(nsIURI *aLocation)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    if(aLocation)
-    {
-        USES_CONVERSION;
-        nsEmbedCString uriString;
-        aLocation->GetSpec(uriString);
-        pThis->m_wndUrlBar.SetCurrentURL(A2CT(uriString.get()));
-    }
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFrameTitle(PRUnichar **aTitle)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    CString title;
-    pThis->GetWindowText(title);
-
-    if(!title.IsEmpty())
-    {
-        USES_CONVERSION;
-        nsEmbedString nsTitle;
-        nsTitle.Assign(T2CW(title.GetBuffer(0)));
-        *aTitle = NS_StringCloneData(nsTitle);
-    }
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::SetBrowserFrameTitle(const PRUnichar *aTitle)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    CString title;
-    if (aTitle)
-    {
-        USES_CONVERSION;
-        title = W2CT(aTitle);
-    }
-    else
-    {
-        // Use the AppName i.e. mfcembed as the title if we
-        // do not get one from GetBrowserWindowTitle()
-        //
-        title.LoadString(AFX_IDS_APP_TITLE);
-    }
-    pThis->SetWindowText(title);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-    
-    pThis->SetWindowPos(NULL, 0, 0, aCX, aCY, 
-                SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOZORDER
-            );
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    RECT wndRect;
-    pThis->GetWindowRect(&wndRect);
-
-    if (aCX)
-        *aCX = wndRect.right - wndRect.left;
-
-    if (aCY)
-        *aCY = wndRect.bottom - wndRect.top;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::SetBrowserFramePosition(PRInt32 aX, PRInt32 aY)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)    
-
-    pThis->SetWindowPos(NULL, aX, aY, 0, 0, 
-                SWP_NOSIZE | SWP_NOACTIVATE | SWP_NOZORDER);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    RECT wndRect;
-    pThis->GetWindowRect(&wndRect);
-
-    if (aX)
-        *aX = wndRect.left;
-
-    if (aY)
-        *aY = wndRect.top;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    RECT wndRect;
-    pThis->GetWindowRect(&wndRect);
-
-    if (aX)
-        *aX = wndRect.left;
-
-    if (aY)
-        *aY = wndRect.top;
-
-    if (aCX)
-        *aCX = wndRect.right - wndRect.left;
-
-    if (aCY)
-        *aCY = wndRect.bottom - wndRect.top;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    pThis->SetWindowPos(NULL, aX, aY, aCX, aCY, 
-                SWP_NOACTIVATE | SWP_NOZORDER);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::SetFocus()
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    pThis->SetFocus();
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::FocusAvailable(PRBool *aFocusAvail)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    HWND focusWnd = GetFocus()->m_hWnd;
-
-    if ((focusWnd == pThis->m_hWnd) || ::IsChild(pThis->m_hWnd, focusWnd))
-        *aFocusAvail = PR_TRUE;
-    else
-        *aFocusAvail = PR_FALSE;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::ShowBrowserFrame(PRBool aShow)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    if(aShow)
-    {
-        pThis->ShowWindow(SW_SHOW);
-        pThis->SetActiveWindow();
-        pThis->UpdateWindow();
-    }
-    else
-    {
-        pThis->ShowWindow(SW_HIDE);
-    }
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::GetBrowserFrameVisibility(PRBool *aVisible)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    // Is the current BrowserFrame the active one?
-    if (GetActiveWindow()->m_hWnd != pThis->m_hWnd)
-    {
-        *aVisible = PR_FALSE;
-        return;
-    }
-
-    // We're the active one
-    //Return FALSE if we're minimized
-    WINDOWPLACEMENT wpl;
-    pThis->GetWindowPlacement(&wpl);
-
-    if ((wpl.showCmd == SW_RESTORE) || (wpl.showCmd == SW_MAXIMIZE))
-        *aVisible = PR_TRUE;
-    else
-        *aVisible = PR_FALSE;
-}
-
-PRBool CBrowserFrame::BrowserFrameGlueObj::CreateNewBrowserFrame(PRUint32 chromeMask, 
-                            PRInt32 x, PRInt32 y, 
-                            PRInt32 cx, PRInt32 cy,
-                            nsIWebBrowser** aWebBrowser)
-{
-   NS_ENSURE_ARG_POINTER(aWebBrowser);
-
-   *aWebBrowser = nsnull;
-
-    CMfcEmbedApp *pApp = (CMfcEmbedApp *)AfxGetApp();
-    if(!pApp)
-        return PR_FALSE;
-
-    // Note that we're calling with the last param set to "false" i.e.
-    // this instructs not to show the frame window
-    // This is mainly needed when the window size is specified in the window.open()
-    // JS call. In those cases Gecko calls us to create the browser with a default
-    // size (all are -1) and then it calls the SizeBrowserTo() method to set
-    // the proper window size. If this window were to be visible then you'll see
-    // the window size changes on the screen causing an unappealing flicker
-    //
-
-    CBrowserFrame* pFrm = pApp->CreateNewBrowserFrame(chromeMask, x, y, cx, cy, PR_FALSE);
-    if(!pFrm)
-        return PR_FALSE;
-
-    // At this stage we have a new CBrowserFrame and a new CBrowserView
-    // objects. The CBrowserView also would have an embedded browser
-    // object created. Get the mWebBrowser member from the CBrowserView
-    // and return it. (See CBrowserView's CreateBrowser() on how the
-    // embedded browser gets created and how it's mWebBrowser member
-    // gets initialized)
-
-    NS_IF_ADDREF(*aWebBrowser = pFrm->m_wndBrowserView.mWebBrowser);
-
-    return PR_TRUE;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::DestroyBrowserFrame()
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    pThis->PostMessage(WM_CLOSE);
-}
-
-#define GOTO_BUILD_CTX_MENU { bContentHasFrames = FALSE; goto BUILD_CTX_MENU; }
-
-void CBrowserFrame::BrowserFrameGlueObj::ShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    BOOL bContentHasFrames = FALSE;
-    UINT nIDResource = IDR_CTXMENU_DOCUMENT;
-
-    // Reset the values from the last invocation
-    // Clear image src & link url
-    nsEmbedString empty;
-    pThis->m_wndBrowserView.SetCtxMenuImageSrc(empty);  
-    pThis->m_wndBrowserView.SetCtxMenuLinkUrl(empty);
-    pThis->m_wndBrowserView.SetCurrentFrameURL(empty);
-
-    // Display the Editor context menu if the we're inside
-    // an EditorFrm which is hosting an editing session
-    //
-    if(pThis->GetEditable())
-    {
-        nIDResource = IDR_CTXMENU_EDITOR;
-
-        GOTO_BUILD_CTX_MENU;
-    }
-
-    if(aContextFlags & nsIContextMenuListener2::CONTEXT_DOCUMENT)
-    {
-        nIDResource = IDR_CTXMENU_DOCUMENT;
-
-        // Background image?
-        if (aContextFlags & nsIContextMenuListener2::CONTEXT_BACKGROUND_IMAGE)
-        {
-            // Get the IMG SRC
-            nsCOMPtr<nsIURI> imgURI;
-            aInfo->GetBackgroundImageSrc(getter_AddRefs(imgURI));
-            if (!imgURI)
-                return; 
-            nsEmbedCString uri;
-            imgURI->GetSpec(uri);
-
-            nsEmbedString uri2;
-            NS_CStringToUTF16(uri, NS_CSTRING_ENCODING_UTF8, uri2);
-
-            pThis->m_wndBrowserView.SetCtxMenuImageSrc(uri2); // Set the new Img Src
-        }
-    }
-    else if(aContextFlags & nsIContextMenuListener2::CONTEXT_TEXT)        
-        nIDResource = IDR_CTXMENU_TEXT;
-    else if(aContextFlags & nsIContextMenuListener2::CONTEXT_LINK)
-    {
-        nIDResource = IDR_CTXMENU_LINK;
-
-        // Since we handle all the browser menu/toolbar commands
-        // in the View, we basically setup the Link's URL in the
-        // BrowserView object. When a menu selection in the context
-        // menu is made, the appropriate command handler in the
-        // BrowserView will be invoked and the value of the URL
-        // will be accesible in the view
-        
-        nsEmbedString strUrlUcs2;
-        nsresult rv = aInfo->GetAssociatedLink(strUrlUcs2);
-        if(NS_FAILED(rv))
-            return;
-
-        // Update the view with the new LinkUrl
-        // Note that this string is in UCS2 format
-        pThis->m_wndBrowserView.SetCtxMenuLinkUrl(strUrlUcs2);
-
-        // Test if there is an image URL as well
-        nsCOMPtr<nsIURI> imgURI;
-        aInfo->GetImageSrc(getter_AddRefs(imgURI));
-        if(imgURI)
-        {
-            nsEmbedCString strImgSrcUtf8;
-            imgURI->GetSpec(strImgSrcUtf8);
-            if(strImgSrcUtf8.Length() != 0)
-            {
-                // Set the new Img Src
-                nsEmbedString strImgSrc;
-                NS_CStringToUTF16(strImgSrcUtf8, NS_CSTRING_ENCODING_UTF8, strImgSrc);
-                pThis->m_wndBrowserView.SetCtxMenuImageSrc(strImgSrc);
-            }
-        }
-    }
-    else if(aContextFlags & nsIContextMenuListener2::CONTEXT_IMAGE)
-    {
-        nIDResource = IDR_CTXMENU_IMAGE;
-
-        // Get the IMG SRC
-        nsCOMPtr<nsIURI> imgURI;
-        aInfo->GetImageSrc(getter_AddRefs(imgURI));
-        if(!imgURI)
-            return;
-        nsEmbedCString strImgSrcUtf8;
-        imgURI->GetSpec(strImgSrcUtf8);
-        if(strImgSrcUtf8.Length() == 0)
-            return;
-
-        // Set the new Img Src
-        nsEmbedString strImgSrc;
-        NS_CStringToUTF16(strImgSrcUtf8, NS_CSTRING_ENCODING_UTF8, strImgSrc);
-        pThis->m_wndBrowserView.SetCtxMenuImageSrc(strImgSrc);
-    }
-
-    // Determine if we need to add the Frame related context menu items
-    // such as "View Frame Source" etc.
-    //
-    if(pThis->m_wndBrowserView.ViewContentContainsFrames())
-    {
-        bContentHasFrames = TRUE;
-
-        //Determine the current Frame URL
-        //
-        nsresult rv = NS_OK;
-        nsCOMPtr<nsIDOMNode> node;
-        aInfo->GetTargetNode(getter_AddRefs(node));
-        if(!node)
-            GOTO_BUILD_CTX_MENU;
-
-        nsCOMPtr<nsIDOMDocument> domDoc;
-        rv = node->GetOwnerDocument(getter_AddRefs(domDoc));
-        if(NS_FAILED(rv))
-            GOTO_BUILD_CTX_MENU;
-
-        nsCOMPtr<nsIDOMHTMLDocument> htmlDoc(do_QueryInterface(domDoc, &rv));
-        if(NS_FAILED(rv))
-            GOTO_BUILD_CTX_MENU;
-
-        nsEmbedString strFrameURL;
-        rv = htmlDoc->GetURL(strFrameURL);
-        if(NS_FAILED(rv))
-            GOTO_BUILD_CTX_MENU;
-
-        pThis->m_wndBrowserView.SetCurrentFrameURL(strFrameURL); //Set it to the new URL
-    }
-
-BUILD_CTX_MENU:
-
-    CMenu ctxMenu;
-    if(ctxMenu.LoadMenu(nIDResource))
-    {
-        //Append the Frame related menu items if content has frames
-        if(bContentHasFrames) 
-        {
-            CMenu* pCtxMenu = ctxMenu.GetSubMenu(0);
-            if(pCtxMenu)
-            {
-                pCtxMenu->AppendMenu(MF_SEPARATOR);
-
-                CString strMenuItem;
-                strMenuItem.LoadString(IDS_VIEW_FRAME_SOURCE);
-                pCtxMenu->AppendMenu(MF_STRING, ID_VIEW_FRAME_SOURCE, strMenuItem);
-
-                strMenuItem.LoadString(IDS_OPEN_FRAME_IN_NEW_WINDOW);
-                pCtxMenu->AppendMenu(MF_STRING, ID_OPEN_FRAME_IN_NEW_WINDOW, strMenuItem);
-            }
-        }
-
-        POINT cursorPos;
-        GetCursorPos(&cursorPos);
-
-        (ctxMenu.GetSubMenu(0))->TrackPopupMenu(TPM_LEFTALIGN, cursorPos.x, cursorPos.y, pThis);
-    }
-}
-
-HWND CBrowserFrame::BrowserFrameGlueObj::GetBrowserFrameNativeWnd()
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-    return pThis->m_hWnd;
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::UpdateSecurityStatus(PRInt32 aState)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-
-    pThis->UpdateSecurityStatus(aState);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-    pThis->m_wndTooltip.SetTipText(CString(aTipText));
-    pThis->m_wndTooltip.Show(&pThis->m_wndBrowserView, aXCoords, aYCoords);
-}
-
-void CBrowserFrame::BrowserFrameGlueObj::HideTooltip()
-{
-    METHOD_PROLOGUE(CBrowserFrame, BrowserFrameGlueObj)
-    pThis->m_wndTooltip.Hide();
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserFrm.cpp
+++ /dev/null
@@ -1,402 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File Overview....
-//
-// The typical MFC View, toolbar, statusbar creation done 
-// in CBrowserFrame::OnCreate()
-//
-// Code to update the Status/Tool bars in response to the
-// Web page loading progress(called from methods in CBrowserImpl)
-//
-// SetupFrameChrome() determines what, if any, UI elements this Frame
-// will sport based on the current "chromeMask" 
-//
-// Also take a look at OnClose() which gets used when you close a browser
-// window. This needs to be overrided mainly to handle supporting multiple
-// browser frame windows via the "New Browser Window" menu item
-// Without this being overridden the MFC framework handles the OnClose and
-// shutsdown the complete application when a frame window is closed.
-// In our case, we want the app to shutdown when the File/Exit menu is chosen
-//
-// Another key functionality this object implements is the IBrowserFrameGlue
-// interface - that's the interface the Gecko embedding interfaces call
-// upong to update the status bar etc.
-// (Take a look at IBrowserFrameGlue.h for the interface definition and
-// the BrowserFrm.h to see how we implement this interface - as a nested
-// class)
-// We pass this Glue object pointer to the CBrowserView object via the 
-// SetBrowserFrameGlue() method. The CBrowserView passes this on to the
-// embedding interface implementaion
-//
-// Please note the use of the macro METHOD_PROLOGUE in the implementation
-// of the nested BrowserFrameGlue object. Essentially what this macro does
-// is to get you access to the outer (or the object which is containing the
-// nested object) object via the pThis pointer.
-// Refer to the AFXDISP.H file in VC++ include dirs
-//
-// Next suggested file to look at : BrowserView.cpp
-
-#include "stdafx.h"
-#include "MfcEmbed.h"
-#include "BrowserFrm.h"
-#include "EditorFrm.h"
-#include "BrowserImpl.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserFrame
-
-IMPLEMENT_DYNAMIC(CBrowserFrame, CFrameWnd)
-
-BEGIN_MESSAGE_MAP(CBrowserFrame, CFrameWnd)
-    //{{AFX_MSG_MAP(CBrowserFrame)
-    ON_WM_CREATE()
-    ON_WM_SETFOCUS()
-    ON_WM_SIZE()
-    ON_WM_CLOSE()
-    ON_WM_ACTIVATE()
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-static UINT indicators[] =
-{
-    ID_SEPARATOR,           // For the Status line
-    ID_SEPARATOR,           // For the Progress Bar
-    ID_SEPARATOR,           // For the padlock image
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserFrame construction/destruction
-
-CBrowserFrame::CBrowserFrame()
-{
-    mIsEditor = FALSE;
-}
-
-CBrowserFrame::CBrowserFrame(PRUint32 chromeMask)
-{
-    // Save the chromeMask off. It'll be used
-    // later to determine whether this browser frame
-    // will have menubar, toolbar, statusbar etc.
-
-    m_chromeMask = chromeMask;
-    mIsEditor = FALSE;
-}
-
-CBrowserFrame::~CBrowserFrame()
-{
-}
-
-void CBrowserFrame::OnClose()
-{
-    CMfcEmbedApp *pApp = (CMfcEmbedApp *)AfxGetApp();
-    pApp->RemoveFrameFromList(this);
-
-    DestroyWindow();
-}
-
-// This is where the UrlBar, ToolBar, StatusBar, ProgressBar
-// get created
-//
-int CBrowserFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-    if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
-        return -1;
-
-    // Pass "this" to the View for later callbacks
-    // and/or access to any public data members, if needed
-    //
-    m_wndBrowserView.SetBrowserFrame(this);
-
-    // Pass on the BrowserFrameGlue also to the View which
-    // it will use during the Init() process after creation
-    // of the BrowserImpl obj. Essentially, the View object
-    // hooks up the Embedded browser's callbacks to the BrowserFrame
-    // via this BrowserFrameGlue object
-    m_wndBrowserView.SetBrowserFrameGlue((PBROWSERFRAMEGLUE)&m_xBrowserFrameGlueObj);
-
-    // create a view to occupy the client area of the frame
-    // This will be the view in which the embedded browser will
-    // be displayed in
-    //
-    if (!m_wndBrowserView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
-        CRect(0, 0, 0, 0), this, AFX_IDW_PANE_FIRST, NULL))
-    {
-        TRACE0("Failed to create view window\n");
-        return -1;
-    }
-
-    // create the URL bar (essentially a ComboBoxEx object)
-    if (!m_wndUrlBar.Create(CBS_DROPDOWN | WS_CHILD, CRect(0, 0, 200, 150), this, ID_URL_BAR))
-    {
-        TRACE0("Failed to create URL Bar\n");
-        return -1;      // fail to create
-    }
-    
-    // Load the Most Recently Used(MRU) Urls into the UrlBar
-    m_wndUrlBar.LoadMRUList();
-
-    UINT resID = mIsEditor ? IDR_EDITOR : IDR_MAINFRAME;
-
-    // Create the toolbar with Back, Fwd, Stop, etc. buttons..
-    //                     or
-    // Create a toolbar with the Editor toolbar buttons - Bold, Italic etc.
-    if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
-        | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
-        !m_wndToolBar.LoadToolBar(resID))
-    {
-        TRACE0("Failed to create toolbar\n");
-        return -1;      // fail to create
-    }
-
-    // Create a ReBar window to which the toolbar and UrlBar 
-    // will be added
-    if (!m_wndReBar.Create(this))
-    {
-        TRACE0("Failed to create ReBar\n");
-        return -1;      // fail to create
-    }
-    
-    //Add the ToolBar and UrlBar windows to the rebar
-    m_wndReBar.AddBar(&m_wndToolBar);
-
-    if (!mIsEditor)
-          m_wndReBar.AddBar(&m_wndUrlBar, _T("Enter URL:"));
-
-    // Create the status bar with two panes - one pane for actual status
-    // text msgs. and the other for the progress control
-    if (!m_wndStatusBar.CreateEx(this) ||
-        !m_wndStatusBar.SetIndicators(indicators,
-          sizeof(indicators)/sizeof(UINT)))
-    {
-        TRACE0("Failed to create status bar\n");
-        return -1;      // fail to create
-    }
-
-    // Create the progress bar as a child of the status bar.
-    // Note that the ItemRect which we'll get at this stage
-    // is bogus since the status bar panes are not fully
-    // positioned yet i.e. we'll be passing in an invalid rect
-    // to the Create function below
-    // The actual positioning of the progress bar will be done
-    // in response to OnSize()
-    RECT rc;
-    m_wndStatusBar.GetItemRect (1, &rc);
-    if (!m_wndProgressBar.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH, rc, &m_wndStatusBar, ID_PROG_BAR))
-    {
-        TRACE0("Failed to create progress bar\n");
-        return -1;      // fail to create
-    }
-
-    // The third pane(i.e. at index 2) of the status bar will have 
-    // the security lock icon displayed in it. Set up it's size(16) 
-    // and style(no border)so that the padlock icons can be properly drawn
-    m_wndStatusBar.SetPaneInfo(2, -1, SBPS_NORMAL|SBPS_NOBORDERS, 16);
-
-    // Create a tooltip window. (the MFC tooltip is not really suitable)
-    m_wndTooltip.Create(CWnd::GetDesktopWindow());
-
-    // Also, set the padlock icon to be the insecure icon to begin with
-    UpdateSecurityStatus(nsIWebProgressListener::STATE_IS_INSECURE);
-
-    // Based on the "chromeMask" we were supplied during construction
-    // hide any requested UI elements - statusbar, menubar etc...
-    // Note that the window styles (WM_RESIZE etc) are set inside
-    // of PreCreateWindow()
-
-    SetupFrameChrome(); 
-
-    return 0;
-}
-
-void CBrowserFrame::SetupFrameChrome()
-{
-    if(m_chromeMask == nsIWebBrowserChrome::CHROME_ALL)
-        return;
-
-    if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_MENUBAR) )
-        SetMenu(NULL); // Hide the MenuBar
-
-    if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_TOOLBAR) )
-        m_wndReBar.ShowWindow(SW_HIDE); // Hide the ToolBar
-
-    if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_STATUSBAR) )
-        m_wndStatusBar.ShowWindow(SW_HIDE); // Hide the StatusBar
-}
-
-BOOL CBrowserFrame::PreCreateWindow(CREATESTRUCT& cs)
-{
-    if( !CFrameWnd::PreCreateWindow(cs) )
-        return FALSE;
-
-    cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
-
-    // Change window style based on the chromeMask
-
-    if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_TITLEBAR) )
-        cs.style &= ~WS_CAPTION; // No caption        
-
-    if(! (m_chromeMask & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE) )
-    {
-        // Can't resize this window
-        cs.style &= ~WS_SIZEBOX;
-        cs.style &= ~WS_THICKFRAME;
-        cs.style &= ~WS_MINIMIZEBOX;
-        cs.style &= ~WS_MAXIMIZEBOX;
-    }
-
-    cs.lpszClass = AfxRegisterWndClass(0);
-
-    return TRUE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserFrame message handlers
-void CBrowserFrame::OnSetFocus(CWnd* pOldWnd)
-{
-    // forward focus to the view window
-    m_wndBrowserView.SetFocus();
-}
-
-BOOL CBrowserFrame::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo)
-{
-    // let the view have first crack at the command
-    if (m_wndBrowserView.OnCmdMsg(nID, nCode, pExtra, pHandlerInfo))
-        return TRUE;
-
-    // otherwise, do default handling
-    return CFrameWnd::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
-}
-
-// Needed to properly position/resize the progress bar
-//
-void CBrowserFrame::OnSize(UINT nType, int cx, int cy) 
-{
-       CFrameWnd::OnSize(nType, cx, cy);
-    
-       // Get the ItemRect of the status bar's Pane 1
-       // That's where the progress bar will be located
-       RECT rc;
-       m_wndStatusBar.GetItemRect(1, &rc);
-
-       // Move the progress bar into it's correct location
-       //
-       m_wndProgressBar.MoveWindow(&rc);
-}
-
-#ifdef _DEBUG
-void CBrowserFrame::AssertValid() const
-{
-    CFrameWnd::AssertValid();
-}
-
-void CBrowserFrame::Dump(CDumpContext& dc) const
-{
-    CFrameWnd::Dump(dc);
-}
-
-#endif //_DEBUG
-
-
-void CBrowserFrame::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
-{
-    CFrameWnd::OnActivate(nState, pWndOther, bMinimized);
-    
-    m_wndBrowserView.Activate(nState, pWndOther, bMinimized);
-}
-
-#define IS_SECURE(state) ((state & 0xFFFF) == nsIWebProgressListener::STATE_IS_SECURE)
-void CBrowserFrame::UpdateSecurityStatus(PRInt32 aState)
-{
-    int iResID = nsIWebProgressListener::STATE_IS_INSECURE;
-    
-    if(IS_SECURE(aState)){
-        iResID = IDR_SECURITY_LOCK;
-        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_SECURE;
-    }
-    else if(aState == nsIWebProgressListener::STATE_IS_INSECURE) {
-        iResID = IDR_SECURITY_UNLOCK;
-        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_INSECURE;
-    }
-    else if(aState == nsIWebProgressListener::STATE_IS_BROKEN) {
-        iResID = IDR_SECURITY_BROKEN;
-        m_wndBrowserView.m_SecurityState = CBrowserView::SECURITY_STATE_BROKEN;
-    }
-
-    CStatusBarCtrl& sb = m_wndStatusBar.GetStatusBarCtrl();
-    sb.SetIcon(2, //2 is the pane index of the status bar where the lock icon will be shown
-        (HICON)::LoadImage(AfxGetResourceHandle(),
-        MAKEINTRESOURCE(iResID), IMAGE_ICON, 16,16,0));       
-}
-
-void CBrowserFrame::ShowSecurityInfo()
-{   
-    m_wndBrowserView.ShowSecurityInfo();
-}
-
-// CMyStatusBar Class
-CMyStatusBar::CMyStatusBar()
-{
-}
-
-CMyStatusBar::~CMyStatusBar()
-{
-}
-
-BEGIN_MESSAGE_MAP(CMyStatusBar, CStatusBar)
-    //{{AFX_MSG_MAP(CMyStatusBar)
-    ON_WM_LBUTTONDOWN()
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-void CMyStatusBar::OnLButtonDown(UINT nFlags, CPoint point) 
-{
-    // Check to see if the mouse click was within the
-    // padlock icon pane(at pane index 2) of the status bar...
-
-    RECT rc;
-    GetItemRect(2, &rc );
-
-    if(PtInRect(&rc, point)) 
-    {
-        CBrowserFrame *pFrame = (CBrowserFrame *)GetParent();
-        if(pFrame != NULL)
-            pFrame->ShowSecurityInfo();
-    }
-        
-    CStatusBar::OnLButtonDown(nFlags, point);
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserFrm.h
+++ /dev/null
@@ -1,230 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// BrowserFrm.h : interface of the CBrowserFrame class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef _IBROWSERFRM_H
-#define _IBROWSERFRM_H
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "BrowserView.h"
-#include "BrowserToolTip.h"
-#include "IBrowserFrameGlue.h"
-#include "MostRecentUrls.h"
-
-// A simple UrlBar class...
-class CUrlBar : public CComboBoxEx
-{
-public:
-    inline void GetEnteredURL(CString& url) {
-        GetEditCtrl()->GetWindowText(url);
-    }
-    inline void GetSelectedURL(CString& url) {
-        GetLBText(GetCurSel(), url);
-    }
-    inline void SetCurrentURL(LPCTSTR pUrl) {
-        SetWindowText(pUrl);
-    }
-    inline void AddURLToList(CString& url, bool bAddToMRUList = true) {
-        USES_CONVERSION;
-        COMBOBOXEXITEM ci;
-        ci.mask = CBEIF_TEXT; ci.iItem = -1;
-        ci.pszText = const_cast<TCHAR *>((LPCTSTR)url);
-        InsertItem(&ci);
-
-        if(bAddToMRUList)
-            m_MRUList.AddURL(T2CA(url));
-    }
-    inline void LoadMRUList() {
-        for (int i=0;i<m_MRUList.GetNumURLs();i++) 
-        {
-            USES_CONVERSION;
-            CString urlStr(A2CT(m_MRUList.GetURL(i)));
-            AddURLToList(urlStr, false); 
-        }
-    }
-    inline BOOL EditCtrlHasFocus() {
-        return (GetEditCtrl()->m_hWnd == CWnd::GetFocus()->m_hWnd);
-    }
-    inline BOOL EditCtrlHasSelection() {
-        int nStartChar = 0, nEndChar = 0;
-        if(EditCtrlHasFocus())
-            GetEditCtrl()->GetSel(nStartChar, nEndChar);
-        return (nEndChar > nStartChar) ? TRUE : FALSE;
-    }
-    inline BOOL CanCutToClipboard() {
-        return EditCtrlHasSelection();
-    }
-    inline void CutToClipboard() {
-        GetEditCtrl()->Cut();
-    }
-    inline BOOL CanCopyToClipboard() {
-        return EditCtrlHasSelection();
-    }
-    inline void CopyToClipboard() {
-        GetEditCtrl()->Copy();
-    }
-    inline BOOL CanPasteFromClipboard() {
-        return EditCtrlHasFocus();
-    }
-    inline void PasteFromClipboard() {
-        GetEditCtrl()->Paste();
-    }
-    inline BOOL CanUndoEditOp() {
-        return EditCtrlHasFocus() ? GetEditCtrl()->CanUndo() : FALSE;
-    }
-    inline void UndoEditOp() {        
-        if(EditCtrlHasFocus())
-            GetEditCtrl()->Undo();
-    }
-
-protected:
-      CMostRecentUrls m_MRUList;
-};
-
-// CMyStatusBar class
-class CMyStatusBar : public CStatusBar
-{
-public:
-    CMyStatusBar();
-    virtual ~CMyStatusBar();
-
-protected:
-    afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
-
-    DECLARE_MESSAGE_MAP()
-};
-
-class CBrowserFrame : public CFrameWnd
-{    
-public:
-    CBrowserFrame();
-    CBrowserFrame(PRUint32 chromeMask);
-
-protected: 
-    DECLARE_DYNAMIC(CBrowserFrame)
-
-public:
-    inline CBrowserImpl *GetBrowserImpl() { return m_wndBrowserView.mpBrowserImpl; }
-
-    CToolBar    m_wndToolBar;
-    CMyStatusBar  m_wndStatusBar;
-    CProgressCtrl m_wndProgressBar;
-    CUrlBar m_wndUrlBar;
-    CReBar m_wndReBar;
-    CBrowserToolTip m_wndTooltip;
-
-    // The view inside which the embedded browser will
-    // be displayed in
-    CBrowserView    m_wndBrowserView;
-
-    void UpdateSecurityStatus(PRInt32 aState);
-    void ShowSecurityInfo();
-
-    // Wrapper functions for UrlBar clipboard operations
-    inline BOOL CanCutUrlBarSelection() { return m_wndUrlBar.CanCutToClipboard(); }
-    inline void CutUrlBarSelToClipboard() { m_wndUrlBar.CutToClipboard(); }
-    inline BOOL CanCopyUrlBarSelection() { return m_wndUrlBar.CanCopyToClipboard(); }
-    inline void CopyUrlBarSelToClipboard() { m_wndUrlBar.CopyToClipboard(); }
-    inline BOOL CanPasteToUrlBar() { return m_wndUrlBar.CanPasteFromClipboard(); }
-    inline void PasteFromClipboardToUrlBar() { m_wndUrlBar.PasteFromClipboard(); }
-    inline BOOL CanUndoUrlBarEditOp() { return m_wndUrlBar.CanUndoEditOp(); }
-    inline void UndoUrlBarEditOp() { m_wndUrlBar.UndoEditOp(); }
-
-    // This specifies what UI elements this frame will sport
-    // w.r.t. toolbar, statusbar, urlbar etc.
-    PRUint32 m_chromeMask;
-
-protected:
-    //
-    // This nested class implements the IBrowserFramGlue interface
-    // The Gecko embedding interfaces call on this interface
-    // to update the status bars etc.
-    //
-    class BrowserFrameGlueObj : public IBrowserFrameGlue 
-    {
-        //
-        // NS_DECL_BROWSERFRAMEGLUE below is a macro which expands
-        // to the function prototypes of methods in IBrowserFrameGlue
-        // Take a look at IBrowserFrameGlue.h for this macro define
-        //
-
-        NS_DECL_BROWSERFRAMEGLUE
-
-    } m_xBrowserFrameGlueObj;
-    friend class BrowserFrameGlueObj;
-
-public:
-    void SetupFrameChrome();
-    void SetEditable(BOOL isEditor) { mIsEditor = isEditor; }
-    BOOL GetEditable() { return mIsEditor; }
-
-// Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CBrowserFrame)
-    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-    virtual BOOL OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo);
-    //}}AFX_VIRTUAL
-
-// Implementation
-public:
-    virtual ~CBrowserFrame();
-#ifdef _DEBUG
-    virtual void AssertValid() const;
-    virtual void Dump(CDumpContext& dc) const;
-#endif
-
-// Generated message map functions
-protected:
-    //{{AFX_MSG(CBrowserFrame)
-    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-    afx_msg void OnSetFocus(CWnd *pOldWnd);
-    afx_msg void OnSize(UINT nType, int cx, int cy);
-    afx_msg void OnClose();
-    afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-
-private:
-    BOOL mIsEditor;
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif //_IBROWSERFRM_H
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserImpl.cpp
+++ /dev/null
@@ -1,411 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File Overview....
-// This is the class which implements all the interfaces
-// required(and optional) by the mozilla embeddable browser engine
-//
-// Note that this obj gets passed in the IBrowserFrameGlue* using the 
-// Init() method. Many of the interface implementations use this
-// to get the actual task done. Ex: to update the status bar
-//
-// Look at the INTERFACE_MAP_ENTRY's below for the list of 
-// the currently implemented interfaces
-//
-// This file currently has the implementation for all the interfaces
-// which are required of an app embedding Gecko
-// Implementation of other optional interfaces are in separate files
-// to avoid cluttering this one and to demonstrate other embedding
-// principles. For example, nsIPrompt is implemented in a separate DLL.
-// 
-//    nsIWebBrowserChrome    - This is a required interface to be implemented
-//                          by embeddors
-//
-//    nsIEmbeddingSiteWindow - This is a required interface to be implemented
-//                         by embedders            
-//                       - SetTitle() gets called after a document
-//                         load giving us the chance to update our
-//                         titlebar
-//
-// Some points to note...
-//
-// nsIWebBrowserChrome interface's SetStatus() gets called when a user 
-// mouses over the links on a page
-//
-// nsIWebProgressListener interface's OnStatusChange() gets called
-// to indicate progress when a page is being loaded
-//
-// Next suggested file(s) to look at : 
-//            Any of the BrowserImpl*.cpp files for other interface
-//            implementation details
-//
-
-#ifdef _WINDOWS
-  #include "stdafx.h"
-#endif
-
-#include "nsIDOMWindow.h"
-#include "BrowserImpl.h"
-
-CBrowserImpl::CBrowserImpl()
-{
-  m_pBrowserFrameGlue = NULL;
-  mWebBrowser = nsnull;
-}
-
-
-CBrowserImpl::~CBrowserImpl()
-{
-}
-
-// It's very important that the creator of this CBrowserImpl object
-// Call on this Init() method with proper values after creation
-//
-NS_METHOD CBrowserImpl::Init(PBROWSERFRAMEGLUE pBrowserFrameGlue, 
-                             nsIWebBrowser* aWebBrowser)
-{
-      m_pBrowserFrameGlue = pBrowserFrameGlue;
-      
-      SetWebBrowser(aWebBrowser);
-
-      return NS_OK;
-}
-
-//*****************************************************************************
-// CBrowserImpl::nsISupports
-//*****************************************************************************   
-
-NS_IMPL_ADDREF(CBrowserImpl)
-NS_IMPL_RELEASE(CBrowserImpl)
-
-NS_INTERFACE_MAP_BEGIN(CBrowserImpl)
-   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
-   NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
-   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
-   NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChromeFocus)
-   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow)
-   NS_INTERFACE_MAP_ENTRY(nsIEmbeddingSiteWindow2)
-   NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener)
-   NS_INTERFACE_MAP_ENTRY(nsIContextMenuListener2)
-   NS_INTERFACE_MAP_ENTRY(nsITooltipListener)
-   NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
-NS_INTERFACE_MAP_END
-
-//*****************************************************************************
-// CBrowserImpl::nsIInterfaceRequestor
-//*****************************************************************************   
-
-NS_IMETHODIMP CBrowserImpl::GetInterface(const nsIID &aIID, void** aInstancePtr)
-{
-    if(aIID.Equals(NS_GET_IID(nsIDOMWindow)))
-    {
-        if (mWebBrowser)
-            return mWebBrowser->GetContentDOMWindow((nsIDOMWindow **) aInstancePtr);
-        return NS_ERROR_NOT_INITIALIZED;
-    }
-
-    return QueryInterface(aIID, aInstancePtr);
-}
-
-//*****************************************************************************
-// CBrowserImpl::nsIWebBrowserChrome
-//*****************************************************************************   
-
-//Gets called when you mouseover links etc. in a web page
-//
-NS_IMETHODIMP CBrowserImpl::SetStatus(PRUint32 aType, const PRUnichar* aStatus)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->UpdateStatusBarText(aStatus);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetWebBrowser(nsIWebBrowser** aWebBrowser)
-{
-   NS_ENSURE_ARG_POINTER(aWebBrowser);
-
-   *aWebBrowser = mWebBrowser;
-
-   NS_IF_ADDREF(*aWebBrowser);
-
-   return NS_OK;
-}
-
-// Currently called from Init(). I'm not sure who else
-// calls this
-//
-NS_IMETHODIMP CBrowserImpl::SetWebBrowser(nsIWebBrowser* aWebBrowser)
-{
-   NS_ENSURE_ARG_POINTER(aWebBrowser);
-
-   mWebBrowser = aWebBrowser;
-
-   return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetChromeFlags(PRUint32* aChromeMask)
-{
-   return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP CBrowserImpl::SetChromeFlags(PRUint32 aChromeMask)
-{
-   return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-// Will get called in response to JavaScript window.close()
-//
-NS_IMETHODIMP CBrowserImpl::DestroyBrowserWindow()
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->DestroyBrowserFrame();
-
-    return NS_OK;
-}
-
-// Gets called in response to set the size of a window
-// Ex: In response to a JavaScript Window.Open() call of
-// the form 
-//
-//        window.open("http://www.mozilla.org", "theWin", "width=200, height=400");
-//
-// First the CreateBrowserWindow() call will be made followed by a 
-// call to this method to resize the window
-//
-NS_IMETHODIMP CBrowserImpl::SizeBrowserTo(PRInt32 aCX, PRInt32 aCY)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    HWND w = m_pBrowserFrameGlue->GetBrowserFrameNativeWnd();
-
-    CRect rcNewFrame(CPoint(0, 0), CSize(aCX, aCY));
-    CRect rcFrame;
-    CRect rcClient;
-
-    // Adjust for 3D edge on client area
-    AdjustWindowRectEx(&rcNewFrame, WS_VISIBLE, FALSE, WS_EX_CLIENTEDGE);
-
-    GetClientRect(w, &rcClient);
-    GetWindowRect(w, &rcFrame);
-
-    rcNewFrame.right += rcFrame.Width() - rcClient.Width();
-    rcNewFrame.bottom += rcFrame.Height() - rcClient.Height();
-
-    m_pBrowserFrameGlue->SetBrowserFrameSize(rcNewFrame.Width(), rcNewFrame.Height());
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::ShowAsModal(void)
-{
-   return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP CBrowserImpl::IsWindowModal(PRBool *retval)
-{
-  // We're not modal
-  *retval = PR_FALSE;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::ExitModalEventLoop(nsresult aStatus)
-{
-  return NS_OK;
-}
-
-//*****************************************************************************
-// CBrowserImpl::nsIWebBrowserChromeFocus
-//*****************************************************************************
-
-NS_IMETHODIMP CBrowserImpl::FocusNextElement()
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP CBrowserImpl::FocusPrevElement()
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-//*****************************************************************************
-// CBrowserImpl::nsIEmbeddingSiteWindow
-//*****************************************************************************   
-
-NS_IMETHODIMP CBrowserImpl::SetDimensions(PRUint32 aFlags, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION &&
-        (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER || 
-         aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER))
-    {
-        m_pBrowserFrameGlue->SetBrowserFramePositionAndSize(x, y, cx, cy, PR_TRUE);
-    }
-    else
-    {
-        if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
-        {
-            m_pBrowserFrameGlue->SetBrowserFramePosition(x, y);
-        }
-        if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER || 
-            aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
-        {
-            m_pBrowserFrameGlue->SetBrowserFrameSize(cx, cy);
-        }
-    }
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetDimensions(PRUint32 aFlags, PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-    
-    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_POSITION)
-    {
-        m_pBrowserFrameGlue->GetBrowserFramePosition(x, y);
-    }
-    if (aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_INNER || 
-        aFlags & nsIEmbeddingSiteWindow::DIM_FLAGS_SIZE_OUTER)
-    {
-        m_pBrowserFrameGlue->GetBrowserFrameSize(cx, cy);
-    }
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetSiteWindow(void** aSiteWindow)
-{
-  if (!aSiteWindow)
-    return NS_ERROR_NULL_POINTER;
-
-  *aSiteWindow = 0;
-  if (m_pBrowserFrameGlue) {
-    HWND w = m_pBrowserFrameGlue->GetBrowserFrameNativeWnd();
-    *aSiteWindow = NS_REINTERPRET_CAST(void *, w);
-  }
-  return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::SetFocus()
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->SetFocus();
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetTitle(PRUnichar** aTitle)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->GetBrowserFrameTitle(aTitle);
-    
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::SetTitle(const PRUnichar* aTitle)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->SetBrowserFrameTitle(aTitle);
-    
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::GetVisibility(PRBool *aVisibility)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->GetBrowserFrameVisibility(aVisibility);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::SetVisibility(PRBool aVisibility)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->ShowBrowserFrame(aVisibility);
-
-    return NS_OK;
-}
-
-//*****************************************************************************
-// CBrowserImpl::nsIEmbeddingSiteWindow2
-//*****************************************************************************   
-
-NS_IMETHODIMP CBrowserImpl::Blur()
-{
-    return NS_OK;
-}
-
-
-//*****************************************************************************
-// CBrowserImpl::nsITooltipListener
-//*****************************************************************************   
-
-/* void onShowTooltip (in long aXCoords, in long aYCoords, in wstring aTipText); */
-NS_IMETHODIMP CBrowserImpl::OnShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->ShowTooltip(aXCoords, aYCoords, aTipText);
-
-    return NS_OK;
-}
-
-/* void onHideTooltip (); */
-NS_IMETHODIMP CBrowserImpl::OnHideTooltip()
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->HideTooltip();
-
-    return NS_OK;
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserImpl.h
+++ /dev/null
@@ -1,71 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _BROWSERIMPL_H
-#define _BROWSERIMPL_H
-
-#include "IBrowserFrameGlue.h"
-#include "nsIWebBrowserChromeFocus.h"
-#include "nsICommandParams.h"
-
-class CBrowserImpl : public nsIInterfaceRequestor,
-                     public nsIWebBrowserChrome,
-                     public nsIWebBrowserChromeFocus,
-                     public nsIEmbeddingSiteWindow2,
-                     public nsIWebProgressListener,
-                     public nsIContextMenuListener2,
-                     public nsITooltipListener,
-                     public nsSupportsWeakReference
-{
-public:
-    CBrowserImpl();
-    ~CBrowserImpl();
-    NS_METHOD Init(PBROWSERFRAMEGLUE pBrowserFrameGlue,
-                   nsIWebBrowser* aWebBrowser);
-
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIINTERFACEREQUESTOR
-    NS_DECL_NSIWEBBROWSERCHROME
-    NS_DECL_NSIWEBBROWSERCHROMEFOCUS
-    NS_DECL_NSIEMBEDDINGSITEWINDOW
-    NS_DECL_NSIEMBEDDINGSITEWINDOW2
-    NS_DECL_NSIWEBPROGRESSLISTENER
-    NS_DECL_NSICONTEXTMENULISTENER2
-    NS_DECL_NSITOOLTIPLISTENER
-
-protected:
-
-    PBROWSERFRAMEGLUE  m_pBrowserFrameGlue;
-
-    nsCOMPtr<nsIWebBrowser> mWebBrowser;
-};
-
-#endif //_BROWSERIMPL_H
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserImplCtxMenuLstnr.cpp
+++ /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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifdef _WINDOWS
-  #include "stdafx.h"
-#endif
-#include "BrowserImpl.h"
-#include "IBrowserFrameGlue.h"
-
-//*****************************************************************************
-// CBrowserImpl::nsIContextMenuListener2
-//*****************************************************************************   
-
-NS_IMETHODIMP CBrowserImpl::OnShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo)
-{
-    if(m_pBrowserFrameGlue)
-        m_pBrowserFrameGlue->ShowContextMenu(aContextFlags, aInfo);
-
-    return NS_OK;
-}
\ No newline at end of file
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserImplPrompt.cpp
+++ /dev/null
@@ -1,158 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File overview.....
-//
-// The nsIPrompt interface is mainly used to convey/get information
-// from a user via Alerts, Prompts etc.
-// 
-
-#ifdef _WINDOWS
-  #include "stdafx.h"
-#endif
-#include "BrowserImpl.h"
-#include "IBrowserFrameGlue.h"
-
-//*****************************************************************************
-// CBrowserImpl::nsIPrompt Implementation
-//*****************************************************************************   
-
-
-// Needed for JavaScript and other cases where a msg needs to be 
-// shown to the user. For ex, when a page has some JS such as
-// "Alert("Hello")" this method will be invoked
-NS_IMETHODIMP
-CBrowserImpl::Alert(const PRUnichar *dialogTitle, const PRUnichar *text)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-    
-    m_pBrowserFrameGlue->Alert(dialogTitle, text);
-
-    return NS_OK;
-}
-
-// Invoked in the case of a JS confirm() method invocation
-NS_IMETHODIMP
-CBrowserImpl::Confirm(const PRUnichar *dialogTitle, 
-               const PRUnichar *text, PRBool *retval)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->Confirm(dialogTitle, text, retval);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::Prompt(const PRUnichar *dialogTitle, const PRUnichar *text,
-                     PRUnichar **promptText,
-                     const PRUnichar *checkMsg, PRBool *checkValue,
-                     PRBool *_retval)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->Prompt(dialogTitle, text, promptText, checkMsg, checkValue, _retval);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::PromptPassword(const PRUnichar *dialogTitle, const PRUnichar *text,
-                             PRUnichar **password,
-                             const PRUnichar *checkMsg, PRBool *checkValue,
-                             PRBool *_retval)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->PromptPassword(dialogTitle, text, password,
-                                        checkMsg, checkValue, _retval);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::PromptUsernameAndPassword(const PRUnichar *dialogTitle, const PRUnichar *text,
-                                        PRUnichar **username, PRUnichar **password,
-                                        const PRUnichar *checkMsg, PRBool *checkValue,
-                                        PRBool *_retval)
-{
-    if(! m_pBrowserFrameGlue)
-        return NS_ERROR_FAILURE;
-
-    m_pBrowserFrameGlue->PromptUserNamePassword(dialogTitle, text, 
-                                                username, password,
-                                                checkMsg, checkValue, 
-                                                _retval);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::AlertCheck(const PRUnichar *dialogTitle, 
-                  const PRUnichar *text, 
-                  const PRUnichar *checkMsg,
-                  PRBool *checkValue)
-{
-        return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::ConfirmCheck(const PRUnichar *dialogTitle,
-                const PRUnichar *text,
-                const PRUnichar *checkMsg, 
-                PRBool *checkValue, PRBool *retval)
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::ConfirmEx(const PRUnichar *dialogTitle, const PRUnichar *text,
-                        PRUint32 buttonFlags, const PRUnichar *button0Title,
-                        const PRUnichar *button1Title, const PRUnichar *button2Title,
-                        const PRUnichar *checkMsg, PRBool *checkValue,
-                        PRInt32 *buttonPressed)
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-CBrowserImpl::Select(const PRUnichar *dialogTitle,
-              const PRUnichar *text, PRUint32 count,
-              const PRUnichar **selectList,
-              PRInt32 *outSelection, PRBool *retval)
-{
-    return NS_ERROR_NOT_IMPLEMENTED;
-}
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserImplWebPrgrsLstnr.cpp
+++ /dev/null
@@ -1,155 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifdef _WINDOWS
-  #include "stdafx.h"
-#endif
-#include "BrowserImpl.h"
-#include "IBrowserFrameGlue.h"
-
-//*****************************************************************************
-// CBrowserImpl::nsIWebProgressListener Implementation
-//*****************************************************************************   
-//
-// - Implements browser progress update functionality 
-//   while loading a page into the embedded browser
-//
-// - Calls methods via the IBrowserFrameGlue interace 
-//    (available thru' the m_pBrowserFrameGlue member var)
-//    to do the actual statusbar/progress bar updates. 
-//
-
-NS_IMETHODIMP CBrowserImpl::OnProgressChange(nsIWebProgress *progress,
-                                             nsIRequest *request,
-                                             PRInt32 curSelfProgress,
-                                             PRInt32 maxSelfProgress,
-                                             PRInt32 curTotalProgress,
-                                             PRInt32 maxTotalProgress)
-{
-  if(! m_pBrowserFrameGlue) {
-    // always return NS_OK
-    return NS_OK;
-  }
-
-  PRInt32 nProgress = curTotalProgress;
-  PRInt32 nProgressMax = maxTotalProgress;
-
-  if (nProgressMax == 0)
-    nProgressMax = LONG_MAX;
-
-  if (nProgress > nProgressMax)
-    nProgress = nProgressMax; // Progress complete
-
-  m_pBrowserFrameGlue->UpdateProgress(nProgress, nProgressMax);
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP CBrowserImpl::OnStateChange(nsIWebProgress *progress,
-                                          nsIRequest *request,
-                                          PRUint32 progressStateFlags,
-                                          nsresult status)
-{
-  if(! m_pBrowserFrameGlue) {
-    // always return NS_OK
-    return NS_OK;
-  }
-
-  if ((progressStateFlags & STATE_START) && (progressStateFlags & STATE_IS_DOCUMENT))
-  {
-    // Navigation has begun
-    m_pBrowserFrameGlue->UpdateBusyState(PR_TRUE);
-  }
-
-  if ((progressStateFlags & STATE_STOP) && (progressStateFlags & STATE_IS_DOCUMENT))
-  {
-    // We've completed the navigation
-
-    m_pBrowserFrameGlue->UpdateBusyState(PR_FALSE);
-    m_pBrowserFrameGlue->UpdateProgress(0, 100);       // Clear the prog bar
-    m_pBrowserFrameGlue->UpdateStatusBarText(nsnull);  // Clear the status bar
-  }
-
-  return NS_OK;
-}
-
-
-NS_IMETHODIMP CBrowserImpl::OnLocationChange(nsIWebProgress* aWebProgress,
-                                                 nsIRequest* aRequest,
-                                                 nsIURI *location)
-{
-  if(! m_pBrowserFrameGlue) {
-    // always return NS_OK
-    return NS_OK;
-  }
-
-  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) // Update urlbar only if it is not a subframe load
-    m_pBrowserFrameGlue->UpdateCurrentURI(location);
-
-    return NS_OK;
-}
-
-NS_IMETHODIMP 
-CBrowserImpl::OnStatusChange(nsIWebProgress* aWebProgress,
-                                 nsIRequest* aRequest,
-                                 nsresult aStatus,
-                                 const PRUnichar* aMessage)
-{
-  if(m_pBrowserFrameGlue)
-    m_pBrowserFrameGlue->UpdateStatusBarText(aMessage);
-
-  return NS_OK;
-}
-
-
-
-NS_IMETHODIMP 
-CBrowserImpl::OnSecurityChange(nsIWebProgress *aWebProgress, 
-                                    nsIRequest *aRequest, 
-                                    PRUint32 state)
-{
-  m_pBrowserFrameGlue->UpdateSecurityStatus(state);
-
-  return NS_OK;
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserToolTip.cpp
+++ /dev/null
@@ -1,147 +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):
- *   Adam Lock <adamlock@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "stdafx.h"
-
-#include "BrowserToolTip.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserToolTip
-
-CBrowserToolTip::CBrowserToolTip()
-{
-}
-
-CBrowserToolTip::~CBrowserToolTip()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CBrowserToolTip, CWnd)
-	//{{AFX_MSG_MAP(CBrowserToolTip)
-	ON_WM_PAINT()
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-BOOL CBrowserToolTip::Create(CWnd *pParentWnd)
-{
-    return CWnd::CreateEx(WS_EX_TOOLWINDOW,
-        AfxRegisterWndClass(CS_SAVEBITS, NULL, GetSysColorBrush(COLOR_INFOBK), NULL),
-        _T("ToolTip"), WS_POPUP | WS_BORDER, 0, 0, 1, 1, pParentWnd->GetSafeHwnd(), NULL);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserToolTip message handlers
-
-void CBrowserToolTip::OnPaint() 
-{
-	CPaintDC dc(this); // device context for painting
-
-    CRect rcClient;
-    GetClientRect(&rcClient);
-
-    // Draw tip text
-    int oldBkMode = dc.SetBkMode(TRANSPARENT);
-    COLORREF oldTextColor = dc.SetTextColor(GetSysColor(COLOR_INFOTEXT));
-    HGDIOBJ oldFont = dc.SelectObject(GetStockObject(DEFAULT_GUI_FONT));
-
-    dc.DrawText(m_szTipText, -1, rcClient, DT_SINGLELINE | DT_VCENTER | DT_CENTER);
-
-    dc.SetBkMode(oldBkMode);
-    dc.SetTextColor(oldTextColor);
-    dc.SelectObject(oldFont);
-}
-
-BOOL CBrowserToolTip::PreCreateWindow(CREATESTRUCT& cs) 
-{
-	return CWnd::PreCreateWindow(cs);
-}
-
-void CBrowserToolTip::SetTipText(const CString &szTipText)
-{
-    m_szTipText = szTipText;
-}
-
-void CBrowserToolTip::Show(CWnd *pOverWnd, long left, long top)
-{
-    // Calculate the client window size
-    CRect rcNewClient(0,0,0,0);
-    CDC *pdc = GetDC();
-    HGDIOBJ oldFont = pdc->SelectObject(GetStockObject(DEFAULT_GUI_FONT));
-    rcNewClient.bottom = pdc->DrawText(m_szTipText, -1, rcNewClient,
-        DT_SINGLELINE | DT_VCENTER | DT_CENTER | DT_CALCRECT);
-    pdc->SelectObject(oldFont);
-    ReleaseDC(pdc);
-    rcNewClient.right += 8;
-    rcNewClient.bottom += 8;
-    
-    // Adjust the tooltip to new size
-    AdjustWindowRectEx(rcNewClient, GetWindowLong(m_hWnd, GWL_STYLE), FALSE, GetWindowLong(m_hWnd, GWL_EXSTYLE));
-
-    // Adjust the left, top position of the tooltip
-    CPoint ptTip(left, top);
-    pOverWnd->ClientToScreen(&ptTip);
-
-    // Make sure tip is below cursor
-    POINT ptCursor;
-    GetCursorPos(&ptCursor);
-    long cyCursor = GetSystemMetrics(SM_CYCURSOR);
-    if (ptTip.y < ptCursor.y + cyCursor)
-        ptTip.y = ptCursor.y + cyCursor;
-
-    // Make sure tip is fully visible
-    RECT rcScreen;
-    GetDesktopWindow()->GetClientRect(&rcScreen);
-    if (ptTip.x < 0)
-        ptTip.x = 0;
-    else if (ptTip.x + rcNewClient.Width() > rcScreen.right)
-        ptTip.x = rcScreen.right - rcNewClient.Width();
-    if (ptTip.y < 0)
-        ptTip.y = 0;
-    else if (ptTip.y + rcNewClient.Height() > rcScreen.bottom)
-        ptTip.y = rcScreen.bottom - rcNewClient.Height();
-
-    // Position and show the tip
-    SetWindowPos(&CWnd::wndTop, ptTip.x, ptTip.y, rcNewClient.Width(), rcNewClient.Height(),
-        SWP_NOACTIVATE | SWP_SHOWWINDOW);
-}
-
-void CBrowserToolTip::Hide()
-{
-    ShowWindow(SW_HIDE);
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserToolTip.h
+++ /dev/null
@@ -1,87 +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):
- *   Adam Lock <adamlock@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(AFX_BROWSERTOOLTIP_H__13240069_1816_403C_A79D_306FD710B75A__INCLUDED_)
-#define AFX_BROWSERTOOLTIP_H__13240069_1816_403C_A79D_306FD710B75A__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// BrowserToolTip.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserToolTip window
-
-class CBrowserToolTip : public CWnd
-{
-// Construction
-public:
-	CBrowserToolTip();
-
-// Attributes
-public:
-
-// Operations
-public:
-
-// Overrides
-	// ClassWizard generated virtual function overrides
-	//{{AFX_VIRTUAL(CBrowserToolTip)
-	protected:
-	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-	//}}AFX_VIRTUAL
-
-	CString m_szTipText;
-// Implementation
-public:
-	virtual ~CBrowserToolTip();
-
-    BOOL Create(CWnd *pParentWnd);
-	void SetTipText(const CString &szTipText);
-    void Show(CWnd *pOverWnd, long left, long top);
-    void Hide();
-
-
-	// Generated message map functions
-protected:
-	//{{AFX_MSG(CBrowserToolTip)
-	afx_msg void OnPaint();
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_BROWSERTOOLTIP_H__13240069_1816_403C_A79D_306FD710B75A__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserView.cpp
+++ /dev/null
@@ -1,1333 +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):
- *   Chak Nanga <chak@netscape.com>
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File Overview....
-//
-// When the CBrowserFrm creates this View:
-//   - CreateBrowser() is called in OnCreate() to create the
-//       mozilla embeddable browser
-//
-// OnSize() method handles the window resizes and calls the approriate
-// interface method to resize the embedded browser properly
-//
-// Command handlers to handle browser navigation - OnNavBack(), 
-// OnNavForward() etc
-//
-// DestroyBrowser() called for cleaning up during object destruction
-//
-// Some important coding notes....
-//
-// 1. Make sure we do not have the CS_HREDRAW|CS_VREDRAW in the call
-//      to AfxRegisterWndClass() inside of PreCreateWindow() below
-//      If these flags are present then you'll see screen flicker when 
-//      you resize the frame window
-//
-// Next suggested file to look at : BrowserImpl.cpp
-//
-
-#include "stdafx.h"
-#include "MfcEmbed.h"
-#include "BrowserView.h"
-#include "BrowserImpl.h"
-#include "BrowserFrm.h"
-#include "Dialogs.h"
-#include "CPageSetupPropSheet.h"
-
-// Mozilla Includes
-#include "nsIIOService.h"
-#include "nsIWidget.h"
-#include "nsServiceManagerUtils.h"
-#include "nsComponentManagerUtils.h"
-#include "nsMemory.h"
-#include "nsXPCOM.h"
-
-static nsresult
-NewURI(nsIURI **result, const nsAString &spec)
-{
-  nsEmbedCString specUtf8;
-  NS_UTF16ToCString(spec, NS_CSTRING_ENCODING_UTF8, specUtf8);
-
-  nsCOMPtr<nsIIOService> ios = do_GetService("@mozilla.org/network/io-service;1");
-  NS_ENSURE_TRUE(ios, NS_ERROR_UNEXPECTED);
-
-  return ios->NewURI(specUtf8, nsnull, nsnull, result);
-}
-
-static void
-ReplaceChar(nsAString &str, char oldChar, char newChar)
-{
-  // XXX this could be much more efficient
-
-  PRUnichar *data = NS_StringCloneData(str);
-  PRUnichar *datastring = data;
-  for (; *data; ++data)
-  {
-    if ((char ) *data == oldChar)
-      *data = (PRUnichar) newChar;
-  }
-  NS_StringSetData(str, datastring);
-  nsMemory::Free(datastring);
-}
-
-static void
-StripChars(nsAString &str, const char *chars)
-{
-  // XXX this could be much more efficient
-
-  PRUint32 len = str.Length();
-
-  PRUnichar *data = NS_StringCloneData(str);
-  PRUnichar *datastring = data;
-  PRUnichar *dataEnd = data + len;
-  for (; *data; ++data)
-  {
-    if (strchr(chars, (char ) *data))
-    {
-      // include trailing null terminator in the memmove
-      memmove(data, data + 1, (dataEnd - data) * sizeof(PRUnichar));
-      --dataEnd;
-    }
-  }
-  NS_StringSetData(str, datastring);
-  nsMemory::Free(datastring);
-}
-
-static void
-StripChars(nsACString &str, const char *chars)
-{
-  // XXX this could be much more efficient
-
-  PRUint32 len = str.Length();
-
-  char *data = NS_CStringCloneData(str);
-  char *datastring = data;
-  char *dataEnd = data + len;
-  for (; *data; ++data)
-  {
-    if (strchr(chars, *data))
-    {
-      // include trailing null terminator in the memmove
-      memmove(data, data + 1, dataEnd - data);
-      --dataEnd;
-    }
-  }
-  NS_CStringSetData(str, datastring);
-  nsMemory::Free(datastring);
-}
-
-static const char* kWhitespace="\b\t\r\n ";
-
-static void
-CompressWhitespace(nsAString &str)
-{
-  const PRUnichar *p;
-  PRInt32 i, len = (PRInt32) NS_StringGetData(str, &p);
-
-  // trim leading whitespace
-
-  for (i=0; i<len; ++i)
-  {
-    if (!strchr(kWhitespace, (char) p[i]))
-      break;
-  }
-
-  if (i>0)
-  {
-    NS_StringCutData(str, 0, i);
-    len = (PRInt32) NS_StringGetData(str, &p);
-  }
-
-  // trim trailing whitespace
-
-  for (i=len-1; i>=0; --i)
-  {
-    if (!strchr(kWhitespace, (char) p[i]))
-      break;
-  }
-
-  if (++i < len)
-    NS_StringCutData(str, i, len - i);
-}
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-// Register message for FindDialog communication
-static UINT WM_FINDMSG = ::RegisterWindowMessage(FINDMSGSTRING);
-
-BEGIN_MESSAGE_MAP(CBrowserView, CWnd)
-    //{{AFX_MSG_MAP(CBrowserView)
-    ON_WM_CREATE()
-    ON_WM_DESTROY()
-    ON_WM_SIZE()
-
-    // UrlBar command handlers
-    ON_COMMAND(IDOK, OnNewUrlEnteredInUrlBar)
-    ON_CBN_SELENDOK(ID_URL_BAR, OnUrlSelectedInUrlBar)
-
-    // Menu/Toolbar command handlers
-    ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
-    ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
-    ON_COMMAND(ID_VIEW_SOURCE, OnViewSource)
-    ON_COMMAND(ID_VIEW_INFO, OnViewInfo)
-    ON_COMMAND(ID_NAV_BACK, OnNavBack)
-    ON_COMMAND(ID_NAV_FORWARD, OnNavForward)
-    ON_COMMAND(ID_NAV_HOME, OnNavHome)
-    ON_COMMAND(ID_NAV_RELOAD, OnNavReload)
-    ON_COMMAND(ID_NAV_STOP, OnNavStop)
-    ON_COMMAND(ID_EDIT_CUT, OnCut)
-    ON_COMMAND(ID_EDIT_COPY, OnCopy)
-    ON_COMMAND(ID_EDIT_PASTE, OnPaste)
-    ON_COMMAND(ID_EDIT_UNDO, OnUndoUrlBarEditOp)
-    ON_COMMAND(ID_EDIT_SELECT_ALL, OnSelectAll)
-    ON_COMMAND(ID_EDIT_SELECT_NONE, OnSelectNone)
-    ON_COMMAND(ID_OPEN_LINK_IN_NEW_WINDOW, OnOpenLinkInNewWindow)
-    ON_COMMAND(ID_VIEW_IMAGE, OnViewImageInNewWindow)
-    ON_COMMAND(ID_COPY_LINK_LOCATION, OnCopyLinkLocation)
-    ON_COMMAND(ID_SAVE_LINK_AS, OnSaveLinkAs)
-    ON_COMMAND(ID_SAVE_IMAGE_AS, OnSaveImageAs)
-    ON_COMMAND(ID_EDIT_FIND, OnShowFindDlg)
-    ON_COMMAND(ID_FILE_PRINT, OnFilePrint)
-    ON_COMMAND(ID_FILE_PRINTPREVIEW, OnFilePrintPreview)
-    ON_COMMAND(ID_FILE_PRINTSETUP, OnFilePrintSetup)
-    ON_REGISTERED_MESSAGE(WM_FINDMSG, OnFindMsg)
-    ON_COMMAND(ID_VIEW_FRAME_SOURCE, OnViewFrameSource)
-    ON_COMMAND(ID_OPEN_FRAME_IN_NEW_WINDOW, OnOpenFrameInNewWindow)
-
-    // Menu/Toolbar UI update handlers
-    ON_UPDATE_COMMAND_UI(ID_NAV_BACK, OnUpdateNavBack)
-    ON_UPDATE_COMMAND_UI(ID_NAV_FORWARD, OnUpdateNavForward)
-    ON_UPDATE_COMMAND_UI(ID_NAV_STOP, OnUpdateNavStop)
-    ON_UPDATE_COMMAND_UI(ID_EDIT_CUT, OnUpdateCut)
-    ON_UPDATE_COMMAND_UI(ID_EDIT_COPY, OnUpdateCopy)
-    ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, OnUpdatePaste)
-    ON_UPDATE_COMMAND_UI(ID_FILE_PRINT, OnUpdateFilePrint)
-    ON_UPDATE_COMMAND_UI(ID_FILE_PRINTSETUP, OnUpdatePrintSetup)
-    ON_UPDATE_COMMAND_UI(ID_VIEW_IMAGE, OnUpdateViewImage)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-CBrowserView::CBrowserView()
-{
-    mWebBrowser = nsnull;
-    mBaseWindow = nsnull;
-    mWebNav = nsnull;
-
-    mpBrowserImpl = nsnull;
-    mpBrowserFrame = nsnull;
-    mpBrowserFrameGlue = nsnull;
-
-    mbDocumentLoading = PR_FALSE;
-
-    m_pFindDlg = NULL;
-    m_bUrlBarClipOp = FALSE;
-    m_bCurrentlyPrinting = FALSE;
-
-    m_SecurityState = SECURITY_STATE_INSECURE;
-
-  m_InPrintPreview = FALSE;
-}
-
-CBrowserView::~CBrowserView()
-{
-}
-
-// This is a good place to create the embeddable browser
-// instance
-//
-int CBrowserView::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
-    CreateBrowser();
-
-    return 0;
-}
-
-void CBrowserView::OnDestroy()
-{
-    DestroyBrowser();
-}
-
-// Create an instance of the Mozilla embeddable browser
-//
-HRESULT CBrowserView::CreateBrowser() 
-{       
-    // Create web shell
-    nsresult rv;
-    mWebBrowser = do_CreateInstance(NS_WEBBROWSER_CONTRACTID, &rv);
-    if(NS_FAILED(rv))
-        return rv;
-
-    // Save off the nsIWebNavigation interface pointer 
-    // in the mWebNav member variable which we'll use 
-    // later for web page navigation
-    //
-    rv = NS_OK;
-    mWebNav = do_QueryInterface(mWebBrowser, &rv);
-    if(NS_FAILED(rv))
-        return rv;
-
-    // Create the CBrowserImpl object - this is the object
-    // which implements the interfaces which are required
-    // by an app embedding mozilla i.e. these are the interfaces
-    // thru' which the *embedded* browser communicates with the
-    // *embedding* app
-    //
-    // The CBrowserImpl object will be passed in to the 
-    // SetContainerWindow() call below
-    //
-    // Also note that we're passing the BrowserFrameGlue pointer 
-    // and also the mWebBrowser interface pointer via CBrowserImpl::Init()
-    // of CBrowserImpl object. 
-    // These pointers will be saved by the CBrowserImpl object.
-    // The CBrowserImpl object uses the BrowserFrameGlue pointer to 
-    // call the methods on that interface to update the status/progress bars
-    // etc.
-    mpBrowserImpl = new CBrowserImpl();
-    if(mpBrowserImpl == nsnull)
-        return NS_ERROR_OUT_OF_MEMORY;
-
-    // Pass along the mpBrowserFrameGlue pointer to the BrowserImpl object
-    // This is the interface thru' which the XP BrowserImpl code communicates
-    // with the platform specific code to update status bars etc.
-    mpBrowserImpl->Init(mpBrowserFrameGlue, mWebBrowser);
-    mpBrowserImpl->AddRef();
-
-    mWebBrowser->SetContainerWindow(NS_STATIC_CAST(nsIWebBrowserChrome*, mpBrowserImpl));
-
-    rv = NS_OK;
-    nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser, &rv);
-    if(NS_FAILED(rv))
-        return rv;
-
-    // If the browser window hosting chrome or content?
-    dsti->SetItemType(((CMfcEmbedApp *)AfxGetApp())->m_bChrome ?
-        nsIDocShellTreeItem::typeChromeWrapper :
-        nsIDocShellTreeItem::typeContentWrapper);
-
-    // Create the real webbrowser window
-  
-    // Note that we're passing the m_hWnd in the call below to InitWindow()
-    // (CBrowserView inherits the m_hWnd from CWnd)
-    // This m_hWnd will be used as the parent window by the embeddable browser
-    //
-    rv = NS_OK;
-    mBaseWindow = do_QueryInterface(mWebBrowser, &rv);
-    if(NS_FAILED(rv))
-        return rv;
-
-    // Get the view's ClientRect which to be passed in to the InitWindow()
-    // call below
-    RECT rcLocation;
-    GetClientRect(&rcLocation);
-    if(IsRectEmpty(&rcLocation))
-    {
-        rcLocation.bottom++;
-        rcLocation.top++;
-    }
-
-    rv = mBaseWindow->InitWindow(nsNativeWidget(m_hWnd), nsnull,
-        0, 0, rcLocation.right - rcLocation.left, rcLocation.bottom - rcLocation.top);
-    rv = mBaseWindow->Create();
-
-    // Register the BrowserImpl object to receive progress messages
-    // These callbacks will be used to update the status/progress bars
-    nsWeakPtr weakling(
-        do_GetWeakReference(NS_STATIC_CAST(nsIWebProgressListener*, mpBrowserImpl)));
-    (void)mWebBrowser->AddWebBrowserListener(weakling, 
-                                NS_GET_IID(nsIWebProgressListener));
-
-    // Finally, show the web browser window
-    mBaseWindow->SetVisibility(PR_TRUE);
-
-    return S_OK;
-}
-
-HRESULT CBrowserView::DestroyBrowser() 
-{       
-    if(mBaseWindow)
-    {
-        mBaseWindow->Destroy();
-        mBaseWindow = nsnull;
-    }
-
-    if(mpBrowserImpl)
-    {
-        mpBrowserImpl->Release();
-        mpBrowserImpl = nsnull;
-    }
-
-    return NS_OK;
-}
-
-BOOL CBrowserView::PreCreateWindow(CREATESTRUCT& cs) 
-{
-    if (!CWnd::PreCreateWindow(cs))
-        return FALSE;
-
-    cs.dwExStyle |= WS_EX_CLIENTEDGE;
-    cs.style &= ~WS_BORDER;
-    cs.style |= WS_CLIPCHILDREN;
-    cs.lpszClass = AfxRegisterWndClass(CS_DBLCLKS, 
-        ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
-
-    return TRUE;
-}
-
-// Adjust the size of the embedded browser
-// in response to any container size changes
-//
-void CBrowserView::OnSize( UINT nType, int cx, int cy)
-{
-    mBaseWindow->SetPositionAndSize(0, 0, cx, cy, PR_TRUE);    
-}
-
-// Called by this object's creator i.e. the CBrowserFrame object
-// to pass it's pointer to us
-//
-void CBrowserView::SetBrowserFrame(CBrowserFrame* pBrowserFrame)
-{
-    mpBrowserFrame = pBrowserFrame;
-}
-
-void CBrowserView::SetBrowserFrameGlue(PBROWSERFRAMEGLUE pBrowserFrameGlue)
-{
-    mpBrowserFrameGlue = pBrowserFrameGlue;
-}
-
-// A new URL was entered in the URL bar
-// Get the URL's text from the Urlbar's (ComboBox's) EditControl 
-// and navigate to that URL
-//
-void CBrowserView::OnNewUrlEnteredInUrlBar()
-{
-    // Get the currently entered URL
-    CString strUrl;
-    mpBrowserFrame->m_wndUrlBar.GetEnteredURL(strUrl);
-
-    if(IsViewSourceUrl(strUrl))
-        OpenViewSourceWindow(strUrl.GetBuffer(0));
-    else
-        // Navigate to that URL
-        OpenURL(strUrl.GetBuffer(0));
-
-    // Add what was just entered into the UrlBar
-    mpBrowserFrame->m_wndUrlBar.AddURLToList(strUrl);
-}
-
-// A URL has  been selected from the UrlBar's dropdown list
-//
-void CBrowserView::OnUrlSelectedInUrlBar()
-{
-    CString strUrl;
-    
-    mpBrowserFrame->m_wndUrlBar.GetSelectedURL(strUrl);
-
-    if(IsViewSourceUrl(strUrl))
-        OpenViewSourceWindow(strUrl.GetBuffer(0));
-    else
-        OpenURL(strUrl.GetBuffer(0));
-}
-
-BOOL CBrowserView::IsViewSourceUrl(CString& strUrl)
-{
-    return (strUrl.Find(_T("view-source:"), 0) != -1) ? TRUE : FALSE;
-}
-
-BOOL CBrowserView::OpenViewSourceWindow(const char* pUrl)
-{
-    nsEmbedString str;
-    NS_CStringToUTF16(nsEmbedCString(pUrl), NS_CSTRING_ENCODING_ASCII, str);
-    return OpenViewSourceWindow(str.get());
-}
-
-BOOL CBrowserView::OpenViewSourceWindow(const PRUnichar* pUrl)
-{
-    // Create a new browser frame in which we'll show the document source
-    // Note that we're getting rid of the toolbars etc. by specifying
-    // the appropriate chromeFlags
-    PRUint32 chromeFlags =  nsIWebBrowserChrome::CHROME_WINDOW_BORDERS |
-                            nsIWebBrowserChrome::CHROME_TITLEBAR |
-                            nsIWebBrowserChrome::CHROME_WINDOW_RESIZE;
-    CBrowserFrame* pFrm = CreateNewBrowserFrame(chromeFlags);
-    if(!pFrm)
-        return FALSE;
-
-    // Finally, load this URI into the newly created frame
-    pFrm->m_wndBrowserView.OpenURL(pUrl);
-
-    pFrm->BringWindowToTop();
-
-    return TRUE;
-}
-
-void CBrowserView::OnViewSource() 
-{
-    if(! mWebNav)
-        return;
-
-    // Get the URI object whose source we want to view.
-    nsresult rv = NS_OK;
-    nsCOMPtr<nsIURI> currentURI;
-    rv = mWebNav->GetCurrentURI(getter_AddRefs(currentURI));
-    if(NS_FAILED(rv) || !currentURI)
-        return;
-
-    // Get the uri string associated with the nsIURI object
-    nsEmbedCString uriString;
-    rv = currentURI->GetSpec(uriString);
-    if(NS_FAILED(rv))
-        return;
-
-    // Build the view-source: url
-    nsEmbedCString viewSrcUrl("view-source:");
-    viewSrcUrl.Append(uriString);
-
-    OpenViewSourceWindow(viewSrcUrl.get());
-}
-
-void CBrowserView::OnViewInfo() 
-{
-    AfxMessageBox(_T("To Be Done..."));
-}
-
-void CBrowserView::OnNavBack() 
-{
-    if(mWebNav)
-        mWebNav->GoBack();
-}
-
-void CBrowserView::OnUpdateNavBack(CCmdUI* pCmdUI)
-{
-    PRBool canGoBack = PR_FALSE;
-
-    if (mWebNav)
-        mWebNav->GetCanGoBack(&canGoBack);
-
-    pCmdUI->Enable(canGoBack);
-}
-
-void CBrowserView::OnNavForward() 
-{
-    if(mWebNav)
-        mWebNav->GoForward();
-}
-
-void CBrowserView::OnUpdateNavForward(CCmdUI* pCmdUI)
-{
-    PRBool canGoFwd = PR_FALSE;
-
-    if (mWebNav)
-        mWebNav->GetCanGoForward(&canGoFwd);
-
-    pCmdUI->Enable(canGoFwd);
-}
-
-void CBrowserView::OnNavHome() 
-{
-    // Get the currently configured HomePage URL
-    CString strHomeURL;
-    CMfcEmbedApp *pApp = (CMfcEmbedApp *)AfxGetApp();
-    if(pApp)
-        pApp->GetHomePage(strHomeURL);
-
-    if(strHomeURL.GetLength() > 0)
-        OpenURL(strHomeURL);    
-}
-
-void CBrowserView::OnNavReload() 
-{
-    PRUint32 loadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
-    if (GetKeyState(VK_SHIFT))
-        loadFlags = nsIWebNavigation::LOAD_FLAGS_BYPASS_CACHE;
-    if (mWebNav)
-        mWebNav->Reload(loadFlags);
-}
-
-void CBrowserView::OnNavStop() 
-{
-    if(mWebNav)
-        mWebNav->Stop(nsIWebNavigation::STOP_ALL);
-}
-
-void CBrowserView::OnUpdateNavStop(CCmdUI* pCmdUI)
-{
-    pCmdUI->Enable(mbDocumentLoading);
-}
-
-void CBrowserView::OnCut()
-{
-    if(m_bUrlBarClipOp)
-    {
-        // We need to operate on the URLBar selection
-        mpBrowserFrame->CutUrlBarSelToClipboard();
-        m_bUrlBarClipOp = FALSE;
-    }
-    else
-    {
-        nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-
-        if(clipCmds)
-            clipCmds->CutSelection();
-    }
-}
-
-void CBrowserView::OnUpdateCut(CCmdUI* pCmdUI)
-{
-    PRBool canCutSelection = PR_FALSE;
-
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-    if (clipCmds)
-        clipCmds->CanCutSelection(&canCutSelection);
-
-    if(!canCutSelection)
-    {
-        // Check to see if the Cut cmd is to cut the URL 
-        // selection in the UrlBar
-        if(mpBrowserFrame->CanCutUrlBarSelection())
-        {
-            canCutSelection = TRUE;
-            m_bUrlBarClipOp = TRUE;
-        }
-    }
-
-    pCmdUI->Enable(canCutSelection);
-}
-
-void CBrowserView::OnCopy()
-{
-    if(m_bUrlBarClipOp)
-    {
-        // We need to operate on the URLBar selection
-        mpBrowserFrame->CopyUrlBarSelToClipboard();
-        m_bUrlBarClipOp = FALSE;
-    }
-    else
-    {
-        // We need to operate on the web page content
-        nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-
-        if(clipCmds)
-            clipCmds->CopySelection();
-    }
-}
-
-void CBrowserView::OnUpdateCopy(CCmdUI* pCmdUI)
-{
-    PRBool canCopySelection = PR_FALSE;
-
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-    if (clipCmds)
-        clipCmds->CanCopySelection(&canCopySelection);
-
-    if(!canCopySelection)
-    {
-        // Check to see if the Copy cmd is to copy the URL 
-        // selection in the UrlBar
-        if(mpBrowserFrame->CanCopyUrlBarSelection())
-        {
-            canCopySelection = TRUE;
-            m_bUrlBarClipOp = TRUE;
-        }
-    }
-
-    pCmdUI->Enable(canCopySelection);
-}
-
-void CBrowserView::OnPaste()
-{
-    if(m_bUrlBarClipOp)
-    {
-        mpBrowserFrame->PasteFromClipboardToUrlBar();
-        m_bUrlBarClipOp = FALSE;
-    }
-    else
-    {
-        nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-
-        if(clipCmds)
-            clipCmds->Paste();
-    }    
-}
-
-void CBrowserView::OnUndoUrlBarEditOp()
-{
-    if(mpBrowserFrame->CanUndoUrlBarEditOp())
-        mpBrowserFrame->UndoUrlBarEditOp();
-}
-
-void CBrowserView::OnUpdatePaste(CCmdUI* pCmdUI)
-{
-    PRBool canPaste = PR_FALSE;
-
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-    if (clipCmds)
-        clipCmds->CanPaste(&canPaste);
-
-    if(!canPaste)
-    {
-        if(mpBrowserFrame->CanPasteToUrlBar())
-        {
-            canPaste = TRUE;
-            m_bUrlBarClipOp = TRUE;
-        }
-    }
-
-    pCmdUI->Enable(canPaste);
-}
-
-void CBrowserView::OnSelectAll()
-{
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-
-    if(clipCmds)
-        clipCmds->SelectAll();
-}
-
-void CBrowserView::OnSelectNone()
-{
-    nsCOMPtr<nsIClipboardCommands> clipCmds = do_GetInterface(mWebBrowser);
-
-    if(clipCmds)
-        clipCmds->SelectNone();
-}
-
-void CBrowserView::OnFileOpen()
-{
-    TCHAR *lpszFilter =
-        _T("HTML Files Only (*.htm;*.html)|*.htm;*.html|")
-        _T("All Files (*.*)|*.*||");
-
-    CFileDialog cf(TRUE, NULL, NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
-                    lpszFilter, this);
-    if(cf.DoModal() == IDOK)
-    {
-        CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm
-        OpenURL(strFullPath);
-    }
-}
-
-void CBrowserView::GetBrowserWindowTitle(nsAString& title)
-{
-    PRUnichar *idlStrTitle = nsnull;
-    if(mBaseWindow)
-        mBaseWindow->GetTitle(&idlStrTitle);
-
-    title = idlStrTitle;
-    nsMemory::Free(idlStrTitle);
-}
-
-void CBrowserView::OnFileSaveAs()
-{
-    nsEmbedString fileName;
-
-    GetBrowserWindowTitle(fileName); // Suggest the window title as the filename
-
-    // Sanitize the file name of all illegal characters
-
-    USES_CONVERSION;
-    CompressWhitespace(fileName);     // Remove whitespace from the ends
-    StripChars(fileName, "\\*|:\"><?"); // Strip illegal characters
-    ReplaceChar(fileName, '.', L'_');   // Dots become underscores
-    ReplaceChar(fileName, '/', L'-');   // Forward slashes become hyphens
-
-    TCHAR *lpszFilter =
-        _T("Web Page, HTML Only (*.htm;*.html)|*.htm;*.html|")
-        _T("Web Page, Complete (*.htm;*.html)|*.htm;*.html|")
-        _T("Text File (*.txt)|*.txt||");
-
-    CFileDialog cf(FALSE, _T("htm"), W2CT(fileName.get()), OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
-                    lpszFilter, this);
-
-    if(cf.DoModal() == IDOK)
-    {
-        CString strFullPath = cf.GetPathName(); // Will be like: c:\tmp\junk.htm
-        TCHAR *pStrFullPath = strFullPath.GetBuffer(0); // Get char * for later use
-        
-        BOOL bSaveAll = FALSE;        
-        CString strDataPath; 
-        TCHAR *pStrDataPath = NULL;
-        if(cf.m_ofn.nFilterIndex == 2) 
-        {
-            // cf.m_ofn.nFilterIndex == 2 indicates
-            // user want to save the complete document including
-            // all frames, images, scripts, stylesheets etc.
-
-            bSaveAll = TRUE;
-
-            int idxPeriod = strFullPath.ReverseFind('.');
-            strDataPath = strFullPath.Mid(0, idxPeriod);
-            strDataPath += "_files";
-
-            // At this stage strDataPath will be of the form
-            // c:\tmp\junk_files - assuming we're saving to a file
-            // named junk.htm
-            // Any images etc in the doc will be saved to a dir
-            // with the name c:\tmp\junk_files
-
-            pStrDataPath = strDataPath.GetBuffer(0); //Get char * for later use
-        }
-
-        // Save the file
-        nsCOMPtr<nsIWebBrowserPersist> persist(do_QueryInterface(mWebBrowser));
-        if(persist)
-        {
-            nsEmbedCString fullPath(T2CA(pStrFullPath));
-            nsCOMPtr<nsILocalFile> file;
-            NS_NewNativeLocalFile(fullPath, TRUE, getter_AddRefs(file));
-
-            nsCOMPtr<nsILocalFile> data;
-            if (pStrDataPath)
-            {
-                nsEmbedCString dataPath(T2CA(pStrDataPath));
-                NS_NewNativeLocalFile(dataPath, TRUE, getter_AddRefs(data));
-            }
-
-            if(bSaveAll)
-                persist->SaveDocument(nsnull, file, data, nsnull, 0, 0);
-            else
-                persist->SaveURI(nsnull, nsnull, nsnull, nsnull, nsnull, file);
-        }
-    }
-}
-
-void CBrowserView::OpenURL(const char* pUrl)
-{
-    nsEmbedString str;
-    NS_CStringToUTF16(nsEmbedCString(pUrl), NS_CSTRING_ENCODING_ASCII, str);
-    OpenURL(str.get());
-}
-
-void CBrowserView::OpenURL(const PRUnichar* pUrl)
-{
-    if(mWebNav)
-        mWebNav->LoadURI(pUrl,                              // URI string
-                         nsIWebNavigation::LOAD_FLAGS_NONE, // Load flags
-                         nsnull,                            // Referring URI
-                         nsnull,                            // Post data
-                         nsnull);                           // Extra headers
-}
-
-CBrowserFrame* CBrowserView::CreateNewBrowserFrame(PRUint32 chromeMask, 
-                                    PRInt32 x, PRInt32 y, 
-                                    PRInt32 cx, PRInt32 cy,
-                                    PRBool bShowWindow)
-{
-    CMfcEmbedApp *pApp = (CMfcEmbedApp *)AfxGetApp();
-    if(!pApp)
-        return NULL;
-
-    return pApp->CreateNewBrowserFrame(chromeMask, x, y, cx, cy, bShowWindow);
-}
-
-void CBrowserView::OpenURLInNewWindow(const PRUnichar* pUrl)
-{
-    if(!pUrl)
-        return;
-
-    CBrowserFrame* pFrm = CreateNewBrowserFrame();
-    if(!pFrm)
-        return;
-
-    // Load the URL into it...
-
-    // Note that OpenURL() is overloaded - one takes a "char *"
-    // and the other a "PRUniChar *". We're using the "PRUnichar *"
-    // version here
-
-    pFrm->m_wndBrowserView.OpenURL(pUrl);
-}
-
-void CBrowserView::LoadHomePage()
-{
-    OnNavHome();
-}
-
-void CBrowserView::OnCopyLinkLocation()
-{
-    if(! mCtxMenuLinkUrl.Length())
-        return;
-
-    if (! OpenClipboard())
-        return;
-
-    PRUint32 size = mCtxMenuLinkUrl.Length() + 1;
-
-    HGLOBAL hClipData = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, size);
-    if(! hClipData)
-        return;
-
-    char *pszClipData = (char*)::GlobalLock(hClipData);
-    if(!pszClipData)
-        return;
-
-    memcpy(pszClipData, mCtxMenuLinkUrl.get(), size);
-
-    GlobalUnlock(hClipData);
-
-    EmptyClipboard();
-    SetClipboardData(CF_TEXT, hClipData);
-    CloseClipboard();
-}
-
-void CBrowserView::OnOpenLinkInNewWindow()
-{
-    if(mCtxMenuLinkUrl.Length())
-        OpenURLInNewWindow(mCtxMenuLinkUrl.get());
-}
-
-void CBrowserView::OnViewImageInNewWindow()
-{
-    if(mCtxMenuImgSrc.Length())
-        OpenURLInNewWindow(mCtxMenuImgSrc.get());
-}
-
-void CBrowserView::OnUpdateViewImage(CCmdUI *pCmdUI)
-{
-    pCmdUI->Enable(mCtxMenuImgSrc.Length() > 0);
-}
-
-void CBrowserView::OnSaveLinkAs()
-{
-    if(! mCtxMenuLinkUrl.Length())
-        return;
-
-    // Try to get the file name part from the URL
-    // To do that we first construct an obj which supports 
-    // nsIRUI interface. Makes it easy to extract portions
-    // of a URL like the filename, scheme etc. + We'll also
-    // use it while saving this link to a file
-    nsresult rv   = NS_OK;
-    nsCOMPtr<nsIURI> linkURI;
-    rv = NewURI(getter_AddRefs(linkURI), mCtxMenuLinkUrl);
-    if (NS_FAILED(rv)) 
-        return;
-
-    // Get the "path" portion (see nsIURI.h for more info
-    // on various parts of a URI)
-    nsEmbedCString fileName;
-    linkURI->GetPath(fileName);
-
-    // The path may have the "/" char in it - strip those
-    StripChars(fileName, "\\/");
-
-    // Now, use this file name in a File Save As dlg...
-
-    TCHAR *lpszFilter =
-        _T("HTML Files (*.htm;*.html)|*.htm;*.html|")
-        _T("Text Files (*.txt)|*.txt|")
-        _T("All Files (*.*)|*.*||");
-
-    CString strFilename = fileName.get();
-
-    CFileDialog cf(FALSE, _T("htm"), strFilename, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
-        lpszFilter, this);
-    if(cf.DoModal() == IDOK)
-    {
-        USES_CONVERSION;
-        nsEmbedCString fullPath; fullPath.Assign(T2CA(cf.GetPathName()));
-        nsCOMPtr<nsIWebBrowserPersist> persist(do_QueryInterface(mWebBrowser));
-        if(persist)
-        {
-            nsCOMPtr<nsILocalFile> file;
-            NS_NewNativeLocalFile(fullPath, TRUE, getter_AddRefs(file));
-            persist->SaveURI(linkURI, nsnull, nsnull, nsnull, nsnull, file);
-        }
-    }
-}
-
-void CBrowserView::OnSaveImageAs()
-{
-    if(! mCtxMenuImgSrc.Length())
-        return;
-
-    // Try to get the file name part from the URL
-    // To do that we first construct an obj which supports 
-    // nsIRUI interface. Makes it easy to extract portions
-    // of a URL like the filename, scheme etc. + We'll also
-    // use it while saving this link to a file
-    nsresult rv   = NS_OK;
-    nsCOMPtr<nsIURI> linkURI;
-    rv = NewURI(getter_AddRefs(linkURI), mCtxMenuImgSrc);
-    if (NS_FAILED(rv)) 
-        return;
-
-    // Get the "path" portion (see nsIURI.h for more info
-    // on various parts of a URI)
-    nsEmbedCString path;
-    linkURI->GetPath(path);
-
-    // The path may have the "/" char in it - strip those
-    nsEmbedCString fileName(path);
-    StripChars(fileName, "\\/");
-
-    // Now, use this file name in a File Save As dlg...
-
-    TCHAR *lpszFilter = _T("All Files (*.*)|*.*||");
-    CString strFilename = fileName.get();
-
-    CFileDialog cf(FALSE, NULL, strFilename, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,
-        lpszFilter, this);
-    if(cf.DoModal() == IDOK)
-    {
-        USES_CONVERSION;
-        nsEmbedCString fullPath; fullPath.Assign(T2CA(cf.GetPathName()));
-
-        nsCOMPtr<nsIWebBrowserPersist> persist(do_QueryInterface(mWebBrowser));
-        if(persist)
-        {
-            nsCOMPtr<nsILocalFile> file;
-            NS_NewNativeLocalFile(fullPath, TRUE, getter_AddRefs(file));
-            persist->SaveURI(linkURI, nsnull, nsnull, nsnull, nsnull, file);
-        }
-    }
-}
-
-void CBrowserView::OnShowFindDlg() 
-{
-    // When the the user chooses the Find menu item
-    // and if a Find dlg. is already being shown
-    // just set focus to the existing dlg instead of
-    // creating a new one
-    if(m_pFindDlg)
-    {
-        m_pFindDlg->SetFocus();
-        return;
-    }
-
-    CString csSearchStr;
-    PRBool bMatchCase = PR_FALSE;
-    PRBool bMatchWholeWord = PR_FALSE;
-    PRBool bWrapAround = PR_FALSE;
-    PRBool bSearchBackwards = PR_FALSE;
-
-    // See if we can get and initialize the dlg box with
-    // the values/settings the user specified in the previous search
-    nsCOMPtr<nsIWebBrowserFind> finder(do_GetInterface(mWebBrowser));
-    if(finder)
-    {
-        PRUnichar *stringBuf = nsnull;
-        finder->GetSearchString(&stringBuf);
-        csSearchStr = stringBuf;
-        nsMemory::Free(stringBuf);
-
-        finder->GetMatchCase(&bMatchCase);
-        finder->GetEntireWord(&bMatchWholeWord);
-        finder->GetWrapFind(&bWrapAround);
-        finder->GetFindBackwards(&bSearchBackwards);        
-    }
-
-    m_pFindDlg = new CFindDialog(csSearchStr, bMatchCase, bMatchWholeWord,
-                            bWrapAround, bSearchBackwards, this);
-    m_pFindDlg->Create(TRUE, NULL, NULL, 0, this);
-}
-
-// This will be called whenever the user pushes the Find
-// button in the Find dialog box
-// This method gets bound to the WM_FINDMSG windows msg via the 
-//
-//       ON_REGISTERED_MESSAGE(WM_FINDMSG, OnFindMsg) 
-//
-//    message map entry.
-//
-// WM_FINDMSG (which is registered towards the beginning of this file)
-// is the message via which the FindDialog communicates with this view
-//
-LRESULT CBrowserView::OnFindMsg(WPARAM wParam, LPARAM lParam)
-{
-    nsCOMPtr<nsIWebBrowserFind> finder(do_GetInterface(mWebBrowser));
-    if(!finder)
-        return NULL;
-
-    // Get the pointer to the current Find dialog box
-    CFindDialog* dlg = (CFindDialog *) CFindReplaceDialog::GetNotifier(lParam);
-    if(!dlg) 
-        return NULL;
-
-    // Has the user decided to terminate the dialog box?
-    if(dlg->IsTerminating())
-        return NULL;
-
-    if(dlg->FindNext())
-    {
-        USES_CONVERSION;
-        finder->SetSearchString(T2W(dlg->GetFindString().GetBuffer(0)));
-        finder->SetMatchCase(dlg->MatchCase() ? PR_TRUE : PR_FALSE);
-        finder->SetEntireWord(dlg->MatchWholeWord() ? PR_TRUE : PR_FALSE);
-        finder->SetWrapFind(dlg->WrapAround() ? PR_TRUE : PR_FALSE);
-        finder->SetFindBackwards(dlg->SearchBackwards() ? PR_TRUE : PR_FALSE);
-
-        PRBool didFind;
-        nsresult rv = finder->FindNext(&didFind);
-        
-        if(!didFind)
-        {
-            AfxMessageBox(IDS_SRCH_STR_NOT_FOUND);
-            dlg->SetFocus();
-        }
-
-        return (NS_SUCCEEDED(rv) && didFind);
-    }
-
-    return 0;
-}
-
-void CBrowserView::OnFilePrint()
-{
-  nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
-    if(print)
-    {
-    if (!m_PrintSettings) 
-    {
-      if (NS_FAILED(print->GetGlobalPrintSettings(getter_AddRefs(m_PrintSettings)))) {
-        return;
-      }
-    }
-    nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
-      if(print)
-    {
-      print->Print(m_PrintSettings, nsnull);
-    }
-
-  }
-}
-
-void CBrowserView::OnFilePrintPreview()
-{
-  nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
-    if(print)
-    {
-    if (!m_PrintSettings) 
-    {
-      if (NS_FAILED(print->GetGlobalPrintSettings(getter_AddRefs(m_PrintSettings)))) {
-        return;
-      }
-    }
-    if (!m_InPrintPreview) 
-    {
-      if (NS_SUCCEEDED(print->PrintPreview(m_PrintSettings, nsnull, nsnull))) 
-      {
-        m_InPrintPreview = TRUE;
-
-        CMenu* menu = mpBrowserFrame->GetMenu();
-        if (menu) 
-        {
-          menu->CheckMenuItem( ID_FILE_PRINTPREVIEW, MF_CHECKED );
-        }
-      }
-    } 
-    else 
-    {
-      if (NS_SUCCEEDED(print->ExitPrintPreview())) 
-      {
-        m_InPrintPreview = FALSE;
-        CMenu* menu = mpBrowserFrame->GetMenu();
-        if (menu) 
-        {
-          menu->CheckMenuItem( ID_FILE_PRINTPREVIEW, MF_UNCHECKED );
-        }
-      }
-    }
-  }
-}
-
-void CBrowserView::OnFilePrintSetup()
-{
-  nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
-    if(print)
-  {
-    if (!m_PrintSettings) 
-    {
-      if (NS_FAILED(print->GetGlobalPrintSettings(getter_AddRefs(m_PrintSettings)))) {
-        return;
-      }
-    }
-    CPageSetupPropSheet propSheet(_T("Page Setup"), this);
-
-    propSheet.SetPrintSettingsValues(m_PrintSettings);
-
-    int status = propSheet.DoModal();
-    if (status == IDOK) 
-    {
-      propSheet.GetPrintSettingsValues(m_PrintSettings);
-    }
-  }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-void CBrowserView::OnUpdateFilePrint(CCmdUI* pCmdUI)
-{
-    pCmdUI->Enable(!m_bCurrentlyPrinting);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-void CBrowserView::OnUpdatePrintSetup(CCmdUI* pCmdUI)
-{
-    pCmdUI->Enable(!m_bCurrentlyPrinting && !m_InPrintPreview);
-}
-
-
-
-// Called from the busy state related methods in the 
-// BrowserFrameGlue object
-//
-// When aBusy is TRUE it means that browser is busy loading a URL
-// When aBusy is FALSE, it's done loading
-// We use this to update our STOP tool bar button
-//
-// We basically note this state into a member variable
-// The actual toolbar state will be updated in response to the
-// ON_UPDATE_COMMAND_UI method - OnUpdateNavStop() being called
-//
-void CBrowserView::UpdateBusyState(PRBool aBusy)
-{
-  if (mbDocumentLoading && !aBusy && m_InPrintPreview)
-  {
-      nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
-        if(print)
-        {
-          PRBool isDoingPP;
-          print->GetDoingPrintPreview(&isDoingPP);
-          if (!isDoingPP) 
-          {
-              m_InPrintPreview = FALSE;
-              CMenu* menu = mpBrowserFrame->GetMenu();
-              if (menu) 
-              {
-                  menu->CheckMenuItem( ID_FILE_PRINTPREVIEW, MF_UNCHECKED );
-              }
-          }
-      }
-  }
-    mbDocumentLoading = aBusy;
-}
-
-void CBrowserView::SetCtxMenuLinkUrl(nsEmbedString& strLinkUrl)
-{
-    mCtxMenuLinkUrl = strLinkUrl;
-}
-
-void CBrowserView::SetCtxMenuImageSrc(nsEmbedString& strImgSrc)
-{
-    mCtxMenuImgSrc = strImgSrc;
-}
-
-void CBrowserView::SetCurrentFrameURL(nsEmbedString& strCurrentFrameURL)
-{
-    mCtxMenuCurrentFrameURL = strCurrentFrameURL;
-}
-
-void CBrowserView::Activate(UINT nState, CWnd* pWndOther, BOOL bMinimized) 
-{
-    if(bMinimized)  // This isn't an activate event that Gecko cares about
-        return;
-
-    nsCOMPtr<nsIWebBrowserFocus> focus(do_GetInterface(mWebBrowser));
-    if(!focus)
-        return;
-    
-    switch(nState) {
-        case WA_ACTIVE:
-        case WA_CLICKACTIVE:
-            focus->Activate();
-            break;
-        case WA_INACTIVE:
-            focus->Deactivate();
-            break;
-        default:
-            break;
-    }
-}
-
-void CBrowserView::ShowSecurityInfo()
-{
-    HWND hParent = mpBrowserFrame->m_hWnd;
-
-    if(m_SecurityState == SECURITY_STATE_INSECURE) {
-        CString csMsg;
-        csMsg.LoadString(IDS_NOSECURITY_INFO);
-        ::MessageBox(hParent, csMsg, _T("MfcEmbed"), MB_OK);
-        return;
-    }
-
-    ::MessageBox(hParent, _T("To Be Done.........."), _T("MfcEmbed"), MB_OK);
-}
-
-// Determintes if the currently loaded document
-// contains frames
-//
-BOOL CBrowserView::ViewContentContainsFrames()
-{
-    nsresult rv = NS_OK;
-
-    // Get nsIDOMDocument from nsIWebNavigation
-    nsCOMPtr<nsIDOMDocument> domDoc;
-    rv = mWebNav->GetDocument(getter_AddRefs(domDoc));
-    if(NS_FAILED(rv))
-       return FALSE;
-
-    // QI nsIDOMDocument for nsIDOMHTMLDocument
-    nsCOMPtr<nsIDOMHTMLDocument> htmlDoc = do_QueryInterface(domDoc);
-    if (!htmlDoc)
-        return FALSE;
-   
-    // Get the <body> element of the doc
-    nsCOMPtr<nsIDOMHTMLElement> body;
-    rv = htmlDoc->GetBody(getter_AddRefs(body));
-    if(NS_FAILED(rv))
-       return FALSE;
-
-    // Is it of type nsIDOMHTMLFrameSetElement?
-    nsCOMPtr<nsIDOMHTMLFrameSetElement> frameset = do_QueryInterface(body);
-
-    return (frameset != nsnull);
-}
-
-void CBrowserView::OnViewFrameSource()
-{
-    // Build the view-source: url
-    //
-    nsEmbedString viewSrcUrl;
-    viewSrcUrl.Append(L"view-source:");
-    viewSrcUrl.Append(mCtxMenuCurrentFrameURL);
-
-    OpenViewSourceWindow(viewSrcUrl.get());
-}
-
-void CBrowserView::OnOpenFrameInNewWindow()
-{
-    if(mCtxMenuCurrentFrameURL.Length())
-        OpenURLInNewWindow(mCtxMenuCurrentFrameURL.get());
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/BrowserView.h
+++ /dev/null
@@ -1,205 +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):
- *   Chak Nanga <chak@netscape.com>
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// BrowserView.h : interface of the CBrowserView class
-//
-/////////////////////////////////////////////////////////////////////////////
-
-#ifndef _BROWSERVIEW_H
-#define _BROWSERVIEW_H
-
-#if _MSC_VER > 1000
-    #pragma once
-#endif
-
-#include "IBrowserFrameGlue.h"
-#include "nsIPrintSettings.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CBrowserView window
-
-class CBrowserFrame;
-class CBrowserImpl;
-class CFindDialog;
-class CPrintProgressDialog;
-
-class CBrowserView : public CWnd
-{
-public:
-    CBrowserView();
-    virtual ~CBrowserView();
-
-    // Some helper methods
-    HRESULT CreateBrowser();
-    HRESULT DestroyBrowser();
-    void OpenURL(const char* pUrl);
-    void OpenURL(const PRUnichar* pUrl);
-    CBrowserFrame* CreateNewBrowserFrame(PRUint32 chromeMask = nsIWebBrowserChrome::CHROME_ALL, 
-                            PRInt32 x = -1, PRInt32 y = -1, 
-                            PRInt32 cx = -1, PRInt32 cy = -1,
-                            PRBool bShowWindow = PR_TRUE);
-    void OpenURLInNewWindow(const PRUnichar* pUrl);
-    void LoadHomePage();
-
-    void GetBrowserWindowTitle(nsAString& title);
-    
-    // Called by the CBrowserFrame after it creates the view
-    // Essentially a back pointer to the BrowserFrame
-    void SetBrowserFrame(CBrowserFrame* pBrowserFrame);
-    CBrowserFrame* mpBrowserFrame;
-
-    // Called by the CBrowserFrame after it creates the view
-    // The view passes this on to the embedded Browser's Impl
-    // obj
-    void SetBrowserFrameGlue(PBROWSERFRAMEGLUE pBrowserFrameGlue);
-    PBROWSERFRAMEGLUE mpBrowserFrameGlue;
-
-    // Pointer to the object which implements
-    // the inerfaces required by Mozilla embedders
-    //
-    CBrowserImpl* mpBrowserImpl;
-
-    // Mozilla interfaces
-    //
-    nsCOMPtr<nsIWebBrowser> mWebBrowser;
-    nsCOMPtr<nsIBaseWindow> mBaseWindow;
-    nsCOMPtr<nsIWebNavigation> mWebNav;    
-
-    void UpdateBusyState(PRBool aBusy);
-    PRBool mbDocumentLoading;
-
-    void SetCtxMenuLinkUrl(nsEmbedString& strLinkUrl);
-    nsEmbedString mCtxMenuLinkUrl;
-
-    void SetCtxMenuImageSrc(nsEmbedString& strImgSrc);
-    nsEmbedString mCtxMenuImgSrc;
-
-    void SetCurrentFrameURL(nsEmbedString& strCurrentFrameURL);
-    nsEmbedString mCtxMenuCurrentFrameURL;
-
-    inline void ClearFindDialog() { m_pFindDlg = NULL; }
-    CFindDialog* m_pFindDlg;
-    CPrintProgressDialog* m_pPrintProgressDlg;
-    // When set to TRUE...
-    // indicates that the clipboard operation needs to be 
-    // performed on the UrlBar rather than on
-    // the web page content
-    //
-    BOOL m_bUrlBarClipOp;
-
-    // indicates whether we are currently printing
-    BOOL m_bCurrentlyPrinting;
-
-    void Activate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
-
-    BOOL OpenViewSourceWindow(const PRUnichar* pUrl);
-    BOOL OpenViewSourceWindow(const char* pUrl);
-    BOOL IsViewSourceUrl(CString& strUrl);
-
-    enum _securityState {
-        SECURITY_STATE_SECURE,
-        SECURITY_STATE_INSECURE,
-        SECURITY_STATE_BROKEN
-    };
-    int m_SecurityState;
-    void ShowSecurityInfo();
-
-    BOOL ViewContentContainsFrames();
-    
-    // Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CBrowserView)
-    protected:
-    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
-    //}}AFX_VIRTUAL
-
-
-    // Generated message map functions
-protected:
-    nsCOMPtr<nsIPrintSettings> m_PrintSettings;
-  BOOL                       m_InPrintPreview;
-
-    //{{AFX_MSG(CBrowserView)
-    afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-    afx_msg void OnDestroy();
-    afx_msg void OnSize( UINT, int, int );
-    // UrlBar command handlers
-    //
-    afx_msg void OnUrlSelectedInUrlBar();
-    afx_msg void OnNewUrlEnteredInUrlBar();
-
-    // ToolBar/Menu command handlers
-    //
-    afx_msg void OnFileOpen();
-    afx_msg void OnFileSaveAs();
-    afx_msg void OnViewSource();
-    afx_msg void OnViewInfo();
-    afx_msg void OnNavBack();
-    afx_msg void OnNavForward();
-    afx_msg void OnNavHome();
-    afx_msg void OnNavReload();
-    afx_msg void OnNavStop();
-    afx_msg void OnCut();
-    afx_msg void OnCopy();
-    afx_msg void OnPaste();
-    afx_msg void OnUndoUrlBarEditOp();
-    afx_msg void OnSelectAll();
-    afx_msg void OnSelectNone();
-    afx_msg void OnCopyLinkLocation();
-    afx_msg void OnOpenLinkInNewWindow();
-    afx_msg void OnViewImageInNewWindow();
-    afx_msg void OnSaveLinkAs();
-    afx_msg void OnSaveImageAs();
-    afx_msg void OnShowFindDlg();
-    afx_msg void OnFilePrint();
-    afx_msg void OnFilePrintPreview();
-    afx_msg void OnFilePrintSetup();
-    afx_msg void OnUpdateFilePrint(CCmdUI* pCmdUI);
-    afx_msg void OnUpdatePrintSetup(CCmdUI* pCmdUI);
-    afx_msg LRESULT OnFindMsg(WPARAM wParam, LPARAM lParam);
-    afx_msg void OnViewFrameSource();
-    afx_msg void OnOpenFrameInNewWindow();
-
-    // Handlers to keep the toolbar/menu items up to date
-    //
-    afx_msg void OnUpdateNavBack(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateNavForward(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateNavStop(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateCut(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateCopy(CCmdUI* pCmdUI);
-    afx_msg void OnUpdatePaste(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateViewImage(CCmdUI* pCmdUI);
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-};
-
-#endif //_BROWSERVIEW_H
deleted file mode 100644
--- a/embedding/tests/mfcembed/CCustomPromptDialog.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-// CustomPromptDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "mfcembed.h"
-#include "CCustomPromptDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CCustomPromptDialog dialog
-
-
-CCustomPromptDialog::CCustomPromptDialog(CWnd* pParent /*=NULL*/)
-	: CDialog(CCustomPromptDialog::IDD, pParent)
-{
-	//{{AFX_DATA_INIT(CCustomPromptDialog)
-	m_CustomText = _T("");
-	//}}AFX_DATA_INIT
-}
-
-
-void CCustomPromptDialog::DoDataExchange(CDataExchange* pDX)
-{
-	CDialog::DoDataExchange(pDX);
-	//{{AFX_DATA_MAP(CCustomPromptDialog)
-	DDX_Text(pDX, IDC_PROMPT_TEXT, m_CustomText);
-	//}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CCustomPromptDialog, CDialog)
-	//{{AFX_MSG_MAP(CCustomPromptDialog)
-		// NOTE: the ClassWizard will add message map macros here
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CCustomPromptDialog message handlers
deleted file mode 100644
--- a/embedding/tests/mfcembed/CCustomPromptDialog.h
+++ /dev/null
@@ -1,77 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(AFX_CCUSTOMPROMPTDIALOG_H__6C159F14_88A7_465F_993B_76B03D670DE5__INCLUDED_)
-#define AFX_CCUSTOMPROMPTDIALOG_H__6C159F14_88A7_465F_993B_76B03D670DE5__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// CCustomPromptDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CCustomPromptDialog dialog
-
-class CCustomPromptDialog : public CDialog
-{
-// Construction
-public:
-	CCustomPromptDialog(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-	//{{AFX_DATA(CCustomPromptDialog)
-	enum { IDD = IDD_CUSTOM_PROMPT_DIALOG };
-	CString	m_CustomText;
-	//}}AFX_DATA
-
-
-// Overrides
-	// ClassWizard generated virtual function overrides
-	//{{AFX_VIRTUAL(CCustomPromptDialog)
-	protected:
-	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-	//}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-	// Generated message map functions
-	//{{AFX_MSG(CCustomPromptDialog)
-		// NOTE: the ClassWizard will add member functions here
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CUSTOMPROMPTDIALOG_H__6C159F14_88A7_465F_993B_76B03D670DE5__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/CFormatOptionTab.cpp
+++ /dev/null
@@ -1,281 +0,0 @@
-// FormatOptionTab.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "mfcembed.h"
-#include "CFormatOptionTab.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-const int kMinScaleRange = 30;
-
-/////////////////////////////////////////////////////////////////////////////
-typedef struct {
-  TCHAR*   mDesc;
-  short   mUnit;
-  double  mWidth;
-  double  mHeight;
-  BOOL    mIsUserDefined;
-} PaperSizes;
-
-static const PaperSizes gPaperSize[] = {
-  {_T("Letter (8.5 x 11.0)"), nsIPrintSettings::kPaperSizeInches, 8.5, 11.0, FALSE},
-  {_T("Legal (8.5 x 14.0)"),  nsIPrintSettings::kPaperSizeInches, 8.5, 14.0, FALSE},
-  {_T("A4 (210 x 297mm)"),    nsIPrintSettings::kPaperSizeMillimeters, 210.0, 297.0, FALSE},
-  {_T("User Defined"),        nsIPrintSettings::kPaperSizeInches, 8.5, 11.0, TRUE}
-};
-static const int gNumPaperSizes = 4;
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CFormatOptionTab property page
-
-IMPLEMENT_DYNCREATE(CFormatOptionTab, CPropertyPage)
-
-CFormatOptionTab::CFormatOptionTab() : CPropertyPage(CFormatOptionTab::IDD)
-{
-	  //{{AFX_DATA_INIT(CFormatOptionTab)
-	  m_PaperSize = -1;
-	  m_BGColors = FALSE;
-	  m_Scaling = 0;
-	  m_ScalingText = _T("");
-	  m_PaperHeight = 0.0;
-	  m_PaperWidth = 0.0;
-	  m_DoInches = -1;
-	  m_BGImages = FALSE;
-	  m_IsLandScape = FALSE;
-	  //}}AFX_DATA_INIT
-}
-
-CFormatOptionTab::~CFormatOptionTab()
-{
-}
-
-void CFormatOptionTab::DoDataExchange(CDataExchange* pDX)
-{
-	  CPropertyPage::DoDataExchange(pDX);
-	  //{{AFX_DATA_MAP(CFormatOptionTab)
-	  DDX_CBIndex(pDX, IDC_PAPER_SIZE_CBX, m_PaperSize);
-	  DDX_Check(pDX, IDC_PRT_BGCOLORS, m_BGColors);
-	  DDX_Slider(pDX, IDC_SCALE, m_Scaling);
-	  DDX_Text(pDX, IDC_SCALE_TXT, m_ScalingText);
-	  DDX_Text(pDX, IDC_UD_PAPER_HGT, m_PaperHeight);
-	  DDX_Text(pDX, IDC_UD_PAPER_WDTH, m_PaperWidth);
-	  DDX_Radio(pDX, IDC_INCHES_RD, m_DoInches);
-	  DDX_Check(pDX, IDC_PRT_BGIMAGES, m_BGImages);
-	  DDX_Radio(pDX, IDC_PRT_PORTRAIT_RD, m_IsLandScape);
-	  //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CFormatOptionTab, CPropertyPage)
-	//{{AFX_MSG_MAP(CFormatOptionTab)
-	ON_NOTIFY(NM_CUSTOMDRAW, IDC_SCALE, OnCustomdrawScale)
-	ON_EN_KILLFOCUS(IDC_SCALE_TXT, OnKillfocusScaleTxt)
-	ON_CBN_SELCHANGE(IDC_PAPER_SIZE_CBX, OnSelchangePaperSizeCbx)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CFormatOptionTab message handlers
-
-BOOL CFormatOptionTab::OnInitDialog() 
-{
-	  CDialog::OnInitDialog();
-	  
-    CSliderCtrl* scale = (CSliderCtrl*)GetDlgItem(IDC_SCALE);
-    CWnd* scaleTxt     = GetDlgItem(IDC_SCALE_TXT);
-    if (scale != NULL) 
-    {
-        scale->SetRange(kMinScaleRange, 100);
-        scale->SetBuddy(scaleTxt, FALSE);
-        scale->SetTicFreq(10);
-    }
-
-	  CComboBox* cbx = (CComboBox*)GetDlgItem(IDC_PAPER_SIZE_CBX);
-    if (cbx != NULL) 
-    {
-        // First Initialize the Combobox
-        for (int i=0;i<gNumPaperSizes;i++) 
-        {
-            cbx->AddString(gPaperSize[i].mDesc);
-        }
-        short  unit;
-        double paperWidth  = 0.0;
-        double paperHeight = 0.0;
-        m_PrintSettings->GetPaperSizeType(&unit);
-        m_PrintSettings->GetPaperWidth(&paperWidth);
-        m_PrintSettings->GetPaperHeight(&paperHeight);
-
-        m_PaperSizeInx = GetPaperSizeIndexFromData(unit, paperWidth, paperHeight);
-        if (m_PaperSizeInx == -1) 
-        { // couldn't find a match
-            m_PaperSizeInx = 0;
-            unit        = gPaperSize[m_PaperSizeInx].mUnit;
-            paperWidth  = gPaperSize[m_PaperSizeInx].mWidth;
-            paperHeight = gPaperSize[m_PaperSizeInx].mHeight;
-        }
-
-        cbx->SetCurSel(m_PaperSizeInx);
-
-        EnableUserDefineControls(gPaperSize[m_PaperSizeInx].mIsUserDefined);
-
-        if (gPaperSize[m_PaperSizeInx].mIsUserDefined) 
-        {
-            CString wStr;
-            CString hStr;
-            if (unit == nsIPrintSettings::kPaperSizeInches) 
-            {
-                wStr.Format(_T("%6.2f"), paperWidth);
-                hStr.Format(_T("%6.2f"), paperHeight);
-                CheckRadioButton(IDC_INCHES_RD, IDC_MILLI_RD, IDC_INCHES_RD);
-            } 
-            else 
-            {
-                wStr.Format(_T("%d"), int(paperWidth));
-                hStr.Format(_T("%d"), int(paperHeight));
-                CheckRadioButton(IDC_INCHES_RD, IDC_MILLI_RD, IDC_MILLI_RD);
-            }
-	          CWnd* widthTxt  = GetDlgItem(IDC_UD_PAPER_WDTH);
-	          CWnd* heightTxt = GetDlgItem(IDC_UD_PAPER_HGT);
-            widthTxt->SetWindowText(wStr);
-            heightTxt->SetWindowText(hStr);
-        } 
-        else 
-        {
-            CheckRadioButton(IDC_INCHES_RD, IDC_MILLI_RD, IDC_INCHES_RD);
-        }
-    }
-
-	  return TRUE;  // return TRUE unless you set the focus to a control
-	                // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CFormatOptionTab::OnCustomdrawScale(NMHDR* pNMHDR, LRESULT* pResult) 
-{
-    CSliderCtrl* scale = (CSliderCtrl*)GetDlgItem(IDC_SCALE);
-    CWnd* scaleTxt     = GetDlgItem(IDC_SCALE_TXT);
-    if (scale != NULL && scaleTxt != NULL) 
-    {
-        CString str;
-        str.Format(_T("%d"), scale->GetPos());
-        scaleTxt->SetWindowText(str);
-    }
-	  
-	  *pResult = 0;
-}
-
-static int GetIntFromStr(const TCHAR * aStr, int aMinVal = kMinScaleRange, int aMaxVal = 100)
-{
-    int val = aMinVal;
-    _stscanf(aStr, _T("%d"), &val);
-    if (val < aMinVal) 
-    {
-        return aMinVal;
-    } 
-    else if (val > aMaxVal) 
-    {
-        return aMaxVal;
-    }
-    return val;
-}
-
-void CFormatOptionTab::OnKillfocusScaleTxt() 
-{
-    CSliderCtrl* scale = (CSliderCtrl*)GetDlgItem(IDC_SCALE);
-    CWnd* scaleTxt     = GetDlgItem(IDC_SCALE_TXT);
-    if (scale != NULL && scaleTxt != NULL) 
-    {
-        CString str;
-        scaleTxt->GetWindowText(str);
-        scale->SetPos(GetIntFromStr(str));
-    }	
-}
-
-
-void CFormatOptionTab::EnableUserDefineControls(BOOL aEnable) 
-{
-	  CWnd* cntrl = GetDlgItem(IDC_UD_WIDTH_LBL);
-    cntrl->EnableWindow(aEnable);
-	  cntrl = GetDlgItem(IDC_UD_HEIGHT_LBL);
-    cntrl->EnableWindow(aEnable);
-	  cntrl = GetDlgItem(IDC_UD_PAPER_WDTH);
-    cntrl->EnableWindow(aEnable);
-	  cntrl = GetDlgItem(IDC_UD_PAPER_HGT);
-    cntrl->EnableWindow(aEnable);
-	  cntrl = GetDlgItem(IDC_INCHES_RD);
-    cntrl->EnableWindow(aEnable);
-	  cntrl = GetDlgItem(IDC_MILLI_RD);
-    cntrl->EnableWindow(aEnable);
-}
-
-void CFormatOptionTab::OnSelchangePaperSizeCbx() 
-{
-	  CComboBox* cbx = (CComboBox*)GetDlgItem(IDC_PAPER_SIZE_CBX);
-    if (cbx) 
-    {
-        CString text;
-        cbx->GetWindowText(text);
-        m_PaperSizeInx = GetPaperSizeIndex(text);
-        EnableUserDefineControls(gPaperSize[m_PaperSizeInx].mIsUserDefined);
-    }
-}
-
-void CFormatOptionTab::GetPaperSizeInfo(short& aUnit, double& aWidth, double& aHeight)
-{
-    if (gPaperSize[m_PaperSizeInx].mIsUserDefined) 
-    {
-        aUnit   = m_DoInches == 0?nsIPrintSettings::kPaperSizeInches:nsIPrintSettings::kPaperSizeMillimeters;
-        aWidth  = m_PaperWidth;
-        aHeight = m_PaperHeight;
-    } 
-    else 
-    {
-        aUnit   = gPaperSize[m_PaperSizeInx].mUnit;
-        aWidth  = gPaperSize[m_PaperSizeInx].mWidth;
-        aHeight = gPaperSize[m_PaperSizeInx].mHeight;
-    }
-}
-
-// Search for Sizes in Pape Size Data
-int CFormatOptionTab::GetPaperSizeIndexFromData(short aUnit, double aW, double aH) 
-{
-    int i;
-    for (i=0;i<gNumPaperSizes;i++) 
-    {
-        if (gPaperSize[i].mUnit == aUnit && 
-            gPaperSize[i].mWidth == aW &&
-            gPaperSize[i].mHeight == aH) 
-        {
-            return i;
-        }
-    }
-
-    // find the first user defined
-    for (i=0;i<gNumPaperSizes;i++) 
-    {
-        if (gPaperSize[i].mIsUserDefined) 
-        {
-            return i;
-        }
-    }
-
-    return -1;
-}
-
-int CFormatOptionTab::GetPaperSizeIndex(const CString& aStr) 
-{
-    for (int i=0;i<gNumPaperSizes;i++) 
-    {
-        if (!aStr.Compare(gPaperSize[i].mDesc)) 
-        {
-            return i;
-        }
-    }
-    return -1;
-}
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/CFormatOptionTab.h
+++ /dev/null
@@ -1,100 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_)
-#define AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// CFormatOptionTab.h : header file
-//
-
-#include "nsIPrintSettings.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CFormatOptionTab dialog
-
-class CFormatOptionTab : public CPropertyPage
-{
-	DECLARE_DYNCREATE(CFormatOptionTab)
-
-// Construction
-public:
-	CFormatOptionTab();
-	~CFormatOptionTab();
-  void GetPaperSizeInfo(short& aType, double& aWidth, double& aHeight);
-
-// Dialog Data
-	//{{AFX_DATA(CFormatOptionTab)
-	enum { IDD = IDD_FORMAT_OPTIONS_TAB };
-	int		m_PaperSize;
-	BOOL	m_BGColors;
-	int		m_Scaling;
-	CString	m_ScalingText;
-	int		m_DoInches;
-	BOOL	m_BGImages;
-	double	m_PaperHeight;
-	double	m_PaperWidth;
-	BOOL	m_IsLandScape;
-	//}}AFX_DATA
-
-  nsCOMPtr<nsIPrintSettings> m_PrintSettings;
-  int                        m_PaperSizeInx;
-
-// Overrides
-	// ClassWizard generate virtual function overrides
-	//{{AFX_VIRTUAL(CFormatOptionTab)
-	protected:
-	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-	//}}AFX_VIRTUAL
-
-// Implementation
-protected:
-  void EnableUserDefineControls(BOOL aEnable);
-  int  GetPaperSizeIndexFromData(short aType, double aW, double aH);
-  int  GetPaperSizeIndex(const CString& aStr);
-
-	// Generated message map functions
-	//{{AFX_MSG(CFormatOptionTab)
-	virtual BOOL OnInitDialog();
-	afx_msg void OnCustomdrawScale(NMHDR* pNMHDR, LRESULT* pResult);
-	afx_msg void OnKillfocusScaleTxt();
-	afx_msg void OnSelchangePaperSizeCbx();
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CFORMATOPTIONTAB_H__F7BDB355_9202_440A_8478_165AD3FC2F41__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/CMarginHeaderFooter.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-// MarginHeaderFooter.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "mfcembed.h"
-#include "CMarginHeaderFooter.h"
-#include "CCustomPromptDialog.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-static TCHAR* sCBXTitles[] = {
-    _T("--Blank--"), _T("Title"), _T("URL"), _T("Date/Time"), _T("Page #"),
-    _T("Page # of #"), _T("Custom..."), NULL};
-static TCHAR* sCBXValues[] = {
-    _T(""), _T("&T"), _T("&U"), _T("&D"), _T("&P"), _T("&PT"), _T(""), NULL};
-
-/////////////////////////////////////////////////////////////////////////////
-// CMarginHeaderFooter property page
-
-IMPLEMENT_DYNCREATE(CMarginHeaderFooter, CPropertyPage)
-
-CMarginHeaderFooter::CMarginHeaderFooter() : CPropertyPage(CMarginHeaderFooter::IDD)
-{
-	  //{{AFX_DATA_INIT(CMarginHeaderFooter)
-	  m_BottomMarginText = _T("");
-	  m_LeftMarginText = _T("");
-	  m_RightMarginText = _T("");
-	  m_TopMarginText = _T("");
-	  //}}AFX_DATA_INIT
-
-	  m_FooterLeftText = _T("");
-	  m_FooterCenterText = _T("");
-	  m_FooterRightText = _T("");
-	  m_HeaderLeftText = _T("");
-	  m_HeaderCenterText = _T("");
-	  m_HeaderRightText = _T("");
-}
-
-CMarginHeaderFooter::~CMarginHeaderFooter()
-{
-}
-
-void CMarginHeaderFooter::DoDataExchange(CDataExchange* pDX)
-{
-	  CPropertyPage::DoDataExchange(pDX);
-	  //{{AFX_DATA_MAP(CMarginHeaderFooter)
-	  DDX_Text(pDX, IDC_BOTTOM_MARGIN_TXT, m_BottomMarginText);
-	  DDX_Text(pDX, IDC_LEFT_MARGIN_TXT, m_LeftMarginText);
-	  DDX_Text(pDX, IDC_RIGHT_MARGIN_TXT, m_RightMarginText);
-	  DDX_Text(pDX, IDC_TOP_MARGIN_TXT, m_TopMarginText);
-	  //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CMarginHeaderFooter, CPropertyPage)
-	//{{AFX_MSG_MAP(CMarginHeaderFooter)
-	ON_CBN_SELCHANGE(IDC_FTR_LEFT_CMBX, OnEditchangeFTRLeft)
-	ON_CBN_SELCHANGE(IDC_FTR_CENTER_CMBX, OnEditchangeFTRCenter)
-	ON_CBN_SELCHANGE(IDC_FTR_RIGHT_CMBX, OnEditchangeFTRRight)
-	ON_CBN_SELCHANGE(IDC_HDR_LEFT_CMBX, OnEditchangeHDRLeft)
-	ON_CBN_SELCHANGE(IDC_HDR_CENTER_CMBX, OnEditchangeHDRCenter)
-	ON_CBN_SELCHANGE(IDC_HDR_RIGHT_CMBX, OnEditchangeHDRRight)
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CMarginHeaderFooter message handlers
-
-void CMarginHeaderFooter::SetComboboxValue(int aId, const TCHAR *aItem)
-{
-    CComboBox* cbx = (CComboBox*)GetDlgItem(aId);
-    if (cbx) 
-    {
-        int inx = 0;
-        while (sCBXValues[inx] != NULL) 
-        {
-            if (!_tcscmp(sCBXValues[inx], aItem)) 
-            {
-                cbx->SetCurSel(inx);
-                return;
-            }
-            inx++;
-        }
-        cbx->SetCurSel(inx-1);
-    }
-}
-
-void CMarginHeaderFooter::AddCBXItem(int aId, const TCHAR * aItem)
-{
-    CComboBox* cbx = (CComboBox*)GetDlgItem(aId);
-    if (cbx) 
-    {
-        cbx->AddString(aItem);
-    }
-}
-
-BOOL CMarginHeaderFooter::OnInitDialog() 
-{
-	CDialog::OnInitDialog();
-
-    int inx = 0;
-    while (sCBXTitles[inx] != NULL) 
-    {
-        AddCBXItem(IDC_HDR_LEFT_CMBX,   sCBXTitles[inx]);
-        AddCBXItem(IDC_HDR_CENTER_CMBX, sCBXTitles[inx]);
-        AddCBXItem(IDC_HDR_RIGHT_CMBX,  sCBXTitles[inx]);
-        AddCBXItem(IDC_FTR_LEFT_CMBX,   sCBXTitles[inx]);
-        AddCBXItem(IDC_FTR_CENTER_CMBX, sCBXTitles[inx]);
-        AddCBXItem(IDC_FTR_RIGHT_CMBX,  sCBXTitles[inx]);
-        inx++;
-    }
-	  SetComboboxValue(IDC_HDR_LEFT_CMBX, m_HeaderLeftText);
-	  SetComboboxValue(IDC_HDR_CENTER_CMBX, m_HeaderCenterText);
-	  SetComboboxValue(IDC_HDR_RIGHT_CMBX, m_HeaderRightText);
-	  SetComboboxValue(IDC_FTR_LEFT_CMBX, m_FooterLeftText);
-	  SetComboboxValue(IDC_FTR_CENTER_CMBX, m_FooterCenterText);
-	  SetComboboxValue(IDC_FTR_RIGHT_CMBX, m_FooterRightText);
-
-	  return TRUE;  // return TRUE unless you set the focus to a control
-	                // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CMarginHeaderFooter::SetCombobox(int aId, CString& aText) 
-{
-    CComboBox* cbx = (CComboBox*)GetDlgItem(aId);
-	  int inx = cbx->GetCurSel();
-    if (inx == 6) 
-    {
-        CCustomPromptDialog prompt(this);
-        prompt.m_CustomText = aText;
-        if(prompt.DoModal() == IDOK)
-        {
-            aText = prompt.m_CustomText;
-        }
-    } else {
-      aText = sCBXValues[inx];
-    }
-}
-
-void CMarginHeaderFooter::OnEditchangeFTRLeft() 
-{
-    SetCombobox(IDC_FTR_LEFT_CMBX, m_FooterLeftText);
-}
-
-void CMarginHeaderFooter::OnEditchangeFTRCenter() 
-{
-    SetCombobox(IDC_FTR_CENTER_CMBX, m_FooterCenterText);
-}
-
-void CMarginHeaderFooter::OnEditchangeFTRRight() 
-{
-    SetCombobox(IDC_FTR_CENTER_CMBX, m_FooterCenterText);
-}
-
-void CMarginHeaderFooter::OnEditchangeHDRLeft() 
-{
-    SetCombobox(IDC_HDR_LEFT_CMBX, m_HeaderLeftText);
-}
-
-void CMarginHeaderFooter::OnEditchangeHDRCenter() 
-{
-    SetCombobox(IDC_HDR_CENTER_CMBX, m_HeaderCenterText);
-}
-
-void CMarginHeaderFooter::OnEditchangeHDRRight() 
-{
-    SetCombobox(IDC_HDR_CENTER_CMBX, m_HeaderCenterText);
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/CMarginHeaderFooter.h
+++ /dev/null
@@ -1,99 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(AFX_CMARGINHEADERFOOTER_H__A95A9A17_692E_425B_8B70_419C24DDE6BC__INCLUDED_)
-#define AFX_CMARGINHEADERFOOTER_H__A95A9A17_692E_425B_8B70_419C24DDE6BC__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// CMarginHeaderFooter.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CMarginHeaderFooter dialog
-
-class CMarginHeaderFooter : public CPropertyPage
-{
-	DECLARE_DYNCREATE(CMarginHeaderFooter)
-
-// Construction
-public:
-	CMarginHeaderFooter();
-	~CMarginHeaderFooter();
-
-// Dialog Data
-	//{{AFX_DATA(CMarginHeaderFooter)
-	enum { IDD = IDD_HEADERFOOTER_TAB };
-	CString	m_BottomMarginText;
-	CString	m_LeftMarginText;
-	CString	m_RightMarginText;
-	CString	m_TopMarginText;
-	//}}AFX_DATA
-
-	CString	m_FooterLeftText;
-	CString	m_FooterCenterText;
-	CString	m_FooterRightText;
-	CString	m_HeaderLeftText;
-	CString	m_HeaderCenterText;
-	CString	m_HeaderRightText;
-
-// Overrides
-	// ClassWizard generate virtual function overrides
-	//{{AFX_VIRTUAL(CMarginHeaderFooter)
-	protected:
-	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-	//}}AFX_VIRTUAL
-
-// Implementation
-protected:
-  void SetCombobox(int aId, CString& aText);
-  void SetComboboxValue(int aId, const TCHAR * aValue);
-  void AddCBXItem(int aId, const TCHAR * aItem);
-
-	// Generated message map functions
-	//{{AFX_MSG(CMarginHeaderFooter)
-	virtual BOOL OnInitDialog();
-	afx_msg void OnEditchangeFTRLeft();
-	afx_msg void OnEditchangeFTRCenter();
-	afx_msg void OnEditchangeFTRRight();
-	afx_msg void OnEditchangeHDRLeft();
-	afx_msg void OnEditchangeHDRCenter();
-	afx_msg void OnEditchangeHDRRight();
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
-
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_MARGINHEADERFOOTER_H__A95A9A17_692E_425B_8B70_419C24DDE6BC__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/CPageSetupPropSheet.cpp
+++ /dev/null
@@ -1,229 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// CPageSetupPropSheet.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "resource.h"
-#include "CPageSetupPropSheet.h"
-#include "nsMemory.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CPageSetupPropSheet
-
-IMPLEMENT_DYNAMIC(CPageSetupPropSheet, CPropertySheet)
-
-CPageSetupPropSheet::CPageSetupPropSheet(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
-	:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
-{
-	  AddControlPages();
-}
-
-CPageSetupPropSheet::CPageSetupPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
-	:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
-{
-	  AddControlPages();
-}
-
-CPageSetupPropSheet::~CPageSetupPropSheet()
-{
-}
-
-
-BEGIN_MESSAGE_MAP(CPageSetupPropSheet, CPropertySheet)
-	//{{AFX_MSG_MAP(CPageSetupPropSheet)
-		// NOTE - the ClassWizard will add and remove mapping macros here.
-	//}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CPageSetupPropSheet message handlers
-
-/////////////////////////////////////////////////////////////////////////////
-void CPageSetupPropSheet::AddControlPages()
-{
-	  m_psh.dwFlags &= ~PSH_HASHELP;  // Lose the Help button
-	  AddPage(&m_FormatOptionTab);
-	  AddPage(&m_MarginHeaderFooterTab);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-static float GetFloatFromStr(const TCHAR * aStr, float aMaxVal = 1.0)
-{
-    float val;
-    _stscanf(aStr, _T("%f"), &val);
-    if (val <= aMaxVal) 
-    {
-        return val;
-    } 
-    else 
-    {
-        return 0.5;
-    }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-static PRUnichar* GetUnicodeFromCString(const CString& aStr)
-{
-#ifdef _UNICODE
-    nsEmbedString str(aStr);
-#else
-    nsEmbedString str;
-    NS_CStringToUTF16(nsEmbedCString(aStr), NS_CSTRING_ENCODING_ASCII, str);
-#endif
-    return NS_StringCloneData(str);
-}
-
-/////////////////////////////////////////////////////////////////////////////
-void CPageSetupPropSheet::SetPrintSettingsValues(nsIPrintSettings* aPrintSettings) 
-{ 
-  m_FormatOptionTab.m_PrintSettings = aPrintSettings;
-
-  if (aPrintSettings != NULL) 
-  {
-    double top, left, right, bottom;
-    aPrintSettings->GetMarginTop(&top);
-    aPrintSettings->GetMarginLeft(&left);
-    aPrintSettings->GetMarginRight(&right);
-    aPrintSettings->GetMarginBottom(&bottom);
-
-    char buf[16];
-    sprintf(buf, "%5.2f", top);
-    m_MarginHeaderFooterTab.m_TopMarginText = buf;
-    sprintf(buf, "%5.2f", left);
-    m_MarginHeaderFooterTab.m_LeftMarginText = buf;
-    sprintf(buf, "%5.2f", right);
-    m_MarginHeaderFooterTab.m_RightMarginText = buf;
-    sprintf(buf, "%5.2f", bottom);
-    m_MarginHeaderFooterTab.m_BottomMarginText = buf;
-
-    PRInt32 orientation;
-    aPrintSettings->GetOrientation(&orientation);
-    m_FormatOptionTab.m_IsLandScape = orientation != nsIPrintSettings::kPortraitOrientation;
-
-    double scaling;
-    aPrintSettings->GetScaling(&scaling);
-	  m_FormatOptionTab.m_Scaling = int(scaling * 100.0);
-
-    PRBool boolVal;
-    aPrintSettings->GetPrintBGColors(&boolVal);
-    m_FormatOptionTab.m_BGColors = boolVal == PR_TRUE;
-    aPrintSettings->GetPrintBGImages(&boolVal);
-    m_FormatOptionTab.m_BGImages = boolVal == PR_TRUE;
-
-    PRUnichar* uStr;
-    aPrintSettings->GetHeaderStrLeft(&uStr);
-		m_MarginHeaderFooterTab.m_HeaderLeftText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    aPrintSettings->GetHeaderStrCenter(&uStr);
-		m_MarginHeaderFooterTab.m_HeaderCenterText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    aPrintSettings->GetHeaderStrRight(&uStr);
-		m_MarginHeaderFooterTab.m_HeaderRightText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    aPrintSettings->GetFooterStrLeft(&uStr);
-		m_MarginHeaderFooterTab.m_FooterLeftText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    aPrintSettings->GetFooterStrCenter(&uStr);
-		m_MarginHeaderFooterTab.m_FooterCenterText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    aPrintSettings->GetFooterStrRight(&uStr);
-		m_MarginHeaderFooterTab.m_FooterRightText = uStr;
-    if (uStr != nsnull) nsMemory::Free(uStr);
-  }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-void CPageSetupPropSheet::GetPrintSettingsValues(nsIPrintSettings* aPrintSettings) 
-{ 
-
-    if (!aPrintSettings) return;
-
-    aPrintSettings->SetScaling(double(m_FormatOptionTab.m_Scaling) / 100.0);
-    aPrintSettings->SetPrintBGColors(m_FormatOptionTab.m_BGColors);
-    aPrintSettings->SetPrintBGImages(m_FormatOptionTab.m_BGImages);
-
-    PRInt32 orientation  = m_FormatOptionTab.m_IsLandScape?
-                           nsIPrintSettings::kLandscapeOrientation:nsIPrintSettings::kPortraitOrientation;
-    aPrintSettings->SetOrientation(orientation);
-
-    short  type;
-    double width;
-    double height;
-    m_FormatOptionTab.GetPaperSizeInfo(type, width, height);
-    aPrintSettings->SetPaperSizeType(nsIPrintSettings::kPaperSizeDefined);
-    aPrintSettings->SetPaperSizeUnit(type);
-    aPrintSettings->SetPaperWidth(width);
-    aPrintSettings->SetPaperHeight(height);
-
-    aPrintSettings->SetMarginTop(GetFloatFromStr(m_MarginHeaderFooterTab.m_TopMarginText));
-    aPrintSettings->SetMarginLeft(GetFloatFromStr(m_MarginHeaderFooterTab.m_LeftMarginText));
-    aPrintSettings->SetMarginRight(GetFloatFromStr(m_MarginHeaderFooterTab.m_RightMarginText));
-    aPrintSettings->SetMarginBottom(GetFloatFromStr(m_MarginHeaderFooterTab.m_BottomMarginText));
-
-    PRUnichar* uStr;
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderLeftText);
-    aPrintSettings->SetHeaderStrLeft(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderCenterText);
-    aPrintSettings->SetHeaderStrCenter(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_HeaderRightText);
-    aPrintSettings->SetHeaderStrRight(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterLeftText);
-    aPrintSettings->SetFooterStrLeft(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterCenterText);
-    aPrintSettings->SetFooterStrCenter(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-
-    uStr = GetUnicodeFromCString(m_MarginHeaderFooterTab.m_FooterRightText);
-    aPrintSettings->SetFooterStrRight(uStr);
-    if (uStr != nsnull) nsMemory::Free(uStr);
-}
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/CPageSetupPropSheet.h
+++ /dev/null
@@ -1,91 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#if !defined(AFX_CPAGESETUPPROPSHEET_H__E8A6D703_7EAD_4729_8FBA_9E0515AB9822__INCLUDED_)
-#define AFX_CPAGESETUPPROPSHEET_H__E8A6D703_7EAD_4729_8FBA_9E0515AB9822__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// CPageSetupPropSheet.h : header file
-//
-#include "CFormatOptionTab.h"
-#include "CMarginHeaderFooter.h"
-
-/////////////////////////////////////////////////////////////////////////////
-// CPageSetupPropSheet
-
-class CPageSetupPropSheet : public CPropertySheet
-{
-	DECLARE_DYNAMIC(CPageSetupPropSheet)
-
-// Construction
-public:
-	CPageSetupPropSheet(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
-	CPageSetupPropSheet(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
-
-  void SetPrintSettingsValues(nsIPrintSettings* aPrintSettings);
-  void GetPrintSettingsValues(nsIPrintSettings* aPrintSettings);
-
-protected:
-	void AddControlPages(void);
-
-// Attributes
-public:
-	CFormatOptionTab     m_FormatOptionTab;
-	CMarginHeaderFooter  m_MarginHeaderFooterTab;
-
-// Operations
-public:
-
-// Overrides
-	// ClassWizard generated virtual function overrides
-	//{{AFX_VIRTUAL(CPageSetupPropSheet)
-	//}}AFX_VIRTUAL
-
-// Implementation
-public:
-	virtual ~CPageSetupPropSheet();
-
-	// Generated message map functions
-protected:
-	//{{AFX_MSG(CPageSetupPropSheet)
-		// NOTE - the ClassWizard will add and remove member functions here.
-	//}}AFX_MSG
-	DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CPAGESETUPPROPSHEET_H__E8A6D703_7EAD_4729_8FBA_9E0515AB9822__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/Dialogs.cpp
+++ /dev/null
@@ -1,153 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "stdafx.h"
-#include "Dialogs.h"
-#include "BrowserView.h"
-
-// File overview....
-//
-// contains Find dialog box code
-//
-
-//--------------------------------------------------------------------------//
-//                CFindDialog Stuff
-//--------------------------------------------------------------------------//
-
-CFindDialog::CFindDialog(CString& csSearchStr, PRBool bMatchCase,
-                PRBool bMatchWholeWord, PRBool bWrapAround,
-                PRBool bSearchBackwards, CBrowserView* pOwner)
-                : CFindReplaceDialog()
-{
-    // Save these initial settings off in member vars
-    // We'll use these to initialize the controls
-    // in InitDialog()
-    m_csSearchStr = csSearchStr;
-    m_bMatchCase = bMatchCase;
-    m_bMatchWholeWord = bMatchWholeWord;
-    m_bWrapAround = bWrapAround;
-    m_bSearchBackwards = bSearchBackwards;
-    m_pOwner = pOwner;
-
-    // Set up to load our customized Find dialog template
-    // rather than the default one MFC provides
-    m_fr.Flags |= FR_ENABLETEMPLATE;
-    m_fr.hInstance = AfxGetInstanceHandle();
-    m_fr.lpTemplateName = MAKEINTRESOURCE(IDD_FINDDLG);
-}
-
-BOOL CFindDialog::OnInitDialog() 
-{
-    CFindReplaceDialog::OnInitDialog();
-
-    CEdit* pEdit = (CEdit *)GetDlgItem(IDC_FIND_EDIT);
-    if(pEdit)
-        pEdit->SetWindowText(m_csSearchStr);
-
-    CButton* pChk = (CButton *)GetDlgItem(IDC_MATCH_CASE);
-    if(pChk)
-        pChk->SetCheck(m_bMatchCase);
-
-    pChk = (CButton *)GetDlgItem(IDC_MATCH_WHOLE_WORD);
-    if(pChk)
-        pChk->SetCheck(m_bMatchWholeWord);
-
-    pChk = (CButton *)GetDlgItem(IDC_WRAP_AROUND);    
-    if(pChk)
-        pChk->SetCheck(m_bWrapAround);
-
-    pChk = (CButton *)GetDlgItem(IDC_SEARCH_BACKWARDS);
-    if(pChk)
-        pChk->SetCheck(m_bSearchBackwards);
-
-    return TRUE; 
-}
-
-void CFindDialog::PostNcDestroy()    
-{
-    // Let the owner know we're gone
-    if(m_pOwner != NULL)    
-        m_pOwner->ClearFindDialog();
-
-    CFindReplaceDialog::PostNcDestroy();
-}
-
-BOOL CFindDialog::WrapAround()
-{
-    CButton* pChk = (CButton *)GetDlgItem(IDC_WRAP_AROUND);
-
-    return pChk ? pChk->GetCheck() : FALSE;
-}
-
-BOOL CFindDialog::SearchBackwards()
-{
-    CButton* pChk = (CButton *)GetDlgItem(IDC_SEARCH_BACKWARDS);
-
-    return pChk ? pChk->GetCheck() : FALSE;
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CLinkPropertiesDlg dialog
-CLinkPropertiesDlg::CLinkPropertiesDlg(CWnd* pParent /*=NULL*/)
-	: CDialog(CLinkPropertiesDlg::IDD, pParent)
-{
-	m_LinkText = _T("");
-	m_LinkLocation = _T("");
-}
-
-void CLinkPropertiesDlg::DoDataExchange(CDataExchange* pDX)
-{
-	CDialog::DoDataExchange(pDX);
-	DDX_Text(pDX, IDC_EDIT_LINK_TEXT, m_LinkText);
-	DDX_Text(pDX, IDC_EDIT_LINK_LOCATION, m_LinkLocation);
-}
-
-
-BEGIN_MESSAGE_MAP(CLinkPropertiesDlg, CDialog)
-END_MESSAGE_MAP()
-
-void CLinkPropertiesDlg::OnOK() 
-{
-	UpdateData(TRUE);
-
-	if (m_LinkLocation.IsEmpty() || (m_LinkText.IsEmpty() && m_LinkLocation.IsEmpty()))
-	{
-		MessageBox(_T("Please enter a Link Location"));
-		return;
-	}
-
-	if (m_LinkText.IsEmpty())
-	{
-		m_LinkText = m_LinkLocation;
-	}
-
-	EndDialog(IDOK);
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/Dialogs.h
+++ /dev/null
@@ -1,80 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _DIALOGS_H_
-#define _DIALOGS_H_
-
-#include "resource.h"
-
-class CBrowserView;
-
-class CFindDialog : public CFindReplaceDialog    
-{
-public:
-    CFindDialog(CString& csSearchStr, PRBool bMatchCase,
-                PRBool bMatchWholeWord, PRBool bWrapAround,
-                PRBool bSearchBackwards, CBrowserView* pOwner);
-    BOOL WrapAround();
-    BOOL SearchBackwards();
-
-private:
-    CString m_csSearchStr;
-    PRBool m_bMatchCase;
-    PRBool m_bMatchWholeWord;
-    PRBool m_bWrapAround;
-    PRBool m_bSearchBackwards;
-    CBrowserView* m_pOwner;
-
-protected:
-    virtual BOOL OnInitDialog();
-    virtual void PostNcDestroy();
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CLinkPropertiesDlg dialog
-
-class CLinkPropertiesDlg : public CDialog
-{
-public:
-	CLinkPropertiesDlg(CWnd* pParent = NULL);
-
-	enum { IDD = IDD_DIALOG_LINK_PROPERTIES };
-	CString	m_LinkText;
-	CString	m_LinkLocation;
-
-protected:
-	virtual void DoDataExchange(CDataExchange* pDX);
-	virtual void OnOK();
-
-	DECLARE_MESSAGE_MAP()
-};
-
-#endif //_DIALOG_H_
deleted file mode 100644
--- a/embedding/tests/mfcembed/EditorFrm.cpp
+++ /dev/null
@@ -1,674 +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):
- *   Mike Judge <mjudge@netscape.com>
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "stdafx.h"
-#include "MfcEmbed.h"
-#include "BrowserFrm.h"
-#include "EditorFrm.h"
-#include "Dialogs.h"
-#include "nsComponentManagerUtils.h"
-#include "nsMemory.h"
-#include "nsIEditor.h"
-#include "nsIHTMLEditor.h"
-
-//------------------------------------------------------------
-//              Editor Command/Parameter Names
-//------------------------------------------------------------
-#define BOLD_COMMAND            "cmd_bold"
-#define ITALIC_COMMAND          "cmd_italic"
-#define UNDERLINE_COMMAND       "cmd_underline"
-#define INDENT_COMMAND          "cmd_indent"
-#define OUTDENT_COMMAND         "cmd_outdent"
-#define FONTCOLOR_COMMAND       "cmd_fontColor"
-#define BACKGROUNDCOLOR_COMMAND "cmd_backgroundColor"
-#define COMMAND_NAME            "cmd_name"
-#define INCREASEFONT_COMMAND    "cmd_increaseFont"
-#define DECREASEFONT_COMMAND    "cmd_decreaseFont"
-#define FONTFACE_COMMAND        "cmd_fontFace"
-#define ALIGN_COMMAND           "cmd_align"
-#define UNDO_COMMAND            "cmd_undo"
-#define REDO_COMMAND            "cmd_redo"
-
-
-//states
-#define STATE_ALL           "state_all"
-#define STATE_MIXED         "state_mixed"
-#define STATE_ATTRIBUTE     "state_attribute"
-#define STATE_ENABLED       "state_enabled"
-
-//colors
-#define COLOR_RED       "#FF0000"
-#define COLOR_BLACK     "#000000"
-
-//fonts
-#define FONT_ARIAL            "Helvetica, Arial, sans-serif"
-#define FONT_TIMES            "Times New Roman, Times, serif"
-#define FONT_COURIER        "Courier New, Courier, monospace"
-
-//align
-#define ALIGN_LEFT      "left"
-#define ALIGN_RIGHT     "right"
-#define ALIGN_CENTER    "center"
-
-
-//value
-#define STATE_EMPTY        ""
-
-IMPLEMENT_DYNAMIC(CEditorFrame, CBrowserFrame)
-
-BEGIN_MESSAGE_MAP(CEditorFrame, CBrowserFrame)
-    //{{AFX_MSG_MAP(CEditorFrame)
-    ON_COMMAND(ID_BOLD, OnBold)
-    ON_UPDATE_COMMAND_UI(ID_BOLD, OnUpdateBold)
-    ON_COMMAND(ID_ITALICS, OnItalics)
-    ON_UPDATE_COMMAND_UI(ID_ITALICS, OnUpdateItalics)
-    ON_COMMAND(ID_UNDERLINE, OnUnderline)
-    ON_UPDATE_COMMAND_UI(ID_UNDERLINE, OnUpdateUnderline)
-    ON_COMMAND(ID_INDENT, OnIndent)
-    ON_UPDATE_COMMAND_UI(ID_INDENT, OnUpdateIndent)
-    ON_COMMAND(ID_OUTDENT, OnOutdent)
-    ON_UPDATE_COMMAND_UI(ID_OUTDENT, OnUpdateOutdent)
-    ON_COMMAND(ID_FONTRED, OnFontred)
-    ON_UPDATE_COMMAND_UI(ID_FONTRED, OnUpdateFontred)
-    ON_COMMAND(ID_FONTBLACK, OnFontblack)
-    ON_UPDATE_COMMAND_UI(ID_FONTBLACK, OnUpdateFontblack)
-    ON_COMMAND(ID_BGCOLOR, OnBgcolor)
-    ON_UPDATE_COMMAND_UI(ID_BGCOLOR, OnUpdateBgcolor)
-    ON_COMMAND(ID_NOBGCOLOR, OnNobgcolor)
-    ON_UPDATE_COMMAND_UI(ID_NOBGCOLOR, OnUpdateNobgcolor)
-    ON_COMMAND(ID_FONTSIZEINCREASE, OnFontsizeincrease)
-    ON_COMMAND(ID_FONTSIZEDECREASE, OnFontsizedecrease)
-    ON_COMMAND(ID_ARIAL, OnArial)
-    ON_COMMAND(ID_TIMES, OnTimes)
-    ON_COMMAND(ID_COURIER, OnCourier)
-    ON_COMMAND(ID_ALIGNLEFT, OnAlignleft)
-    ON_UPDATE_COMMAND_UI(ID_ALIGNLEFT, OnUpdateAlignleft)
-    ON_COMMAND(ID_ALIGNRIGHT, OnAlignright)
-    ON_UPDATE_COMMAND_UI(ID_ALIGNRIGHT, OnUpdateAlignright)
-    ON_COMMAND(ID_ALIGNCENTER, OnAligncenter)
-    ON_UPDATE_COMMAND_UI(ID_ALIGNCENTER, OnUpdateAligncenter)
-    ON_COMMAND(ID_INSERTLINK, OnInsertlink)
-    ON_COMMAND(ID_EDITOR_UNDO, OnEditUndo)
-    ON_COMMAND(ID_EDITOR_REDO, OnEditRedo)
-    ON_UPDATE_COMMAND_UI(ID_EDITOR_REDO, OnUpdateEditRedo)
-    ON_UPDATE_COMMAND_UI(ID_EDITOR_UNDO, OnUpdateEditUndo)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-CEditorFrame::CEditorFrame(PRUint32 chromeMask)
-{
-    m_chromeMask = chromeMask;
-
-    mCommandManager = nsnull;
-}
-
-CEditorFrame::~CEditorFrame()
-{
-}
-
-BOOL CEditorFrame::InitEditor()
-{
-    // Get and save off nsICommandManager for later use
-    //
-    nsresult rv;
-    mCommandManager = do_GetInterface(m_wndBrowserView.mWebBrowser, &rv);
-
-    rv = MakeEditable();
- 
-    return (NS_SUCCEEDED(rv));
-}
-
-void CEditorFrame::OnBold() 
-{
-    ExecuteStyleCommand(BOLD_COMMAND);
-}
-
-void CEditorFrame::OnUpdateBold(CCmdUI* pCmdUI) 
-{
-    UpdateStyleToolBarBtn(BOLD_COMMAND, pCmdUI);
-}
-
-void CEditorFrame::OnItalics() 
-{
-    ExecuteStyleCommand(ITALIC_COMMAND);
-}
-
-void CEditorFrame::OnUpdateItalics(CCmdUI* pCmdUI) 
-{
-    UpdateStyleToolBarBtn(ITALIC_COMMAND, pCmdUI);
-}
-
-void CEditorFrame::OnUnderline() 
-{
-    ExecuteStyleCommand(UNDERLINE_COMMAND);
-}
-
-void CEditorFrame::OnUpdateUnderline(CCmdUI* pCmdUI) 
-{
-    UpdateStyleToolBarBtn(UNDERLINE_COMMAND, pCmdUI);
-}
-
-
-//Called to make a nsICommandParams with the 1 value pair of command name
-NS_METHOD
-CEditorFrame::MakeCommandParams(const char *aCommand,nsICommandParams **aParams)
-{
-    nsresult rv;
-    nsCOMPtr<nsICommandParams> params = do_CreateInstance(NS_COMMAND_PARAMS_CONTRACTID,&rv);
-    if (NS_FAILED(rv))
-        return rv;
-    if (!params)
-        return NS_ERROR_FAILURE;
-    *aParams = params;
-    NS_ADDREF(*aParams);
-    return rv;
-}
-
-
-// Called in response to the ON_COMMAND messages generated
-// when style related toolbar buttons(bold, italic etc)
-// are clicked
-//
-NS_METHOD
-CEditorFrame::ExecuteStyleCommand(const char *aCommand)
-{
-  return DoCommand(aCommand,0);
-}
-
-// Called in response to the UPDATE_COMMAND_UI messages for 
-// style related toolbar buttons(bold, italic etc.)
-// to update their current state
-//
-void CEditorFrame::UpdateStyleToolBarBtn(const char *aCommand, CCmdUI* pCmdUI)
-{
-    nsCOMPtr<nsICommandParams> params;
-    nsresult rv;
-    rv = MakeCommandParams(aCommand,getter_AddRefs(params));
-    if (NS_FAILED(rv) || !params)
-        return;
-    rv = GetCommandState(aCommand,params);
-    if (NS_SUCCEEDED(rv))
-    {
-        // Does our current selection span mixed styles?
-        // If so, set the toolbar button to an indeterminate
-        // state
-        //
-        PRBool bMixedStyle = PR_FALSE;
-        rv = params->GetBooleanValue(STATE_MIXED, &bMixedStyle);
-        if (NS_SUCCEEDED(rv))
-        {
-            if(bMixedStyle)
-            {
-                pCmdUI->SetCheck(2);
-                return;
-            }
-        }
-
-        // We're not in STATE_MIXED. Enable/Disable the
-        // toolbar button based on it's current state
-        //
-        PRBool bCmdEnabled = PR_FALSE;
-        rv = params->GetBooleanValue(STATE_ALL, &bCmdEnabled);
-        if (NS_SUCCEEDED(rv))
-        {
-            bCmdEnabled ? pCmdUI->SetCheck(1) : pCmdUI->SetCheck(0);
-        }
-    }
-}
-
-NS_METHOD
-CEditorFrame::MakeEditable()
-{
-    nsresult rv;
-
-    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(mDOMWindow));
-    if (!mDOMWindow)
-        return NS_ERROR_FAILURE;
-
-    mEditingSession = do_GetInterface(m_wndBrowserView.mWebBrowser);
-    if (!mEditingSession)
-        return NS_ERROR_FAILURE;
-  
-    rv= mEditingSession->MakeWindowEditable(mDOMWindow, NULL, PR_TRUE);
-  
-    return rv;  
-}
-
-NS_METHOD
-CEditorFrame::DoCommand(const char *aCommand, nsICommandParams *aCommandParams)
-{
-    nsCOMPtr<nsIDOMWindow> domWindow;
-    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
-    return mCommandManager ? mCommandManager->DoCommand(aCommand, aCommandParams, domWindow) : NS_ERROR_FAILURE;
-}
-
-NS_METHOD
-CEditorFrame::IsCommandEnabled(const char *aCommand, PRBool *retval)
-{
-    nsCOMPtr<nsIDOMWindow> domWindow;
-    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
-    return mCommandManager ? mCommandManager->IsCommandEnabled(aCommand, domWindow, retval) : NS_ERROR_FAILURE;
-}
-
-
-NS_METHOD
-CEditorFrame::GetCommandState(const char *aCommand, nsICommandParams *aCommandParams)
-{
-    nsCOMPtr<nsIDOMWindow> domWindow;
-    m_wndBrowserView.mWebBrowser->GetContentDOMWindow(getter_AddRefs(domWindow));
-    return mCommandManager ? mCommandManager->GetCommandState(aCommand, domWindow, aCommandParams) : NS_ERROR_FAILURE;
-}
-
-NS_METHOD
-CEditorFrame::ExecuteNoParam(const char *aCommand)
-{
-    return DoCommand(aCommand,0);
-}
-
-void CEditorFrame::OnIndent() 
-{
-    ExecuteNoParam(INDENT_COMMAND);    
-}
-
-void CEditorFrame::OnUpdateIndent(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here
-}
-
-void CEditorFrame::OnOutdent() 
-{
-    ExecuteNoParam(OUTDENT_COMMAND);    
-}
-
-void CEditorFrame::OnUpdateOutdent(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here
-}
-
-NS_METHOD
-CEditorFrame::ExecuteAttribParam(const char *aCommand, const char *aAttribute)
-{
-  nsresult rv;
-  nsCOMPtr<nsICommandParams> params;
-  rv = MakeCommandParams(aCommand,getter_AddRefs(params));
-  if (NS_FAILED(rv))
-   return rv;
-  if (!params)
-    return NS_ERROR_FAILURE;
-  params->SetCStringValue(STATE_ATTRIBUTE, aAttribute);
-  return DoCommand(aCommand,params);
-}
-
-NS_METHOD
-CEditorFrame::GetAttributeParamValue(const char *aCommand, nsEmbedCString &aValue)
-{
-  nsresult rv;
-  nsCOMPtr<nsICommandParams> params;
-  rv = MakeCommandParams(aCommand,getter_AddRefs(params));
-  if (NS_FAILED(rv))
-    return rv;
-  if (!params)
-    return NS_ERROR_FAILURE;
-  rv = GetCommandState(aCommand, params);
-  if (NS_SUCCEEDED(rv))
-  {
-    char *tchar;
-    rv = params->GetCStringValue(STATE_ATTRIBUTE,&tchar);
-    aValue.Assign(tchar);
-    nsMemory::Free(tchar);
-    return rv;
-  }
-  return rv;
-}
-
-
-void CEditorFrame::OnFontred() 
-{
-    ExecuteAttribParam(FONTCOLOR_COMMAND,COLOR_RED);    
-}
-
-void CEditorFrame::OnUpdateFontred(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here
-}
-
-void CEditorFrame::OnFontblack() 
-{
-    ExecuteAttribParam(FONTCOLOR_COMMAND,COLOR_BLACK);        
-}
-
-void CEditorFrame::OnUpdateFontblack(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here   
-}
-
-void CEditorFrame::OnBgcolor() 
-{
-    ExecuteAttribParam(BACKGROUNDCOLOR_COMMAND,COLOR_RED);
-}
-
-void CEditorFrame::OnUpdateBgcolor(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here
-}
-
-void CEditorFrame::OnNobgcolor() 
-{
-    ExecuteAttribParam(BACKGROUNDCOLOR_COMMAND,STATE_EMPTY);
-}
-
-void CEditorFrame::OnUpdateNobgcolor(CCmdUI* pCmdUI) 
-{
-    // TODO: Add your command update UI handler code here
-}
-
-void CEditorFrame::OnFontsizeincrease() 
-{
-    ExecuteNoParam(INCREASEFONT_COMMAND);
-}
-
-void CEditorFrame::OnFontsizedecrease() 
-{
-    ExecuteNoParam(DECREASEFONT_COMMAND);    
-}
-
-void CEditorFrame::OnArial() 
-{
-    ExecuteAttribParam(FONTFACE_COMMAND,FONT_ARIAL);
-}
-
-void CEditorFrame::OnTimes() 
-{
-    ExecuteAttribParam(FONTFACE_COMMAND,FONT_TIMES);    
-}
-
-void CEditorFrame::OnCourier() 
-{
-    ExecuteAttribParam(FONTFACE_COMMAND,FONT_COURIER);
-}
-
-void CEditorFrame::OnAlignleft() 
-{
-    ExecuteAttribParam(ALIGN_COMMAND,ALIGN_LEFT);    
-}
-
-
-void CEditorFrame::OnUpdateAlignleft(CCmdUI* pCmdUI) 
-{
-  nsEmbedCString tValue;
-
-  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
-  if (NS_SUCCEEDED(rv))
-  {
-    if (strcmp(tValue.get(), ALIGN_LEFT) == 0)
-      pCmdUI->SetCheck(1);
-    else
-      pCmdUI->SetCheck(0);
-  }
-}
-
-void CEditorFrame::OnAlignright() 
-{
-    ExecuteAttribParam(ALIGN_COMMAND,ALIGN_RIGHT);
-}
-
-void CEditorFrame::OnUpdateAlignright(CCmdUI* pCmdUI) 
-{
-  nsEmbedCString tValue;
-  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
-  if (NS_SUCCEEDED(rv))
-  {
-    if (strcmp(tValue.get(), ALIGN_RIGHT) == 0)
-      pCmdUI->SetCheck(1);
-    else
-      pCmdUI->SetCheck(0);
-  }
-}
-
-void CEditorFrame::OnAligncenter() 
-{
-    ExecuteAttribParam(ALIGN_COMMAND,ALIGN_CENTER);
-}
-
-void CEditorFrame::OnUpdateAligncenter(CCmdUI* pCmdUI) 
-{
-  nsEmbedCString tValue;
-  nsresult rv = GetAttributeParamValue(ALIGN_COMMAND,tValue);
-  if (NS_SUCCEEDED(rv))
-  {
-    if (strcmp(tValue.get(), ALIGN_CENTER) == 0)
-      pCmdUI->SetCheck(1);
-    else
-      pCmdUI->SetCheck(0);
-  }
-}
-
-void CEditorFrame::OnInsertlink() 
-{
-    if (InLink())
-       ShowEditLinkDlg();
-    else
-       ShowInsertLinkDlg();
-}
-
-void CEditorFrame::ShowInsertLinkDlg()
-{
-    CLinkPropertiesDlg dlg;
-
-    if(dlg.DoModal() == IDOK)
-    {
-        InsertLink(dlg.m_LinkText, dlg.m_LinkLocation);
-    }
-}
-
-void CEditorFrame::InsertLink(CString& linkText, CString& linkLocation)
-{
-    CString html = " &nbsp;<A HREF=\"" + linkLocation + "\">" + linkText + "</A>&nbsp; ";
-
-    InsertHTML(html);
-}
-
-void CEditorFrame::InsertHTML(CString& str)
-{
-    nsEmbedString htmlToInsert;
-#ifdef _UNICODE
-    htmlToInsert.Assign(str.GetBuffer(0));
-#else
-    NS_CStringToUTF16(nsEmbedCString(str.GetBuffer(0)),
-                      NS_CSTRING_ENCODING_ASCII,
-                      htmlToInsert);
-#endif
-
-    nsCOMPtr<nsIHTMLEditor> htmlEditor;
-    GetHTMLEditor(getter_AddRefs(htmlEditor)); 
-    if (htmlEditor) 
-       htmlEditor->InsertHTML(htmlToInsert);
-}
-
-void CEditorFrame::ShowEditLinkDlg()
-{
-    nsCOMPtr<nsIDOMHTMLAnchorElement> anchorElement;
-    CLinkPropertiesDlg dlg;
-
-    if (GetCurrentLinkInfo(dlg.m_LinkText, dlg.m_LinkLocation, getter_AddRefs(anchorElement)))
-    {
-        if(dlg.DoModal() == IDOK)
-        {
-            //Select the link being edited and then insert the
-            //new link into it's place i.e. essentially a replace operation
-            nsCOMPtr<nsIHTMLEditor> htmlEditor;
-            GetHTMLEditor(getter_AddRefs(htmlEditor)); 
-            if (htmlEditor) 
-               htmlEditor->SelectElement(anchorElement);
-
-            InsertLink(dlg.m_LinkText, dlg.m_LinkLocation);
-        }
-    }
-}
-
-BOOL CEditorFrame::GetCurrentLinkInfo(CString& strLinkText, CString& strLinkLocation, nsIDOMHTMLAnchorElement** anchorElement)
-{
-    USES_CONVERSION;
-
-    nsCOMPtr<nsIHTMLEditor> htmlEditor;
-
-    GetHTMLEditor(getter_AddRefs(htmlEditor));
-    if (!htmlEditor)
-        return FALSE;
-
-    nsCOMPtr<nsIDOMElement> domElement;
-    htmlEditor->GetElementOrParentByTagName(nsEmbedString(L"href"), 
-                                            nsnull,
-                                            getter_AddRefs(domElement));
-    if (!domElement)
-        return FALSE;
-
-    nsEmbedString linkLocation, linkText;
-    nsresult rv = NS_ERROR_FAILURE;
-
-    // Determine linkLocation
-    nsCOMPtr<nsIDOMHTMLAnchorElement> linkElement(do_QueryInterface(domElement, &rv));
-    if (NS_SUCCEEDED(rv))
-        rv = linkElement->GetHref(linkLocation);
-    if (NS_FAILED(rv))
-        return FALSE;
-
-    // Determine linkText
-    nsCOMPtr<nsIDOMNode> firstChild;
-    rv = linkElement->GetFirstChild(getter_AddRefs(firstChild));
-    if (NS_FAILED(rv))
-        return FALSE;
-    firstChild->GetNodeValue(linkText);
-    if (NS_FAILED(rv))
-        return FALSE;
-
-    strLinkText = W2CT(linkText.get());
-    strLinkLocation = W2CT(linkLocation.get());
-
-    *anchorElement = linkElement;
-    NS_ADDREF(*anchorElement);
-
-	return TRUE;
-}
-
-void CEditorFrame::OnEditUndo() 
-{
-    ExecuteNoParam(UNDO_COMMAND);
-}
-
-void CEditorFrame::OnEditRedo() 
-{
-    ExecuteNoParam(REDO_COMMAND);    
-}
-
-void CEditorFrame::OnUpdateEditRedo(CCmdUI* pCmdUI) 
-{
-  nsresult rv;
-  nsCOMPtr<nsICommandParams> params;
-  rv = MakeCommandParams(REDO_COMMAND,getter_AddRefs(params));
-  if (NS_FAILED(rv))
-    return;
-  if (!params)
-    return;
-  rv = GetCommandState(REDO_COMMAND, params);
-  if (NS_SUCCEEDED(rv))
-  {
-    PRBool tValue;
-    params->GetBooleanValue(STATE_ENABLED,&tValue);
-    if (tValue)
-    {
-      pCmdUI->Enable(TRUE);
-      return;
-    }
-  }
-  pCmdUI->Enable(FALSE);    
-}
-
-void CEditorFrame::OnUpdateEditUndo(CCmdUI* pCmdUI) 
-{
-  nsresult rv;
-  nsCOMPtr<nsICommandParams> params;
-  rv = MakeCommandParams(UNDO_COMMAND,getter_AddRefs(params));
-  if (NS_FAILED(rv))
-    return;
-  if (!params)
-    return;
-  rv = GetCommandState(UNDO_COMMAND, params);
-  if (NS_SUCCEEDED(rv))
-  {
-    PRBool tValue;
-    params->GetBooleanValue(STATE_ENABLED,&tValue);
-    if (tValue)
-    {
-      pCmdUI->Enable(TRUE);
-      return;
-    }
-  }
-  pCmdUI->Enable(FALSE);        
-}
-
-void CEditorFrame::GetEditor(nsIEditor** editor)
-{
-    mEditingSession->GetEditorForWindow(mDOMWindow, editor);
-}
-
-void CEditorFrame::GetHTMLEditor(nsIHTMLEditor** htmlEditor)
-{
-    *htmlEditor = 0;
-
-    nsCOMPtr<nsIEditor> editor;
-    GetEditor(getter_AddRefs(editor));
-    if (!editor) 
-	{
-        return;
-    }
-
-    editor->QueryInterface(NS_GET_IID(nsIHTMLEditor), (void**)htmlEditor);
-}
-
-BOOL CEditorFrame::InLink()
-{
-    nsCOMPtr<nsIHTMLEditor> htmlEditor;
-
-    GetHTMLEditor(getter_AddRefs(htmlEditor));
-
-    if (htmlEditor) 
-	{
-        nsCOMPtr<nsIDOMElement> domElememt;
-        htmlEditor->GetElementOrParentByTagName(nsEmbedString(L"href"), 
-                                                nsnull,
-                                                getter_AddRefs(domElememt));
-        return domElememt ? TRUE : FALSE;
-    }
-
-    return false;
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/EditorFrm.h
+++ /dev/null
@@ -1,124 +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):
- *   Mike Judge <mjudge@netscape.com>
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef _EDITORFRM_H_
-#define _EDITORFRM_H_
-
-class nsICommandParams;
-class nsIEditor;
-class nsIHTMLEditor;
-
-#include "nsIEditingSession.h"
-#include "nsICommandManager.h"
-
-class CEditorFrame : public CBrowserFrame
-{    
-public:
-    CEditorFrame(PRUint32 chromeMask);
-    virtual ~CEditorFrame();
-
-protected: 
-    DECLARE_DYNAMIC(CEditorFrame)
-
-public:
-    BOOL InitEditor();
-    NS_METHOD MakeEditable();
-    NS_METHOD DoCommand(const char *aCommand, nsICommandParams *aCommandParams);
-    NS_METHOD IsCommandEnabled(const char *aCommand, PRBool *retval);
-    NS_METHOD GetCommandState(const char *aCommand, nsICommandParams *aCommandParams);
-
-    void GetEditor(nsIEditor** editor);
-    void GetHTMLEditor(nsIHTMLEditor** htmlEditor);
-    BOOL InLink();
-    void ShowInsertLinkDlg();
-    void ShowEditLinkDlg();
-    BOOL GetCurrentLinkInfo(CString& strLinkText, CString& strLinkLocation, nsIDOMHTMLAnchorElement** anchorElement);
-    void InsertLink(CString& linkText, CString& linkLocation);
-    void InsertHTML(CString& str);
-
-// Generated message map functions
-protected:
-    //{{AFX_MSG(CEditorFrame)
-    afx_msg void OnBold();
-    afx_msg void OnUpdateBold(CCmdUI* pCmdUI);
-    afx_msg void OnItalics();
-    afx_msg void OnUpdateItalics(CCmdUI* pCmdUI);
-    afx_msg void OnUnderline();
-    afx_msg void OnUpdateUnderline(CCmdUI* pCmdUI);
-    afx_msg void OnIndent();
-    afx_msg void OnUpdateIndent(CCmdUI* pCmdUI);
-    afx_msg void OnOutdent();
-    afx_msg void OnUpdateOutdent(CCmdUI* pCmdUI);
-    afx_msg void OnFontred();
-    afx_msg void OnUpdateFontred(CCmdUI* pCmdUI);
-    afx_msg void OnFontblack();
-    afx_msg void OnUpdateFontblack(CCmdUI* pCmdUI);
-    afx_msg void OnBgcolor();
-    afx_msg void OnUpdateBgcolor(CCmdUI* pCmdUI);
-    afx_msg void OnNobgcolor();
-    afx_msg void OnUpdateNobgcolor(CCmdUI* pCmdUI);
-    afx_msg void OnFontsizeincrease();
-    afx_msg void OnFontsizedecrease();
-    afx_msg void OnArial();
-    afx_msg void OnTimes();
-    afx_msg void OnCourier();
-    afx_msg void OnAlignleft();
-    afx_msg void OnUpdateAlignleft(CCmdUI* pCmdUI);
-    afx_msg void OnAlignright();
-    afx_msg void OnUpdateAlignright(CCmdUI* pCmdUI);
-    afx_msg void OnAligncenter();
-    afx_msg void OnUpdateAligncenter(CCmdUI* pCmdUI);
-    afx_msg void OnInsertlink();
-    afx_msg void OnEditUndo();
-    afx_msg void OnEditRedo();
-    afx_msg void OnUpdateEditRedo(CCmdUI* pCmdUI);
-    afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
-    //}}AFX_MSG
-
-    DECLARE_MESSAGE_MAP()
-
-private:
-    NS_METHOD ExecuteStyleCommand(const char *aCommand);
-    NS_METHOD ExecuteNoParam(const char *aCommand);
-    NS_METHOD MakeCommandParams(const char *aCommand,nsICommandParams **aParams);
-    NS_METHOD ExecuteAttribParam(const char *aCommand, const char *aAttribute);
-    NS_METHOD GetAttributeParamValue(const char *aCommand, nsEmbedCString &aValue);
-
-    void UpdateStyleToolBarBtn(const char *aCommand, CCmdUI* pCmdUI);
-
-private:
-    nsCOMPtr<nsICommandManager> mCommandManager;
-    nsCOMPtr<nsIDOMWindow> mDOMWindow;
-	nsCOMPtr<nsIEditingSession> mEditingSession;
-};
-
-#endif //_EDITORFRM_H_
deleted file mode 100644
--- a/embedding/tests/mfcembed/IBrowserFrameGlue.h
+++ /dev/null
@@ -1,112 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// This interface acts as a glue between the required/optional 
-// Gecko embedding interfaces and the actual platform specific
-// way of doing things - such as updating a statusbar etc.
-//
-// For ex, in the mfcembed sample the required interfaces such as 
-// IWebBrowserChrome etc. are implemented in a XP way in the
-// BrowserImp*.cpp files. However, when they get called to update the
-// statusbar etc. they call on this interface to get the actual job
-// done. During the BrowserFrame creation some object must implement
-// this interface and pass the pointer to it via the Init() member of
-// the CBrowserImpl class
-
-#ifndef _IBROWSERFRAMEGLUE_H
-#define _IBROWSERFRAMEGLUE_H
-
-struct IBrowserFrameGlue {
-    // Progress Related Methods
-    virtual void UpdateStatusBarText(const PRUnichar *aMessage) = 0;
-    virtual void UpdateProgress(PRInt32 aCurrent, PRInt32 aMax) = 0;
-    virtual void UpdateBusyState(PRBool aBusy) = 0;
-    virtual void UpdateCurrentURI(nsIURI *aLocation) = 0;
-    virtual void UpdateSecurityStatus(PRInt32 aState) = 0;
-
-    // BrowserFrame Related Methods
-    virtual PRBool CreateNewBrowserFrame(PRUint32 chromeMask, 
-                            PRInt32 x, PRInt32 y, 
-                            PRInt32 cx, PRInt32 cy,
-                            nsIWebBrowser ** aWebBrowser) = 0;
-    virtual void DestroyBrowserFrame() = 0;
-    virtual void GetBrowserFrameTitle(PRUnichar **aTitle) = 0;
-    virtual void SetBrowserFrameTitle(const PRUnichar *aTitle) = 0;
-    virtual void GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY) = 0;
-    virtual void SetBrowserFramePosition(PRInt32 aX, PRInt32 aY) = 0;
-    virtual void GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY) = 0;
-    virtual void SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY) = 0;
-    virtual void GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY) = 0;
-    virtual void SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint) = 0;
-    virtual void ShowBrowserFrame(PRBool aShow) = 0;
-    virtual void SetFocus() = 0;
-    virtual void FocusAvailable(PRBool *aFocusAvail) = 0;
-    virtual void GetBrowserFrameVisibility(PRBool *aVisible) = 0;
-
-    // ContextMenu Related Methods
-    virtual void ShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo) = 0;
-
-    // Tooltip methods
-    virtual void ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText) = 0;
-    virtual void HideTooltip() = 0;
-
-    virtual HWND GetBrowserFrameNativeWnd() = 0;
-};
-
-#define    NS_DECL_BROWSERFRAMEGLUE    \
-    public:    \
-        virtual void UpdateStatusBarText(const PRUnichar *aMessage);    \
-        virtual void UpdateProgress(PRInt32 aCurrent, PRInt32 aMax);    \
-        virtual void UpdateBusyState(PRBool aBusy);                        \
-        virtual void UpdateCurrentURI(nsIURI *aLocation);                \
-        virtual void UpdateSecurityStatus(PRInt32 aState);              \
-        virtual PRBool CreateNewBrowserFrame(PRUint32 chromeMask, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, nsIWebBrowser** aWebBrowser);    \
-        virtual void DestroyBrowserFrame();                            \
-        virtual void GetBrowserFrameTitle(PRUnichar **aTitle);    \
-        virtual void SetBrowserFrameTitle(const PRUnichar *aTitle);    \
-        virtual void GetBrowserFramePosition(PRInt32 *aX, PRInt32 *aY);    \
-        virtual void SetBrowserFramePosition(PRInt32 aX, PRInt32 aY);    \
-        virtual void GetBrowserFrameSize(PRInt32 *aCX, PRInt32 *aCY);    \
-        virtual void SetBrowserFrameSize(PRInt32 aCX, PRInt32 aCY);        \
-        virtual void GetBrowserFramePositionAndSize(PRInt32 *aX, PRInt32 *aY, PRInt32 *aCX, PRInt32 *aCY);    \
-        virtual void SetBrowserFramePositionAndSize(PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY, PRBool fRepaint);    \
-        virtual void ShowBrowserFrame(PRBool aShow);                    \
-        virtual void SetFocus();                                        \
-        virtual void FocusAvailable(PRBool *aFocusAvail);                \
-        virtual void GetBrowserFrameVisibility(PRBool *aVisible);        \
-        virtual void ShowContextMenu(PRUint32 aContextFlags, nsIContextMenuInfo *aInfo); \
-        virtual void ShowTooltip(PRInt32 aXCoords, PRInt32 aYCoords, const PRUnichar *aTipText); \
-        virtual void HideTooltip(); \
-        virtual HWND GetBrowserFrameNativeWnd();
-        
-typedef IBrowserFrameGlue *PBROWSERFRAMEGLUE;
-
-#endif //_IBROWSERFRAMEGLUE_H
deleted file mode 100644
--- a/embedding/tests/mfcembed/Makefile.in
+++ /dev/null
@@ -1,208 +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		= mfcembed$(BIN_SUFFIX)
-RESFILE		= MfcEmbed.res
-
-MODULE = mfcEmbed
-PACKAGE_FILE = mfcembed.pkg
-
-# comment this out if for some reason you want to link against xpcom
-# directly instead of using the standalone glue
-ifndef BUILD_STATIC_LIBS
-GRE_BUILD = 1
-endif
-
-ifdef GRE_BUILD
-DEFINES   += -DXPCOM_GLUE -DMOZILLA_STRICT_API
-endif
-
-REQUIRES = \
-	xpcom_obsolete \
-	xpcom \
-	string \
-	necko \
-	webbrwsr \
-	widget \
-	docshell \
-	dom \
-	uriloader \
-	embed_base \
-	webshell \
-	shistory \
-	pref \
-	profile \
-	profdirserviceprovider \
-	find \
-	gfx \
-	windowwatcher \
-	layout \
-	webbrowserpersist \
-	composer \
-	commandhandler \
-	imglib2 \
-	webbrwsr \
-	editor \
-	$(NULL)
-
-ifdef NS_TRACE_MALLOC
-REQUIRES	+= tracemalloc
-endif
-
-ifdef MOZ_PROFILESHARING
-REQUIRES	+= profilesharingsetup
-endif
-
-CPPSRCS		= \
-		CCustomPromptDialog.cpp     \
-		CMarginHeaderFooter.cpp     \
-		CFormatOptionTab.cpp     \
-		CPageSetupPropSheet.cpp     \
-		MfcEmbed.cpp     \
-		BrowserFrm.cpp   \
-		EditorFrm.cpp 	\
-		BrowserFrameGlue.cpp   \
-		BrowserView.cpp \
-		BrowserImpl.cpp \
-		BrowserImplWebPrgrsLstnr.cpp \
-		BrowserImplCtxMenuLstnr.cpp \
-		BrowserToolTip.cpp \
-		Dialogs.cpp       \
-		ProfileMgr.cpp \
-		ProfilesDlg.cpp \
-		winEmbedFileLocProvider.cpp \
-		MostRecentUrls.cpp \
-		Preferences.cpp \
-		StdAfx.cpp       \
-		$(NULL)
-
-LIBS		= \
-	$(DEPTH)/profile/dirserviceprovider/standalone/$(LIB_PREFIX)profdirserviceprovidersa_s.$(LIB_SUFFIX) \
-	$(NULL)
-
-ifdef NS_TRACE_MALLOC
-LIBS		+= $(DIST)/lib/$(LIB_PREFIX)tracemalloc.$(LIB_SUFFIX)
-endif
-
-LIBS		+= \
-		$(MOZ_UNICHARUTIL_LIBS) \
-		$(NULL)
-
-ifdef GRE_BUILD
-LIBS += \
-		 $(DEPTH)/embedding/base/standalone/$(LIB_PREFIX)embed_base_standalone.$(LIB_SUFFIX) \
-		 $(XPCOM_STANDALONE_GLUE_LDOPTS) \
-		 $(NULL)
-else
-LIBS += \
-		 $(DEPTH)/embedding/base/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \
-		 $(XPCOM_LIBS) \
-		 $(NULL)
-ifdef BUILD_STATIC_LIBS
-LIBS += $(MOZ_JS_LIBS)
-endif
-endif
-
-LIBS += $(NSPR_LIBS)
-
-OS_LIBS		+= \
-		ole32.lib \
-		comdlg32.lib \
-		shell32.lib \
-		version.lib \
-		$(NULL)
-
-LOCAL_INCLUDES	= -I$(srcdir)/components
-
-#
-# 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)
-ifneq ($(OS_ARCH),WINNT)
-EXTRA_LIBS     += -L$(DEPTH)/dist/lib/components
-endif # !WINNT
-EXTRA_LIBS     += $(EXTRA_DSO_LIBS) $(STATIC_EXTRA_LIBS)
-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
-
-# UNICODE
-ifdef BUILD_UNICODE_MFCEMBED
-CXXFLAGS        += -D "_UNICODE"
-LDFLAGS         += -ENTRY:wWinMainCRTStartup
-endif
-
-CXXFLAGS	+= -D "_AFXDLL" -D "USE_SINGLE_SIGN_ON" -DMOZILLA_VERSION=\"$(MOZILLA_VERSION)\"
-LDFLAGS		+= -SUBSYSTEM:windows
-
-libs:: mfcembed.htm
-	$(INSTALL) $^ $(DIST)/bin
-
-install:: mfcembed.htm
-	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/MfcEmbed.cpp
+++ /dev/null
@@ -1,922 +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):
- *   Chak Nanga <chak@netscape.com>
- *   Conrad Carlen <ccarlen@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// File Overview....
-//
-// The typical MFC app, frame creation code + AboutDlg handling
-//
-// NS_InitEmbedding() is called in InitInstance()
-// 
-// NS_TermEmbedding() is called in ExitInstance()
-// ExitInstance() also takes care of cleaning up of
-// multiple browser frame windows on app exit
-//
-// Code to handle the creation of a new browser window
-
-// Next suggested file to look at : BrowserFrm.cpp
-
-// Local Includes
-#include "stdafx.h"
-#include "MfcEmbed.h"
-#include "nsXPCOM.h"
-#include "nsXPCOMGlue.h"
-#include "nsMemory.h"
-#include "nsIComponentRegistrar.h"
-#include "nsIFactory.h"
-#include "nsServiceManagerUtils.h"
-#include "BrowserFrm.h"
-#include "EditorFrm.h"
-#include "winEmbedFileLocProvider.h"
-#include "BrowserImpl.h"
-#include "nsIWindowWatcher.h"
-#include "plstr.h"
-#include "Preferences.h"
-#include <io.h>
-#include <fcntl.h>
-
-#ifdef USE_PROFILES
-#include "ProfileMgr.h"
-#else
-#include "nsProfileDirServiceProvider.h"
-#endif
-
-#ifdef MOZ_PROFILESHARING
-#include "nsIProfileSharingSetup.h"
-#endif
-
-#ifdef _BUILD_STATIC_BIN
-#include "nsStaticComponent.h"
-nsresult PR_CALLBACK
-app_getModuleInfo(nsStaticModuleInfo **info, PRUint32 *count);
-#endif
-
-
-#ifdef NS_TRACE_MALLOC
-#include "nsTraceMalloc.h"
-#endif
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-// this is for overriding the Mozilla default PromptService component
-#include "PromptService.h"
-#define kComponentsLibname _T("mfcEmbedComponents.dll")
-#define NS_PROMPTSERVICE_CID \
- {0xa2112d6a, 0x0e28, 0x421f, {0xb4, 0x6a, 0x25, 0xc0, 0xb3, 0x8, 0xcb, 0xd0}}
-static NS_DEFINE_CID(kPromptServiceCID, NS_PROMPTSERVICE_CID);
-
-// this is for overriding the Mozilla default PrintingPromptService component
-#include "PrintingPromptService.h"
-#define NS_PRINTINGPROMPTSERVICE_CID \
- {0xe042570c, 0x62de, 0x4bb6, { 0xa6, 0xe0, 0x79, 0x8e, 0x3c, 0x7, 0xb4, 0xdf}}
-static NS_DEFINE_CID(kPrintingPromptServiceCID, NS_PRINTINGPROMPTSERVICE_CID);
-
-// this is for overriding the Mozilla default HelperAppLauncherDialog
-#include "HelperAppService.h"
-#define NS_HELPERAPPLAUNCHERDIALOG_CID \
-    {0xf68578eb, 0x6ec2, 0x4169, {0xae, 0x19, 0x8c, 0x62, 0x43, 0xf0, 0xab, 0xe1}}
-static NS_DEFINE_CID(kHelperAppLauncherDialogCID, NS_HELPERAPPLAUNCHERDIALOG_CID);
-
-class CMfcEmbedCommandLine : public CCommandLineInfo
-{
-public:
-
-    CMfcEmbedCommandLine(CMfcEmbedApp& app) : CCommandLineInfo(),
-                                              mApp(app)
-    {
-    }
-
-    // generic parser which bundles up flags and their parameters, to
-    // pass to HandleFlag() or HandleNakedParameter()
-    // if you're adding new parameters, please don't touch this
-    // function and instead add your own handler below
-    virtual void ParseParam(LPCTSTR szParam, BOOL bFlag, BOOL bLast)
-    {
-        CCommandLineInfo::ParseParam(szParam, bFlag, bLast);
-        if (bFlag) {
-            // advance past extra stuff like --foo
-            while (*szParam && *szParam == '-')
-                szParam++;
-
-            // previous argument was a flag too, so process that first
-            if (mLastFlag.Length() != 0)
-                HandleFlag(mLastFlag);
-            
-            mLastFlag = szParam;
-
-            // oops, no more arguments coming, so handle this now
-            if (bLast)
-                HandleFlag(mLastFlag);
-            
-        } else {
-            if (mLastFlag.Length() != 0)
-                HandleFlag(mLastFlag, szParam);
-                
-            mLastFlag.Cut(0, PR_UINT32_MAX);
-        }
-    }
-
-    // handle flag-based parameters
-#ifdef _UNICODE
-    void HandleFlag(const nsAString& flag, const TCHAR * param = nsnull)
-#else
-    void HandleFlag(const nsACString& flag, const TCHAR * param = nsnull)
-#endif
-    {
-        if (_tcscmp(flag.BeginReading(), _T("console")) == 0)
-            DoConsole();
-        else if (_tcscmp(flag.BeginReading(), _T("chrome")) == 0)
-            DoChrome();
-#ifdef NS_TRACE_MALLOC
-        else if (_tcscmp(flag.BeginReading(), _T("trace-malloc")) == 0)
-        {
-            USES_CONVERSION;
-            DoTraceMalloc(flag, T2CA(param));
-        }
-#endif
-        // add new flag handlers here (please add a DoFoo() method below!)
-    }
-
-    void HandleNakedParameter(const char* flag) {
-        // handle non-flag arguments here
-    }
-
-    // add your specific handlers here
-    void DoConsole() {
-        mApp.ShowDebugConsole();
-    }
-
-    void DoChrome() {
-        mApp.m_bChrome = TRUE;
-    }
-
-#ifdef NS_TRACE_MALLOC
-    void DoTraceMalloc(const nsACString& flag, const char* param)
-    {
-        if (!param) {
-            NS_WARNING("--trace-malloc needs a filename as a parameter");
-            return;
-        }
-
-        // build up fake argv/argc arguments for tracemalloc stuff
-        char* argv[] = { "mfcembed", "--trace-malloc",
-                         NS_CONST_CAST(char*, param) };
-        
-        NS_TraceMallocStartupArgs(3, argv);
-    }
-#endif
-    
-private:
-    // autostring is fine, this is a stack based object anyway
-#ifdef _UNICODE
-    nsEmbedString mLastFlag;
-#else
-    nsEmbedCString mLastFlag;
-#endif
-
-    CMfcEmbedApp& mApp;
-};
-
-
-BEGIN_MESSAGE_MAP(CMfcEmbedApp, CWinApp)
-    //{{AFX_MSG_MAP(CMfcEmbedApp)
-    ON_COMMAND(ID_NEW_BROWSER, OnNewBrowser)
-    ON_COMMAND(ID_NEW_EDITORWINDOW, OnNewEditor)
-#ifdef USE_PROFILES
-    ON_COMMAND(ID_MANAGE_PROFILES, OnManageProfiles)
-#endif
-    ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
-    ON_COMMAND(ID_EDIT_PREFERENCES, OnEditPreferences)
-    // NOTE - the ClassWizard will add and remove mapping macros here.
-    //    DO NOT EDIT what you see in these blocks of generated code!
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-CMfcEmbedApp::CMfcEmbedApp()
-{
-    mRefCnt = 1; // Start at one - nothing is going to addref this object
-
-#ifdef USE_PROFILES
-    m_ProfileMgr = NULL;
-#endif
-
-    m_strHomePage = "";
-
-    m_iStartupPage = 0; 
-
-    m_bChrome = FALSE;
-}
-
-CMfcEmbedApp theApp;
-
-/* Some Gecko interfaces are implemented as components, automatically
-   registered at application initialization. nsIPrompt is an example:
-   the default implementation uses XUL, not native windows. Embedding
-   apps can override the default implementation by implementing the
-   nsIPromptService interface and registering a factory for it with
-   the same CID and Contract ID as the default's.
-
-   Note that this example implements the service in a separate DLL,
-   replacing the default if the override DLL is present. This could
-   also have been done in the same module, without a separate DLL.
-   See the PowerPlant example for, well, an example.
-*/
-nsresult CMfcEmbedApp::OverrideComponents()
-{
-    nsCOMPtr<nsIComponentRegistrar> compReg;
-    nsresult rv = NS_GetComponentRegistrar(getter_AddRefs(compReg));
-    NS_ENSURE_SUCCESS(rv, rv);
-    
-    // replace Mozilla's default PromptService with our own, if the
-    // expected override DLL is present
-    HMODULE overlib = ::LoadLibrary(kComponentsLibname);
-    if (overlib) {
-        InitPromptServiceType InitLib;
-        MakeFactoryType MakeFactory;
-        InitLib = reinterpret_cast<InitPromptServiceType>(::GetProcAddress(overlib, kPromptServiceInitFuncName));
-        MakeFactory = reinterpret_cast<MakeFactoryType>(::GetProcAddress(overlib, kPromptServiceFactoryFuncName));
-
-        if (InitLib && MakeFactory) {
-            InitLib(overlib);
-
-            nsCOMPtr<nsIFactory> promptFactory;
-            rv = MakeFactory(getter_AddRefs(promptFactory));
-            if (NS_SUCCEEDED(rv)) {
-                compReg->RegisterFactory(kPromptServiceCID,
-                                         "Prompt Service",
-                                         "@mozilla.org/embedcomp/prompt-service;1",
-                                         promptFactory);
-            }
-        } else
-          ::FreeLibrary(overlib);
-    }
-
-    // Replace Mozilla's helper app launcher dialog with our own
-    overlib = ::LoadLibrary(kComponentsLibname);
-    if (overlib) {
-        InitHelperAppDlgType InitLib;
-        MakeFactoryType MakeFactory;
-        InitLib = reinterpret_cast<InitHelperAppDlgType>(::GetProcAddress(overlib, kHelperAppDlgInitFuncName));
-        MakeFactory = reinterpret_cast<MakeFactoryType>(::GetProcAddress(overlib, kHelperAppDlgFactoryFuncName));
-
-        if (InitLib && MakeFactory) {
-            InitLib(overlib);
-
-            nsCOMPtr<nsIFactory> helperAppDlgFactory;
-            rv = MakeFactory(getter_AddRefs(helperAppDlgFactory));
-            if (NS_SUCCEEDED(rv))
-                compReg->RegisterFactory(kHelperAppLauncherDialogCID,
-                                         "Helper App Launcher Dialog",
-                                         "@mozilla.org/helperapplauncherdialog;1",
-                                         helperAppDlgFactory);
-        } else
-          ::FreeLibrary(overlib);
-    }
-
-    // replace Mozilla's default PrintingPromptService with our own, if the
-    // expected override DLL is present
-    overlib = ::LoadLibrary(kComponentsLibname);
-    if (overlib) {
-        InitPrintingPromptServiceType InitLib;
-        MakeFactoryType MakeFactory;
-        InitLib = reinterpret_cast<InitPrintingPromptServiceType>(::GetProcAddress(overlib, kPrintingPromptServiceInitFuncName));
-        MakeFactory = reinterpret_cast<MakeFactoryType>(::GetProcAddress(overlib, kPrintingPromptServiceFactoryFuncName));
-
-        if (InitLib && MakeFactory) {
-            InitLib(overlib);
-
-            nsCOMPtr<nsIFactory> printingPromptFactory;
-            rv = MakeFactory(getter_AddRefs(printingPromptFactory));
-            if (NS_SUCCEEDED(rv))
-                compReg->RegisterFactory(kPrintingPromptServiceCID,
-                                         "Printing Prompt Service",
-                                         "@mozilla.org/embedcomp/printingprompt-service;1",
-                                         printingPromptFactory);
-        } else
-          ::FreeLibrary(overlib);
-    }
-    return rv;
-}
-
-void CMfcEmbedApp::ShowDebugConsole()
-{
-#ifdef _DEBUG
-    // Show console only in debug mode
-
-    if(! AllocConsole())
-        return;
-
-    // Redirect stdout to the console
-    int hCrtOut = _open_osfhandle(
-                (long) GetStdHandle(STD_OUTPUT_HANDLE),
-                _O_TEXT);
-    if(hCrtOut == -1)
-        return;
-
-    FILE *hfOut = _fdopen(hCrtOut, "w");
-    if(hfOut != NULL)
-    {
-        // Setup for unbuffered I/O so the console 
-        // output shows up right away
-        *stdout = *hfOut;
-        setvbuf(stdout, NULL, _IONBF, 0); 
-    }
-
-    // Redirect stderr to the console
-    int hCrtErr = _open_osfhandle(
-                (long) GetStdHandle(STD_ERROR_HANDLE),
-                _O_TEXT);
-    if(hCrtErr == -1)
-        return;
-
-    FILE *hfErr = _fdopen(hCrtErr, "w");
-    if(hfErr != NULL)
-    {
-        // Setup for unbuffered I/O so the console 
-        // output shows up right away
-        *stderr = *hfErr;
-        setvbuf(stderr, NULL, _IONBF, 0); 
-    }
-#endif
-}
-
-
-// Initialize our MFC application and also init
-// the Gecko embedding APIs
-// Note that we're also init'ng the profile switching
-// code here
-// Then, create a new BrowserFrame and load our
-// default homepage
-//
-BOOL CMfcEmbedApp::InitInstance()
-{
-#ifdef _BUILD_STATIC_BIN
-    // Initialize XPCOM's module info table
-    NSGetStaticModuleInfo = app_getModuleInfo;
-#endif
-
-#ifdef XPCOM_GLUE
-    if (NS_FAILED(XPCOMGlueStartup(GRE_GetXPCOMPath()))) {
-        MessageBox(NULL, "Could not initialize XPCOM. Perhaps the GRE\nis not installed or could not be found?", "MFCEmbed", MB_OK | MB_ICONERROR);
-        return FALSE;
-    }
-#endif
-
-    CMfcEmbedCommandLine cmdLine(*this);
-    ParseCommandLine(cmdLine);
-    
-    Enable3dControls();
-
-    //
-    // 1. Determine the name of the dir from which the GRE based app is being run
-    // from [It's OK to do this even if you're not running in an GRE env]
-    //
-    // 2. Create an nsILocalFile out of it which will passed in to NS_InitEmbedding()
-    //
-    // Please see http://www.mozilla.org/projects/embedding/GRE.html
-    // for more info. on GRE
-
-    TCHAR path[_MAX_PATH+1];
-    ::GetModuleFileName(0, path, _MAX_PATH);
-    TCHAR* lastSlash = _tcsrchr(path, _T('\\'));
-    if (!lastSlash) {
-        NS_ERROR("No slash in module file name... something is wrong.");
-        return FALSE;
-    }
-    *lastSlash = _T('\0');
-
-    USES_CONVERSION;
-    nsresult rv;
-    nsCOMPtr<nsILocalFile> mreAppDir;
-    rv = NS_NewNativeLocalFile(nsEmbedCString(T2A(path)), TRUE, getter_AddRefs(mreAppDir));
-    NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create mreAppDir localfile");
-
-    // Take a look at 
-    // http://www.mozilla.org/projects/xpcom/file_locations.html
-    // for more info on File Locations
-
-    CString strRes;
-    strRes.LoadString(IDS_PROFILES_FOLDER_NAME);
-    winEmbedFileLocProvider *provider = new winEmbedFileLocProvider(nsEmbedCString(strRes));
-    if(!provider)
-    {
-        ASSERT(FALSE);
-        return FALSE;
-    }
-
-    rv = NS_InitEmbedding(mreAppDir, provider);
-    if(NS_FAILED(rv))
-    {
-        ASSERT(FALSE);
-        return FALSE;
-    }
-
-    rv = OverrideComponents();
-    if(NS_FAILED(rv))
-    {
-        ASSERT(FALSE);
-        return FALSE;
-    }
-
-
-    rv = InitializeWindowCreator();
-    if (NS_FAILED(rv))
-    {
-        ASSERT(FALSE);
-        return FALSE;
-    }
-
-    if(!InitializeProfiles())
-    {
-        ASSERT(FALSE);
-        NS_TermEmbedding();
-        return FALSE;
-    }
-
-
-    if(!CreateHiddenWindow())
-    {
-        ASSERT(FALSE);
-        NS_TermEmbedding();
-        return FALSE;
-    }
-
-    // Create the first browser frame window
-    OnNewBrowser();
-
-    return TRUE;
-}
-
-CBrowserFrame* CMfcEmbedApp::CreateNewBrowserFrame(PRUint32 chromeMask,
-                                                   PRInt32 x, PRInt32 y,
-                                                   PRInt32 cx, PRInt32 cy,
-                                                   PRBool bShowWindow,
-                                                   PRBool bIsEditor
-                                                   )
-{
-    UINT resId = bIsEditor ? IDR_EDITOR : IDR_MAINFRAME;
-
-    // Setup a CRect with the requested window dimensions
-    CRect winSize(x, y, cx, cy);
-
-    // Use the Windows default if all are specified as -1
-    if(x == -1 && y == -1 && cx == -1 && cy == -1)
-        winSize = CFrameWnd::rectDefault;
-
-    // Load the window title from the string resource table
-    CString strTitle;
-    strTitle.LoadString(IDR_MAINFRAME);
-
-    // Now, create the browser frame
-    CBrowserFrame* pFrame = bIsEditor ? ( new  CEditorFrame(chromeMask) ) :
-                        ( new  CBrowserFrame(chromeMask) );
-    pFrame->SetEditable(bIsEditor);
-
-    if (!pFrame->Create(NULL, strTitle, WS_OVERLAPPEDWINDOW, 
-                    winSize, NULL, MAKEINTRESOURCE(resId), 0L, NULL))
-    {
-        return NULL;
-    }
-
-    // load accelerator resource
-    pFrame->LoadAccelTable(MAKEINTRESOURCE(IDR_MAINFRAME));
-
-    // Show the window...
-    if(bShowWindow)
-    {
-        pFrame->ShowWindow(SW_SHOW);
-        pFrame->UpdateWindow();
-    }
-
-    // Add to the list of BrowserFrame windows
-    m_FrameWndLst.AddHead(pFrame);
-
-    return pFrame;
-}
-
-void CMfcEmbedApp::OnNewBrowser()
-{
-    CBrowserFrame *pBrowserFrame = CreateNewBrowserFrame();
-
-    //Load the HomePage into the browser view
-    if(pBrowserFrame && (GetStartupPageMode() == 1))
-        pBrowserFrame->m_wndBrowserView.LoadHomePage();
-}
-
-void CMfcEmbedApp::OnNewEditor() 
-{
-    CEditorFrame *pEditorFrame = (CEditorFrame *)CreateNewBrowserFrame(nsIWebBrowserChrome::CHROME_ALL, 
-                                    -1, -1, -1, -1,
-                                    PR_TRUE,PR_TRUE);
-    if (pEditorFrame)
-    {
-        pEditorFrame->InitEditor();
-        pEditorFrame->m_wndBrowserView.OpenURL("about:blank");
-    }
-}
-
-// This gets called anytime a BrowserFrameWindow is
-// closed i.e. by choosing the "close" menu item from
-// a window's system menu or by dbl clicking on the
-// system menu box
-// 
-// Sends a WM_QUIT to the hidden window which results
-// in ExitInstance() being called and the app is
-// properly cleaned up and shutdown
-//
-void CMfcEmbedApp::RemoveFrameFromList(CBrowserFrame* pFrm, BOOL bCloseAppOnLastFrame/*= TRUE*/)
-{
-    POSITION pos = m_FrameWndLst.Find(pFrm);
-    m_FrameWndLst.RemoveAt(pos);
-
-    // Send a WM_QUIT msg. to the hidden window if we've
-    // just closed the last browserframe window and
-    // if the bCloseAppOnLastFrame is TRUE. This be FALSE
-    // only in the case we're switching profiles
-    // Without this the hidden window will stick around
-    // i.e. the app will never die even after all the 
-    // visible windows are gone.
-    if(m_FrameWndLst.GetCount() == 0 && bCloseAppOnLastFrame)
-        m_pMainWnd->PostMessage(WM_QUIT);
-}
-
-int CMfcEmbedApp::ExitInstance()
-{
-    // When File/Exit is chosen and if the user
-    // has opened multiple browser windows shut all
-    // of them down properly before exiting the app
-
-    CBrowserFrame* pBrowserFrame = NULL;
-
-    POSITION pos = m_FrameWndLst.GetHeadPosition();
-    while( pos != NULL )
-    {
-        pBrowserFrame = (CBrowserFrame *) m_FrameWndLst.GetNext(pos);
-        if(pBrowserFrame)
-        {
-            pBrowserFrame->ShowWindow(false);
-            pBrowserFrame->DestroyWindow();
-        }
-    }
-    m_FrameWndLst.RemoveAll();
-
-    if (m_pMainWnd)
-        m_pMainWnd->DestroyWindow();
-
-#ifdef USE_PROFILES
-    delete m_ProfileMgr;
-#else
-    if (m_ProfileDirServiceProvider)
-    {
-        m_ProfileDirServiceProvider->Shutdown();
-        NS_RELEASE(m_ProfileDirServiceProvider);
-    }
-#endif
-
-    NS_TermEmbedding();
-
-#ifdef XPCOM_GLUE
-    XPCOMGlueShutdown();
-#endif
-
-    return 1;
-}
-
-BOOL CMfcEmbedApp::OnIdle(LONG lCount)
-{
-    CWinApp::OnIdle(lCount);
-
-    return FALSE;
-}
-
-void CMfcEmbedApp::OnManageProfiles()
-{
-#ifdef USE_PROFILES
-    m_ProfileMgr->DoManageProfilesDialog(PR_FALSE);
-#endif
-}
-
-void CMfcEmbedApp::OnEditPreferences()
-{
-    CPreferences prefs(_T("Preferences"));
-    
-    prefs.m_startupPage.m_iStartupPage = m_iStartupPage;
-    prefs.m_startupPage.m_strHomePage = m_strHomePage;   
-
-    if(prefs.DoModal() == IDOK)
-    {
-        // Update our member vars with these new pref values
-        m_iStartupPage = prefs.m_startupPage.m_iStartupPage;
-        m_strHomePage = prefs.m_startupPage.m_strHomePage;
-
-        // Save these changes to disk now
-        nsresult rv;
-        nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
-        if (NS_SUCCEEDED(rv)) 
-        {
-            USES_CONVERSION;
-            prefs->SetIntPref("browser.startup.page", m_iStartupPage);
-            rv = prefs->SetCharPref("browser.startup.homepage", T2CA(m_strHomePage));
-            if (NS_SUCCEEDED(rv))
-                rv = prefs->SavePrefFile(nsnull);
-        }
-        else
-            NS_ASSERTION(PR_FALSE, "Could not get preferences service");
-    }
-}
-
-BOOL CMfcEmbedApp::InitializeProfiles()
-{
-
-#ifdef MOZ_PROFILESHARING
-    // If we are using profile sharing, get the sharing setup service
-    nsCOMPtr<nsIProfileSharingSetup> sharingSetup =
-        do_GetService("@mozilla.org/embedcomp/profile-sharing-setup;1");
-    if (sharingSetup)
-    {
-        USES_CONVERSION;
-        CString strRes;
-        strRes.LoadString(IDS_PROFILES_NONSHARED_NAME);
-        nsEmbedString nonSharedName(T2W(strRes));
-        sharingSetup->EnableSharing(nonSharedName);
-    }
-#endif
-
-    nsCOMPtr<nsIObserverService> observerService = 
-             do_GetService("@mozilla.org/observer-service;1");
-    if (!observerService)
-        return FALSE;
-
-    // Both the profile mgr and standalone nsProfileDirServiceProvider
-    // send this notification.
-    observerService->AddObserver(this, "profile-after-change", PR_TRUE);
-
-#ifdef USE_PROFILES
-    m_ProfileMgr = new CProfileMgr;
-    if (!m_ProfileMgr)
-        return FALSE;
-
-    observerService->AddObserver(this, "profile-approve-change", PR_TRUE);
-    observerService->AddObserver(this, "profile-change-teardown", PR_TRUE);
-
-    m_ProfileMgr->StartUp();
-#else
-    nsresult rv;
-    nsCOMPtr<nsIFile> appDataDir;
-    NS_GetSpecialDirectory(NS_APP_APPLICATION_REGISTRY_DIR,
-                                getter_AddRefs(appDataDir));
-    if (!appDataDir)
-        return FALSE;
-    nsCOMPtr<nsProfileDirServiceProvider> profProvider;
-    NS_NewProfileDirServiceProvider(PR_TRUE, getter_AddRefs(profProvider));
-    if (!profProvider)
-        return FALSE;
-    profProvider->Register();    
-    nsCOMPtr<nsILocalFile> localAppDataDir(do_QueryInterface(appDataDir));
-    rv = profProvider->SetProfileDir(localAppDataDir);
-    if (NS_FAILED(rv))
-        return FALSE;
-    NS_ADDREF(m_ProfileDirServiceProvider = profProvider);
-#endif
-
-    return TRUE;
-}
-
-// When the profile switch happens, all open browser windows need to be 
-// closed. 
-// In order for that not to kill off the app, we just make the MFC app's 
-// mainframe be an invisible window which doesn't get closed on profile 
-// switches
-BOOL CMfcEmbedApp::CreateHiddenWindow()
-{
-    CFrameWnd *hiddenWnd = new CFrameWnd;
-    if(!hiddenWnd)
-        return FALSE;
-
-    RECT bounds = { -10010, -10010, -10000, -10000 };
-    hiddenWnd->Create(NULL, _T("main"), WS_DISABLED, bounds, NULL, NULL, 0, NULL);
-    m_pMainWnd = hiddenWnd;
-
-    return TRUE;
-}
-
-nsresult CMfcEmbedApp::InitializePrefs()
-{
-   nsresult rv;
-   nsCOMPtr<nsIPref> prefs(do_GetService(NS_PREF_CONTRACTID, &rv));
-   if (NS_SUCCEEDED(rv)) {      
-
-        // We are using the default prefs from mozilla. If you were
-        // disributing your own, this would be done simply by editing
-        // the default pref files.
-        
-        PRBool inited;
-        rv = prefs->GetBoolPref("mfcbrowser.prefs_inited", &inited);
-        if (NS_FAILED(rv) || !inited)
-        {
-            USES_CONVERSION;
-            m_iStartupPage = 1;
-            m_strHomePage = "http://www.mozilla.org/projects/embedding";
-
-            prefs->SetIntPref("browser.startup.page", m_iStartupPage);
-            prefs->SetCharPref("browser.startup.homepage", T2CA(m_strHomePage));
-            prefs->SetIntPref("font.size.variable.x-western", 16);
-            prefs->SetIntPref("font.size.fixed.x-western", 13);
-            rv = prefs->SetBoolPref("mfcbrowser.prefs_inited", PR_TRUE);
-            if (NS_SUCCEEDED(rv))
-                rv = prefs->SavePrefFile(nsnull);
-        }
-        else
-        {
-            // The prefs are present, read them in
-
-            prefs->GetIntPref("browser.startup.page", &m_iStartupPage);
-
-            char* str = nsnull;
-            prefs->GetCharPref("browser.startup.homepage", &str);
-            if (str)
-            {
-                USES_CONVERSION;
-                m_strHomePage = A2CT(str);
-            }
-            else
-            {
-                m_strHomePage.Empty();
-            }
-            nsMemory::Free(str);
-        }       
-    }
-    else
-        NS_ASSERTION(PR_FALSE, "Could not get preferences service");
-        
-    return rv;
-}
-
-
-/* InitializeWindowCreator creates and hands off an object with a callback
-   to a window creation function. This will be used by Gecko C++ code
-   (never JS) to create new windows when no previous window is handy
-   to begin with. This is done in a few exceptional cases, like PSM code.
-   Failure to set this callback will only disable the ability to create
-   new windows under these circumstances. */
-nsresult CMfcEmbedApp::InitializeWindowCreator()
-{
-  // give an nsIWindowCreator to the WindowWatcher service
-  nsCOMPtr<nsIWindowCreator> windowCreator(NS_STATIC_CAST(nsIWindowCreator *, this));
-  if (windowCreator) {
-    nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
-    if (wwatch) {
-      wwatch->SetWindowCreator(windowCreator);
-      return NS_OK;
-    }
-  }
-  return NS_ERROR_FAILURE;
-}
-
-// ---------------------------------------------------------------------------
-//  CMfcEmbedApp : nsISupports
-// ---------------------------------------------------------------------------
-
-NS_IMPL_ISUPPORTS3(CMfcEmbedApp, nsIObserver, nsIWindowCreator, nsISupportsWeakReference)
-
-// ---------------------------------------------------------------------------
-//  CMfcEmbedApp : nsIObserver
-// ---------------------------------------------------------------------------
-
-// Mainly needed to support "on the fly" profile switching
-
-NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, const PRUnichar *someData)
-{
-    nsresult rv = NS_OK;
-    
-    if (strcmp(aTopic, "profile-approve-change") == 0)
-    {
-        // Ask the user if they want to
-        int result = MessageBox(NULL,
-            _T("Do you want to close all windows in order to switch the profile?"),
-            _T("Confirm"), MB_YESNO | MB_ICONQUESTION);
-        if (result != IDYES)
-        {
-            nsCOMPtr<nsIProfileChangeStatus> status = do_QueryInterface(aSubject);
-            NS_ENSURE_TRUE(status, NS_ERROR_FAILURE);
-            status->VetoChange();
-        }
-    }
-    else if (strcmp(aTopic, "profile-change-teardown") == 0)
-    {
-        // Close all open windows. Alternatively, we could just call CBrowserWindow::Stop()
-        // on each. Either way, we have to stop all network activity on this phase.
-        
-        POSITION pos = m_FrameWndLst.GetHeadPosition();
-        while( pos != NULL )
-        {
-            CBrowserFrame *pBrowserFrame = (CBrowserFrame *) m_FrameWndLst.GetNext(pos);
-            if(pBrowserFrame)
-            {
-                pBrowserFrame->ShowWindow(false);
-
-                // Passing in FALSE below so that we do not
-                // kill the main app during a profile switch
-                RemoveFrameFromList(pBrowserFrame, FALSE);
-
-                pBrowserFrame->DestroyWindow();
-            }
-        }
-    }
-    else if (strcmp(aTopic, "profile-after-change") == 0)
-    {
-        InitializePrefs(); // In case we have just switched to a newly created profile.
-        
-        // Only make a new browser window on a switch. This also gets
-        // called at start up and we already make a window then.
-        if (!wcscmp(someData, L"switch"))      
-            OnNewBrowser();
-    }
-    return rv;
-}
-
-// ---------------------------------------------------------------------------
-//  CMfcEmbedApp : nsIWindowCreator
-// ---------------------------------------------------------------------------
-NS_IMETHODIMP CMfcEmbedApp::CreateChromeWindow(nsIWebBrowserChrome *parent,
-                                               PRUint32 chromeFlags,
-                                               nsIWebBrowserChrome **_retval)
-{
-  // XXX we're ignoring the "parent" parameter
-  NS_ENSURE_ARG_POINTER(_retval);
-  *_retval = 0;
-
-  CBrowserFrame *pBrowserFrame = CreateNewBrowserFrame(chromeFlags);
-  if(pBrowserFrame) {
-    *_retval = NS_STATIC_CAST(nsIWebBrowserChrome *, pBrowserFrame->GetBrowserImpl());
-    NS_ADDREF(*_retval);
-  }
-  return NS_OK;
-}
-
-// AboutDlg Stuff
-
-class CAboutDlg : public CDialog
-{
-public:
-    CAboutDlg();
-
-    enum { IDD = IDD_ABOUTBOX };
-
-protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-
-protected:
-    DECLARE_MESSAGE_MAP()
-};
-
-CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
-{
-}
-
-void CAboutDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-}
-
-BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
-END_MESSAGE_MAP()
-
-// Show the AboutDlg
-void CMfcEmbedApp::OnAppAbout()
-{
-    CAboutDlg aboutDlg;
-    aboutDlg.DoModal();
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/MfcEmbed.h
+++ /dev/null
@@ -1,136 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// mozembed.h : main header file for the MOZEMBED application
-//
-
-#ifndef _MFCEMBED_H
-#define _MFCEMBED_H
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
-    #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h"       // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// CMfcEmbedApp:
-// See mozembed.cpp for the implementation of this class
-//
-
-class CBrowserFrame;
-class CProfileMgr;
-class nsProfileDirServiceProvider;
-
-class CMfcEmbedApp : public CWinApp,
-                     public nsIObserver,
-                     public nsIWindowCreator,
-                     public nsSupportsWeakReference
-{
-public:
-    CMfcEmbedApp();
-    
-    NS_DECL_ISUPPORTS
-    NS_DECL_NSIOBSERVER
-    NS_DECL_NSIWINDOWCREATOR
-
-    CBrowserFrame* CreateNewBrowserFrame(PRUint32 chromeMask = nsIWebBrowserChrome::CHROME_ALL, 
-                            PRInt32 x = -1, PRInt32 y = -1, 
-                            PRInt32 cx = -1, PRInt32 cy = -1, PRBool bShowWindow = PR_TRUE,
-                            PRBool bIsEditor=PR_FALSE);
-    void RemoveFrameFromList(CBrowserFrame* pFrm, BOOL bCloseAppOnLastFrame = TRUE);
-
-    void ShowDebugConsole();
-    nsresult OverrideComponents();
-
-    // Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CMfcEmbedApp)
-    public:
-    virtual BOOL InitInstance();
-    virtual int ExitInstance();
-    virtual BOOL OnIdle(LONG lCount);
-    //}}AFX_VIRTUAL
-
-    CObList m_FrameWndLst;
-
-    BOOL m_bChrome;
-    CString m_strHomePage;
-    inline BOOL GetHomePage(CString& strHomePage) {
-        strHomePage = m_strHomePage;
-        return TRUE;
-    }
-
-    int m_iStartupPage; //0 = BlankPage, 1 = HomePage
-    inline int GetStartupPageMode() {
-        return m_iStartupPage;
-    }
-
-// Implementation
-
-public:
-    //{{AFX_MSG(CMfcEmbedApp)
-    afx_msg void OnAppAbout();
-    afx_msg void OnNewBrowser();
-    afx_msg void OnNewEditor();
-    afx_msg void OnManageProfiles();
-    afx_msg void OnEditPreferences();
-        // NOTE - the ClassWizard will add and remove member functions here.
-        //    DO NOT EDIT what you see in these blocks of generated code !
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-
-private:
-    BOOL            InitializeProfiles();
-    BOOL            CreateHiddenWindow();
-    nsresult        InitializePrefs();
-    nsresult        InitializeWindowCreator();
-    
-private:
-
-#ifdef USE_PROFILES
-    CProfileMgr     *m_ProfileMgr;
-#else
-    nsProfileDirServiceProvider *m_ProfileDirServiceProvider;
-#endif
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // _MFCEMBED_H
deleted file mode 100644
--- a/embedding/tests/mfcembed/MfcEmbed.rc
+++ /dev/null
@@ -1,786 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
-    "#define _AFX_NO_OLE_RESOURCES\r\n"
-    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
-    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
-    "\r\n"
-    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
-    "#ifdef _WIN32\r\n"
-    "LANGUAGE 9, 1\r\n"
-    "#pragma code_page(1252)\r\n"
-    "#endif //_WIN32\r\n"
-    "#include ""res\\mfcembed.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
-    "#include ""afxres.rc""         // Standard components\r\n"
-    "#endif\r\n"
-    "\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Icon
-//
-
-// Icon with lowest ID value placed first to ensure application icon
-// remains consistent on all systems.
-IDR_MAINFRAME           ICON    DISCARDABLE     "res\\mfcembed.ico"
-IDR_SECURITY_LOCK       ICON    DISCARDABLE     "res\\ssecur.ico"
-IDR_SECURITY_UNLOCK     ICON    DISCARDABLE     "res\\sinsecur.ico"
-IDR_SECURITY_BROKEN     ICON    DISCARDABLE     "res\\broken.ico"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Bitmap
-//
-
-IDR_MAINFRAME           BITMAP  MOVEABLE PURE   "res\\Toolbar.bmp"
-IDR_EDITOR              BITMAP  MOVEABLE PURE   "res\\mainfram.bmp"
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Toolbar
-//
-
-IDR_MAINFRAME TOOLBAR DISCARDABLE  20, 18
-BEGIN
-    BUTTON      ID_NAV_BACK
-    BUTTON      ID_NAV_FORWARD
-    SEPARATOR
-    BUTTON      ID_NAV_RELOAD
-    BUTTON      ID_NAV_STOP
-    SEPARATOR
-    BUTTON      ID_NAV_HOME
-    SEPARATOR
-    BUTTON      ID_APP_ABOUT
-END
-
-IDR_EDITOR TOOLBAR DISCARDABLE  20, 18
-BEGIN
-    BUTTON      ID_BOLD
-    BUTTON      ID_ITALICS
-    BUTTON      ID_UNDERLINE
-    SEPARATOR
-    BUTTON      ID_INDENT
-    BUTTON      ID_OUTDENT
-    SEPARATOR
-    BUTTON      ID_FONTBLACK
-    BUTTON      ID_FONTRED
-    BUTTON      ID_BGCOLOR
-    BUTTON      ID_NOBGCOLOR
-    SEPARATOR
-    BUTTON      ID_FONTSIZEINCREASE
-    BUTTON      ID_FONTSIZEDECREASE
-    SEPARATOR
-    BUTTON      ID_ALIGNLEFT
-    BUTTON      ID_ALIGNCENTER
-    BUTTON      ID_ALIGNRIGHT
-    SEPARATOR
-    BUTTON      ID_INSERTLINK
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_MAINFRAME MENU PRELOAD DISCARDABLE 
-BEGIN
-    POPUP "&File"
-    BEGIN
-        MENUITEM "&New Browser Window\tCtrl+N", ID_NEW_BROWSER
-        MENUITEM "New &Editor Window",          ID_NEW_EDITORWINDOW
-        MENUITEM SEPARATOR
-        MENUITEM "&Open File...\tCtrl+O",       ID_FILE_OPEN
-        MENUITEM "&Save Page As...\tCtrl+S",    ID_FILE_SAVE_AS
-        MENUITEM SEPARATOR
-        MENUITEM "Page Set&up...",              ID_FILE_PRINTSETUP
-        MENUITEM "&Print...\tCtrl-P",           ID_FILE_PRINT
-        MENUITEM "Print Pre&view",              ID_FILE_PRINTPREVIEW
-        MENUITEM SEPARATOR
-        MENUITEM "E&xit",                       ID_APP_EXIT
-    END
-    POPUP "&Edit"
-    BEGIN
-        MENUITEM "Cu&t\tCtrl+X",                ID_EDIT_CUT
-        MENUITEM "&Copy\tCtrl+C",               ID_EDIT_COPY
-        MENUITEM "&Paste\tCtrl+V",              ID_EDIT_PASTE
-        MENUITEM SEPARATOR
-        MENUITEM "Select &All",                 ID_EDIT_SELECT_ALL
-        MENUITEM "Select &None",                ID_EDIT_SELECT_NONE
-        MENUITEM SEPARATOR
-        MENUITEM "&Find in This Page...\tCtrl+F", ID_EDIT_FIND
-        MENUITEM SEPARATOR
-        MENUITEM "Profiles...",                 ID_MANAGE_PROFILES
-        MENUITEM SEPARATOR
-        MENUITEM "Preferences...",              ID_EDIT_PREFERENCES
-    END
-    POPUP "&View"
-    BEGIN
-        MENUITEM "Page S&ource",                ID_VIEW_SOURCE
-        MENUITEM "Page &Info",                  ID_VIEW_INFO
-        MENUITEM SEPARATOR
-        MENUITEM "&Toolbar",                    ID_VIEW_TOOLBAR
-        MENUITEM "&Status Bar",                 ID_VIEW_STATUS_BAR
-    END
-    POPUP "&Go"
-    BEGIN
-        MENUITEM "&Back",                       ID_NAV_BACK
-        MENUITEM "&Forward",                    ID_NAV_FORWARD
-        MENUITEM "&Home",                       ID_NAV_HOME
-    END
-    POPUP "&Help"
-    BEGIN
-        MENUITEM "&About MfcEmbed...",          ID_APP_ABOUT
-    END
-END
-
-IDR_CTXMENU_DOCUMENT MENU DISCARDABLE 
-BEGIN
-    POPUP "Document Context Menu"
-    BEGIN
-        MENUITEM "&Back",                       ID_NAV_BACK
-        MENUITEM "&Forward",                    ID_NAV_FORWARD
-        MENUITEM "&Reload",                     ID_NAV_RELOAD
-        MENUITEM "&Stop",                       ID_NAV_STOP
-        MENUITEM SEPARATOR
-        MENUITEM "&View Page Source",           ID_VIEW_SOURCE
-        MENUITEM "View Page &Info",             ID_VIEW_INFO
-        MENUITEM "View Background &Image",      ID_VIEW_IMAGE
-        MENUITEM SEPARATOR
-        MENUITEM "Save &Page As...",            ID_FILE_SAVE_AS
-        MENUITEM SEPARATOR
-        MENUITEM "Select &All",                 ID_EDIT_SELECT_ALL
-        MENUITEM "Select &None",                ID_EDIT_SELECT_NONE
-        MENUITEM "&Copy",                       ID_EDIT_COPY
-        MENUITEM "&Paste",                      ID_EDIT_PASTE
-    END
-END
-
-IDR_CTXMENU_IMAGE MENU DISCARDABLE 
-BEGIN
-    POPUP "Image Context Menu"
-    BEGIN
-        MENUITEM "&Back",                       ID_NAV_BACK
-        MENUITEM "&Forward",                    ID_NAV_FORWARD
-        MENUITEM "&Reload",                     ID_NAV_RELOAD
-        MENUITEM "&Stop",                       ID_NAV_STOP
-        MENUITEM SEPARATOR
-        MENUITEM "&View Page Source",           ID_VIEW_SOURCE
-        MENUITEM "View &Image",                 ID_VIEW_IMAGE
-        MENUITEM SEPARATOR
-        MENUITEM "Save Image As...",            ID_SAVE_IMAGE_AS
-        MENUITEM "Save &Page As...",            ID_FILE_SAVE_AS
-    END
-END
-
-IDR_CTXMENU_LINK MENU DISCARDABLE 
-BEGIN
-    POPUP "Link Context Menu"
-    BEGIN
-        MENUITEM "Open Link In New Window",     ID_OPEN_LINK_IN_NEW_WINDOW
-        MENUITEM SEPARATOR
-        MENUITEM "&Back",                       ID_NAV_BACK
-        MENUITEM "&Forward",                    ID_NAV_FORWARD
-        MENUITEM "&Reload",                     ID_NAV_RELOAD
-        MENUITEM "&Stop",                       ID_NAV_STOP
-        MENUITEM SEPARATOR
-        MENUITEM "&View Page Source",           ID_VIEW_SOURCE
-        MENUITEM SEPARATOR
-        MENUITEM "View &Image",                 ID_VIEW_IMAGE
-        MENUITEM SEPARATOR
-        MENUITEM "Save &Page As...",            ID_FILE_SAVE_AS
-        MENUITEM "Save &Link As...",            ID_SAVE_LINK_AS
-        MENUITEM "&Copy Link Location",         ID_COPY_LINK_LOCATION
-    END
-END
-
-IDR_CTXMENU_TEXT MENU DISCARDABLE 
-BEGIN
-    POPUP "Selection Context Menu"
-    BEGIN
-        MENUITEM "Cu&t",                        ID_EDIT_CUT
-        MENUITEM "&Copy",                       ID_EDIT_COPY
-        MENUITEM "&Paste",                      ID_EDIT_PASTE
-        MENUITEM "Select &All",                 ID_EDIT_SELECT_ALL
-    END
-END
-
-IDR_CTXMENU_EDITOR MENU DISCARDABLE 
-BEGIN
-    POPUP "Editor Context Menu"
-    BEGIN
-        MENUITEM "Cu&t",                        ID_EDIT_CUT
-        MENUITEM "&Copy",                       ID_EDIT_COPY
-        MENUITEM "&Paste",                      ID_EDIT_PASTE
-        MENUITEM SEPARATOR
-        MENUITEM "Select &All",                 ID_EDIT_SELECT_ALL
-        MENUITEM "Select &None",                ID_EDIT_SELECT_NONE
-    END
-END
-
-IDR_EDITOR MENU PRELOAD DISCARDABLE 
-BEGIN
-    POPUP "&File"
-    BEGIN
-        MENUITEM "&New Browser Window\tCtrl+N", ID_NEW_BROWSER
-        MENUITEM "New &Editor Window",          ID_NEW_EDITORWINDOW
-        MENUITEM SEPARATOR
-        MENUITEM "&Open File...\tCtrl+O",       ID_FILE_OPEN
-        MENUITEM "&Save Page As...\tCtrl+S",    ID_FILE_SAVE_AS
-        MENUITEM SEPARATOR
-        MENUITEM "&Print...\tCtrl-P",           ID_FILE_PRINT
-        MENUITEM SEPARATOR
-        MENUITEM "E&xit\tCtrl+Q",               ID_APP_EXIT
-    END
-    POPUP "&Edit"
-    BEGIN
-        MENUITEM "Undo\tCtrl+Z",                ID_EDITOR_UNDO
-        MENUITEM "Redo\tCtrl+Shift+Z",          ID_EDITOR_REDO
-        MENUITEM SEPARATOR
-        MENUITEM "Cu&t\tCtrl+X",                ID_EDIT_CUT
-        MENUITEM "&Copy\tCtrl+C",               ID_EDIT_COPY
-        MENUITEM "&Paste\tCtrl+V",              ID_EDIT_PASTE
-        MENUITEM SEPARATOR
-        MENUITEM "Select &All",                 ID_EDIT_SELECT_ALL
-        MENUITEM "Select &None",                ID_EDIT_SELECT_NONE
-        MENUITEM SEPARATOR
-        MENUITEM "&Find in This Page...\tCtrl+F", ID_EDIT_FIND
-    END
-    POPUP "F& ormat"
-    BEGIN
-        POPUP "Font"
-        BEGIN
-            MENUITEM "Arial",                       ID_ARIAL
-            MENUITEM "Times New Roman",             ID_TIMES
-            MENUITEM "Courier",                     ID_COURIER
-        END
-    END
-    POPUP "&Help"
-    BEGIN
-        MENUITEM "&About MfcEmbed...",          ID_APP_ABOUT
-    END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Accelerator
-//
-
-IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE 
-BEGIN
-    "C",            ID_EDIT_COPY,           VIRTKEY, CONTROL, NOINVERT
-    "F",            ID_EDIT_FIND,           VIRTKEY, CONTROL, NOINVERT
-    "N",            ID_NEW_BROWSER,         VIRTKEY, CONTROL, NOINVERT
-    "O",            ID_FILE_OPEN,           VIRTKEY, CONTROL, NOINVERT
-    "S",            ID_FILE_SAVE_AS,        VIRTKEY, CONTROL, NOINVERT
-    "V",            ID_EDIT_PASTE,          VIRTKEY, CONTROL, NOINVERT
-    VK_BACK,        ID_EDIT_UNDO,           VIRTKEY, ALT, NOINVERT
-    VK_DELETE,      ID_EDIT_CUT,            VIRTKEY, SHIFT, NOINVERT
-    VK_ESCAPE,      ID_NAV_STOP,            VIRTKEY, NOINVERT
-    VK_F6,          ID_NEXT_PANE,           VIRTKEY, NOINVERT
-    VK_F6,          ID_PREV_PANE,           VIRTKEY, SHIFT, NOINVERT
-    VK_INSERT,      ID_EDIT_COPY,           VIRTKEY, CONTROL, NOINVERT
-    VK_INSERT,      ID_EDIT_PASTE,          VIRTKEY, SHIFT, NOINVERT
-    "X",            ID_EDIT_CUT,            VIRTKEY, CONTROL, NOINVERT
-    "Z",            ID_EDIT_UNDO,           VIRTKEY, CONTROL, NOINVERT
-    "Z",            ID_EDITOR_UNDO,         VIRTKEY, CONTROL, NOINVERT
-    "Z",            ID_EDIT_REDO,           VIRTKEY, SHIFT, CONTROL, 
-                                                    NOINVERT
-    "Z",            ID_EDITOR_REDO,         VIRTKEY, SHIFT, CONTROL, 
-                                                    NOINVERT
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUTBOX DIALOG DISCARDABLE  0, 0, 235, 55
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About MfcEmbed"
-FONT 8, "MS Sans Serif"
-BEGIN
-    ICON            IDR_MAINFRAME,IDC_STATIC,11,17,20,20
-    LTEXT           "Mozilla MfcEmbed Version 1.0",IDC_STATIC,40,10,119,8,
-                    SS_NOPREFIX
-    LTEXT           "Copyright (C) 2001",IDC_STATIC,40,25,119,8
-    DEFPUSHBUTTON   "OK",IDOK,178,7,50,14,WS_GROUP
-END
-
-IDD_PROFILES DIALOG DISCARDABLE  0, 0, 193, 110
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Manage Profiles"
-FONT 8, "MS Sans Serif"
-BEGIN
-    LISTBOX         IDC_LIST1,7,7,117,56,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | 
-                    WS_TABSTOP
-    PUSHBUTTON      "New...",IDC_PROF_NEW,133,7,50,14
-    PUSHBUTTON      "Rename...",IDC_PROF_RENAME,133,27,50,14
-    PUSHBUTTON      "Delete",IDC_PROF_DELETE,133,48,50,14
-    CONTROL         "Ask At Startup",IDC_CHECK_ASK_AT_START,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,7,71,61,10
-    DEFPUSHBUTTON   "OK",IDOK,77,89,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,133,89,50,14
-END
-
-IDD_PROFILE_NEW DIALOG DISCARDABLE  0, 0, 177, 79
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "New Profile"
-FONT 8, "MS Sans Serif"
-BEGIN
-    RTEXT           "Name:",IDC_STATIC,13,18,22,8
-    EDITTEXT        IDC_NEW_PROF_NAME,39,16,122,14,ES_AUTOHSCROLL
-    RTEXT           "Locale:",IDC_STATIC,11,37,24,8
-    COMBOBOX        IDC_LOCALE_COMBO,39,35,67,30,CBS_DROPDOWNLIST | CBS_SORT | 
-                    WS_DISABLED | WS_VSCROLL | WS_TABSTOP
-    DEFPUSHBUTTON   "OK",IDOK,64,58,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,120,58,50,14
-END
-
-IDD_PROFILE_RENAME DIALOG DISCARDABLE  0, 0, 177, 71
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Rename Profile"
-FONT 8, "MS Sans Serif"
-BEGIN
-    RTEXT           "New Name:",IDC_STATIC,7,18,38,8
-    EDITTEXT        IDC_NEW_NAME,50,16,113,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "OK",IDOK,60,48,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,115,48,50,14
-END
-
-IDD_FINDDLG DIALOG DISCARDABLE  30, 73, 239, 83
-STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | 
-    WS_SYSMENU
-CAPTION "Find"
-FONT 8, "MS Shell Dlg"
-BEGIN
-    LTEXT           "Fi&nd what:",-1,4,8,42,8
-    EDITTEXT        IDC_FIND_EDIT,47,7,128,12,ES_AUTOHSCROLL | WS_GROUP
-    CONTROL         "Wra&p around",IDC_WRAP_AROUND,"Button",BS_AUTOCHECKBOX | 
-                    WS_GROUP | WS_TABSTOP,47,45,65,12
-    CONTROL         "Match &case",IDC_MATCH_CASE,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,47,29,64,12
-    CONTROL         "Search &backwards",IDC_SEARCH_BACKWARDS,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,47,62,75,12
-    DEFPUSHBUTTON   "&Find Next",IDOK,182,5,50,14,WS_GROUP
-    PUSHBUTTON      "Cancel",IDCANCEL,182,23,50,14
-END
-
-IDD_PREFS_START_PAGE DIALOG DISCARDABLE  0, 0, 284, 150
-STYLE WS_CHILD | WS_DISABLED | WS_CAPTION
-CAPTION "Startup"
-FONT 8, "MS Sans Serif"
-BEGIN
-    GROUPBOX        "MfcEmbed starts with",IDC_STATIC,6,10,271,49
-    CONTROL         "Bla&nk Page",IDC_RADIO_BLANK_PAGE,"Button",
-                    BS_AUTORADIOBUTTON | WS_GROUP,16,24,53,10
-    CONTROL         "&Home Page",IDC_RADIO_HOME_PAGE,"Button",
-                    BS_AUTORADIOBUTTON,16,40,53,10
-    GROUPBOX        "Home Page",IDC_STATIC,6,67,271,51
-    LTEXT           "Clicking the Home button will take you to this page",
-                    IDC_STATIC,17,80,234,8
-    LTEXT           "Loc&ation:",IDC_STATIC,17,98,31,8
-    EDITTEXT        IDC_EDIT_HOMEPAGE,53,95,211,14,ES_AUTOHSCROLL
-END
-
-IDD_PRINTSETUP_DIALOG DIALOG DISCARDABLE  0, 0, 328, 175
-STYLE DS_SYSMODAL | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Page Setup"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,7,154,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,271,154,50,14
-    CONTROL         "Tab1",IDC_PRINTSETUP_TAB_CTRL,"SysTabControl32",0x0,7,7,
-                    314,125
-END
-
-IDD_HEADERFOOTER_TAB DIALOG DISCARDABLE  0, 0, 319, 106
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Margins && Headers/Footers"
-FONT 8, "MS Sans Serif"
-BEGIN
-    GROUPBOX        "Headers && Footers",IDC_STATIC,7,38,229,56
-    RTEXT           "Left",IDC_STATIC,30,65,13,8
-    RTEXT           "Center",IDC_STATIC,104,65,22,8
-    RTEXT           "Right",IDC_STATIC,187,65,18,8
-    EDITTEXT        IDC_TOP_MARGIN_TXT,39,15,40,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_LEFT_MARGIN_TXT,112,15,40,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_BOTTOM_MARGIN_TXT,185,15,40,14,ES_AUTOHSCROLL
-    EDITTEXT        IDC_RIGHT_MARGIN_TXT,258,15,40,14,ES_AUTOHSCROLL
-    GROUPBOX        "Margins",IDC_STATIC,7,7,302,26
-    LTEXT           "Left:",IDC_STATIC,95,17,15,8
-    LTEXT           "Top:",IDC_STATIC,22,17,16,8
-    LTEXT           "Right:",IDC_STATIC,236,17,20,8
-    LTEXT           "Bottom:",IDC_STATIC,158,17,25,8
-    COMBOBOX        IDC_FTR_LEFT_CMBX,13,76,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FTR_CENTER_CMBX,92,76,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_FTR_RIGHT_CMBX,171,76,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_HDR_LEFT_CMBX,13,49,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_HDR_CENTER_CMBX,92,50,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_HDR_RIGHT_CMBX,171,50,57,70,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_TABSTOP
-END
-
-IDD_FORMAT_OPTIONS_TAB DIALOG DISCARDABLE  0, 0, 321, 126
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Format && Options"
-FONT 8, "MS Sans Serif"
-BEGIN
-    CONTROL         "&Portait",IDC_PRT_PORTRAIT_RD,"Button",
-                    BS_AUTORADIOBUTTON | WS_GROUP,14,16,36,10
-    CONTROL         "&Landscape",IDC_PRT_LANDSCAPE_RD,"Button",
-                    BS_AUTORADIOBUTTON,56,16,51,10
-    COMBOBOX        IDC_PAPER_SIZE_CBX,26,40,81,67,CBS_DROPDOWNLIST | 
-                    WS_VSCROLL | WS_GROUP | WS_TABSTOP
-    EDITTEXT        IDC_UD_PAPER_WDTH,33,57,40,14,ES_AUTOHSCROLL | 
-                    WS_DISABLED
-    EDITTEXT        IDC_UD_PAPER_HGT,106,57,40,14,ES_AUTOHSCROLL | 
-                    WS_DISABLED
-    CONTROL         "Inches",IDC_INCHES_RD,"Button",BS_AUTORADIOBUTTON | 
-                    WS_DISABLED | WS_GROUP,13,76,37,10
-    CONTROL         "Millimeters",IDC_MILLI_RD,"Button",BS_AUTORADIOBUTTON | 
-                    WS_DISABLED,53,76,48,10
-    CONTROL         "Slider1",IDC_SCALE,"msctls_trackbar32",TBS_AUTOTICKS | 
-                    TBS_BOTH | WS_TABSTOP,163,42,100,19
-    EDITTEXT        IDC_SCALE_TXT,264,47,19,14,ES_AUTOHSCROLL
-    CONTROL         "Print Background C&olors",IDC_PRT_BGCOLORS,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,10,100,92,10
-    CONTROL         "Print Background &Images",IDC_PRT_BGIMAGES,"Button",
-                    BS_AUTOCHECKBOX | WS_TABSTOP,124,100,95,10
-    GROUPBOX        "Scaling",IDC_STATIC,161,31,148,34
-    LTEXT           "Size:",IDC_STATIC,10,41,16,8
-    GROUPBOX        "Format",IDC_STATIC,7,31,147,57
-    LTEXT           "Width:",IDC_UD_WIDTH_LBL,10,60,22,8,WS_DISABLED
-    LTEXT           "Height:",IDC_UD_HEIGHT_LBL,81,60,24,8,WS_DISABLED
-    GROUPBOX        "Options",IDC_STATIC,7,90,213,25
-    GROUPBOX        "Orientation",IDC_STATIC,7,7,104,22
-END
-
-IDD_CUSTOM_PROMPT_DIALOG DIALOG DISCARDABLE  0, 0, 232, 49
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Custom"
-FONT 8, "MS Sans Serif"
-BEGIN
-    EDITTEXT        IDC_PROMPT_TEXT,35,7,135,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "OK",IDOK,175,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,175,24,50,14
-    LTEXT           "Custom:",IDC_STATIC,7,8,26,8
-END
-
-IDD_DIALOG_LINK_PROPERTIES DIALOG DISCARDABLE  0, 0, 262, 162
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Link Properties"
-FONT 8, "MS Sans Serif"
-BEGIN
-    GROUPBOX        " Link Text ",IDC_STATIC,7,7,248,52
-    GROUPBOX        " Link Location ",IDC_STATIC,7,73,248,52
-    LTEXT           "Enter &text to display for the link:",IDC_STATIC,16,20,
-                    223,8
-    EDITTEXT        IDC_EDIT_LINK_TEXT,16,34,232,14,ES_AUTOHSCROLL
-    LTEXT           "Enter a web page &location:",IDC_STATIC,16,88,223,8
-    EDITTEXT        IDC_EDIT_LINK_LOCATION,16,103,232,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "OK",IDOK,69,140,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,128,140,50,14
-END
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x1L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904B0"
-        BEGIN
-            VALUE "CompanyName", "\0"
-            VALUE "FileDescription", "MfcEmbed MFC Application\0"
-            VALUE "FileVersion", "1, 0, 0, 1\0"
-            VALUE "InternalName", "MfcEmbed\0"
-            VALUE "LegalCopyright", "Copyright (C) 2001\0"
-            VALUE "LegalTrademarks", "\0"
-            VALUE "OriginalFilename", "MfcEmbed.EXE\0"
-            VALUE "ProductName", "MfcEmbed Application\0"
-            VALUE "ProductVersion", "1, 0, 0, 1\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    IDD_ABOUTBOX, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 228
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 48
-    END
-
-    IDD_PROFILES, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 189
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 88
-    END
-
-    IDD_PROFILE_NEW, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 170
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 72
-    END
-
-    IDD_PROFILE_RENAME, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 170
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 69
-    END
-
-    IDD_PRINTSETUP_DIALOG, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 321
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 168
-    END
-
-    IDD_HEADERFOOTER_TAB, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 312
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 99
-    END
-
-    IDD_FORMAT_OPTIONS_TAB, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 314
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 119
-    END
-
-    IDD_CUSTOM_PROMPT_DIALOG, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 225
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 42
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
-
-STRINGTABLE PRELOAD DISCARDABLE 
-BEGIN
-    IDR_MAINFRAME           "mfcembed"
-END
-
-STRINGTABLE PRELOAD DISCARDABLE 
-BEGIN
-    IDS_NOSECURITY_INFO     "This page has no security information or was not encrypted.\nThis means it was possible for other people to view this page when it was loaded."
-    IDS_ENCRYPTION_HIGH_GRADE "High-grade Encryption (%1% %2!d! bit)"
-    IDS_ENCRYPTION_LOW_GRADE "Low-grade Encryption (%1% %2!d! bit)"
-    IDS_ENCRYPTION_NONE     "Connection Not Encrypted"
-    IDS_SRCH_STR_NOT_FOUND  "The text you entered was not found"
-    IDS_VIEW_FRAME_SOURCE   "View Frame Source"
-    IDS_OPEN_FRAME_IN_NEW_WINDOW "Open Frame in New Window"
-END
-
-STRINGTABLE PRELOAD DISCARDABLE 
-BEGIN
-    AFX_IDS_APP_TITLE       "mfcembed"
-    AFX_IDS_IDLEMESSAGE     "Ready"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_APP_ABOUT            "Display program information, version number and copyright\nAbout"
-    ID_APP_EXIT             "Quit the application; prompts to save documents\nExit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_NEXT_PANE            "Switch to the next window pane\nNext Pane"
-    ID_PREV_PANE            "Switch back to the previous window pane\nPrevious Pane"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_WINDOW_SPLIT         "Split the active window into panes\nSplit"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_EDIT_CLEAR           "Erase the selection\nErase"
-    ID_EDIT_CLEAR_ALL       "Erase everything\nErase All"
-    ID_EDIT_COPY            "Copy the selection and put it on the Clipboard\nCopy"
-    ID_EDIT_CUT             "Cut the selection and put it on the Clipboard\nCut"
-    ID_EDIT_FIND            "Find the specified text\nFind"
-    ID_EDIT_PASTE           "Insert Clipboard contents\nPaste"
-    ID_EDIT_REPEAT          "Repeat the last action\nRepeat"
-    ID_EDIT_REPLACE         "Replace specific text with different text\nReplace"
-    ID_EDIT_SELECT_ALL      "Select the entire document\nSelect All"
-    ID_EDIT_UNDO            "Undo the last action\nUndo"
-    ID_EDIT_REDO            "Redo the previously undone action\nRedo"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_VIEW_TOOLBAR         "Show or hide the toolbar\nToggle ToolBar"
-    ID_VIEW_STATUS_BAR      "Show or hide the status bar\nToggle StatusBar"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    AFX_IDS_SCSIZE          "Change the window size"
-    AFX_IDS_SCMOVE          "Change the window position"
-    AFX_IDS_SCMINIMIZE      "Reduce the window to an icon"
-    AFX_IDS_SCMAXIMIZE      "Enlarge the window to full size"
-    AFX_IDS_SCNEXTWINDOW    "Switch to the next document window"
-    AFX_IDS_SCPREVWINDOW    "Switch to the previous document window"
-    AFX_IDS_SCCLOSE         "Close the active window and prompts to save the documents"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    AFX_IDS_SCRESTORE       "Restore the window to normal size"
-    AFX_IDS_SCTASKLIST      "Activate Task List"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_EDIT_SELECT_NONE     "Select nothing in the document\nSelect None"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_FILE_PRINTPREVIEW    "Print Preview"
-    ID_FILE_PRINTSETUP      "Page Setup Dialog"
-END
-
-STRINGTABLE DISCARDABLE 
-BEGIN
-    ID_ARIAL                "Arial"
-    ID_TIMES                "Times New Roman"
-END
-
-STRINGTABLE DISCARDABLE
-BEGIN
-    IDS_PROFILES_FOLDER_NAME "MfcEmbed"
-    IDS_PROFILES_NONSHARED_NAME "Browser"
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif //_WIN32
-#include "res\mfcembed.rc2"  // non-Microsoft Visual C++ edited resources
-#include "afxres.rc"         // Standard components
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/MostRecentUrls.cpp
+++ /dev/null
@@ -1,147 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-//
-// CMostRecentUrls object is responsible for keeping track of the
-// 16 most recently used URLs. It stores this list in a file named
-// "urls.txt" on a per profile basis in the user's profile directory
-//
-// The constructor loads the URL list
-// The destructor saves the URL list
-//
-
-#include "StdAfx.h"
-#include "nsIFile.h"
-#include "nsILocalFile.h"
-#include "nsServiceManagerUtils.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsDirectoryServiceUtils.h"
-#include "MostRecentUrls.h"
-
-//--------------------------------------------------------
-//-- CMostRecentUrls
-//--------------------------------------------------------
-CMostRecentUrls::CMostRecentUrls() :
-        mNumURLs(0)
-{
-    for (int i=0;i<MAX_URLS;i++) {
-        mURLs[i] = NULL;
-    }
-
-    FILE * fd = GetFD("r");
-    if (fd) {
-        char line[512];
-        while (fgets(line, 512, fd)) {
-            if (strlen(line) > 1) {
-                line[strlen(line)-1] = 0;
-                mURLs[mNumURLs++] = _strdup(line);
-            }
-        }
-        fclose(fd);
-    }
-
-}
-
-FILE * CMostRecentUrls::GetFD(const char * aMode) 
-{
-    FILE * fd = nsnull;
-    nsCOMPtr<nsIFile> file;
-    nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-    if (NS_SUCCEEDED(rv)) {
-        nsCOMPtr<nsILocalFile> local_file(do_QueryInterface(file));
-        local_file->AppendNative(nsEmbedCString("urls.txt"));
-        local_file->OpenANSIFileDesc(aMode, &fd);
-    }
-
-    return fd;
-}
-
-CMostRecentUrls::~CMostRecentUrls() 
-{
-    FILE * fd = GetFD("w");
-    if (fd) {
-        for (int i=0;i<MAX_URLS;i++) {
-            if(mURLs[i])
-                fprintf(fd, "%s\n", mURLs[i]);
-        }
-    fclose(fd);
-    }
-
-    for (int i=0;i<MAX_URLS;i++) {
-        if(mURLs[i])
-          free(mURLs[i]);
-    }
-}
-
-char * CMostRecentUrls::GetURL(int aInx)
-{
-    if (aInx < mNumURLs) {
-        return mURLs[aInx];
-    }
-
-    return NULL;
-}
-
-void CMostRecentUrls::AddURL(const char * aURL)
-{
-    char szTemp[512];
-    strncpy(szTemp, aURL, sizeof(szTemp));
-    szTemp[sizeof(szTemp) - 1] = '\0';
-
-    // check to see if an existing url matches the one passed in
-    int i = 0;
-    for (; i<MAX_URLS-1; i++)
-    {
-        if(mURLs[i])
-        {
-            if(strcmpi(mURLs[i], szTemp) == 0)
-                break; 
-        }
-    }
-
-    // if there was a match "i" will point to matching url entry
-    // if not i will be MAX_URLS-1
-
-    // move all url entries before this one down
-    for (; i>0; i--)
-    {
-        if(mURLs[i])
-          free(mURLs[i]);
-
-        if(mURLs[i-1])  
-            mURLs[i] = _strdup(mURLs[i-1]);
-    }
-
-    // place this url at the top
-    if(mURLs[0])
-        free(mURLs[0]);
-    mURLs[0] = _strdup(szTemp);
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/MostRecentUrls.h
+++ /dev/null
@@ -1,49 +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):
- *   Rod Spears <rods@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-class CMostRecentUrls {
-public:
-    enum _maxUrls {
-        MAX_URLS = 16
-    };
-
-    CMostRecentUrls();
-    virtual ~CMostRecentUrls();
-
-    char * GetURL(int aInx);
-    void AddURL(const char * aURL);
-    inline int GetNumURLs() { return mNumURLs; }
-    FILE * CMostRecentUrls::GetFD(const char * aMode);
-
-protected:
-    char * mURLs[MAX_URLS];
-    int    mNumURLs;
-};
deleted file mode 100644
--- a/embedding/tests/mfcembed/Preferences.cpp
+++ /dev/null
@@ -1,107 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#include "stdafx.h"
-#include "Preferences.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////
-// CPreferences
-
-IMPLEMENT_DYNAMIC(CPreferences, CPropertySheet)
-
-CPreferences::CPreferences(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
-    :CPropertySheet(pszCaption, pParentWnd, iSelectPage)
-{
-    AddPage(&m_startupPage);
-}
-
-CPreferences::~CPreferences()
-{
-}
-
-BEGIN_MESSAGE_MAP(CPreferences, CPropertySheet)
-    //{{AFX_MSG_MAP(CPreferences)
-        // NOTE - the ClassWizard will add and remove mapping macros here.
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-BOOL CPreferences::OnInitDialog() 
-{
-    BOOL bResult = CPropertySheet::OnInitDialog();
-    
-    // Hide the Apply button
-    CWnd* pApplyButton = GetDlgItem(ID_APPLY_NOW);
-    ASSERT(pApplyButton);
-    pApplyButton->ShowWindow(SW_HIDE);
-
-    return bResult;
-}
-
-
-/////////////////////////////////////////////////////////////////
-// CStartupPrefsPage property page
-
-IMPLEMENT_DYNCREATE(CStartupPrefsPage, CPropertyPage)
-
-CStartupPrefsPage::CStartupPrefsPage() : CPropertyPage(CStartupPrefsPage::IDD)
-{
-    //{{AFX_DATA_INIT(CStartupPrefsPage)
-    m_strHomePage = _T("");
-    m_iStartupPage = -1;
-    //}}AFX_DATA_INIT
-}
-
-CStartupPrefsPage::~CStartupPrefsPage()
-{
-}
-
-void CStartupPrefsPage::DoDataExchange(CDataExchange* pDX)
-{
-    CPropertyPage::DoDataExchange(pDX);
-    //{{AFX_DATA_MAP(CStartupPrefsPage)
-    DDX_Control(pDX, IDC_EDIT_HOMEPAGE, m_HomePage);
-    DDX_Text(pDX, IDC_EDIT_HOMEPAGE, m_strHomePage);
-    DDX_Radio(pDX, IDC_RADIO_BLANK_PAGE, m_iStartupPage);
-    //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CStartupPrefsPage, CPropertyPage)
-    //{{AFX_MSG_MAP(CStartupPrefsPage)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
deleted file mode 100644
--- a/embedding/tests/mfcembed/Preferences.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** 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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-
-#ifndef _PREFERENCES_H_
-#define _PREFERENCES_H_
-
-#include "resource.h"
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-/////////////////////////////////////////////////////////////////////////////
-// CStartupPrefsPage dialog
-
-class CStartupPrefsPage : public CPropertyPage
-{
-    DECLARE_DYNCREATE(CStartupPrefsPage)
-
-// Construction
-public:
-    CStartupPrefsPage();
-    ~CStartupPrefsPage();
-
-// Dialog Data
-    //{{AFX_DATA(CStartupPrefsPage)
-    enum { IDD = IDD_PREFS_START_PAGE };
-    CEdit    m_HomePage;
-    CString    m_strHomePage;
-    int        m_iStartupPage;
-    //}}AFX_DATA
-
-
-// Overrides
-    // ClassWizard generate virtual function overrides
-    //{{AFX_VIRTUAL(CStartupPrefsPage)
-    protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-    //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-    // Generated message map functions
-    //{{AFX_MSG(CStartupPrefsPage)
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CPreferences
-
-class CPreferences : public CPropertySheet
-{
-    DECLARE_DYNAMIC(CPreferences)
-
-// Construction
-public:
-    CPreferences(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
-
-// Attributes
-public:
-    CStartupPrefsPage m_startupPage;
-
-// Operations
-public:
-
-// Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CPreferences)
-    public:
-    virtual BOOL OnInitDialog();
-    //}}AFX_VIRTUAL
-
-// Implementation
-public:
-    virtual ~CPreferences();
-
-    // Generated message map functions
-protected:
-    //{{AFX_MSG(CPreferences)
-        // NOTE - the ClassWizard will add and remove member functions here.
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // _PREFERENCES_H_
deleted file mode 100644
--- a/embedding/tests/mfcembed/ProfileMgr.cpp
+++ /dev/null
@@ -1,203 +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):
- *   Conrad Carlen <ccarlen@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// Local Includes
-#include "stdafx.h"
-#include "mfcembed.h"
-#include "ProfileMgr.h"
-#include "ProfilesDlg.h"
-
-// Mozilla Includes
-#include "nsEmbedString.h"
-#include "nsIRegistry.h"
-#include "nsIProfile.h"
-#include "nsServiceManagerUtils.h"
-#include "nsComponentManagerUtils.h"
-#include "nsCOMPtr.h"
-#include "nsMemory.h"
-
-// Constants
-#define kRegistryGlobalPrefsSubtreeString (nsEmbedString(L"global-prefs"))
-#define kRegistryShowProfilesAtStartup "start-show-dialog"
-
-//*****************************************************************************
-//***    CProfileMgr: Object Management
-//*****************************************************************************
-
-CProfileMgr::CProfileMgr()
-{
-}
-
-CProfileMgr::~CProfileMgr()
-{
-}
-
-
-//*****************************************************************************
-//***    CProfileMgr: Public Methods
-//*****************************************************************************
-    
-nsresult CProfileMgr::StartUp()
-{
-    nsresult rv;
-         
-    nsCOMPtr<nsIProfile> profileService = 
-             do_GetService(NS_PROFILE_CONTRACTID, &rv);
-    if (NS_FAILED(rv)) return rv;
-        
-    PRInt32 profileCount;
-    rv = profileService->GetProfileCount(&profileCount);
-    if (NS_FAILED(rv)) return rv;
-    if (profileCount == 0)
-    {
-        // Make a new default profile
-        nsEmbedString newProfileName(L"default");
-
-        rv = profileService->CreateNewProfile(newProfileName.get(), nsnull, nsnull, PR_FALSE);
-        if (NS_FAILED(rv)) return rv;
-        rv = profileService->SetCurrentProfile(newProfileName.get());
-        if (NS_FAILED(rv)) return rv;
-    }
-    else
-    {
-        // Use our flag here to check for whether to show profile mgr UI. If the flag
-        // says don't show it, just start with the last used profile.
-        
-        PRBool showIt;
-        rv = GetShowDialogOnStart(&showIt);
-                        
-        if (NS_FAILED(rv) || (profileCount > 1 && showIt))
-        {
-            DoManageProfilesDialog(TRUE);
-        }
-        else
-        {
-            // GetCurrentProfile returns the profile which was last used but is not nescesarily
-            // active. Call SetCurrentProfile to make it installed and active.
-            
-            PRUnichar *currProfileName = nsnull;
-            rv = profileService->GetCurrentProfile(&currProfileName);
-            if (NS_FAILED(rv)) return rv;
-            rv = profileService->SetCurrentProfile(currProfileName);
-            nsMemory::Free(currProfileName);
-            if (NS_FAILED(rv)) return rv;
-        }    
-    }
-
-    return NS_OK;
-}
-
-nsresult CProfileMgr::DoManageProfilesDialog(PRBool bAtStartUp)
-{
-    CProfilesDlg    dialog;
-    nsresult        rv;
-    PRBool          showIt;
-
-    rv = GetShowDialogOnStart(&showIt);
-    dialog.m_bAtStartUp = bAtStartUp;
-    dialog.m_bAskAtStartUp = NS_SUCCEEDED(rv) ? showIt : TRUE;
-
-    if (dialog.DoModal() == IDOK)
-    {
-        SetShowDialogOnStart(dialog.m_bAskAtStartUp);
-         
-        nsCOMPtr<nsIProfile> profileService = 
-                 do_GetService(NS_PROFILE_CONTRACTID, &rv);
-        if (NS_SUCCEEDED(rv))
-               rv = profileService->SetCurrentProfile(dialog.m_SelectedProfile.get());
-    }
-    return NS_OK;
-}
-    
- 
-//*****************************************************************************
-//***    CProfileMgr: Protected Methods
-//*****************************************************************************
-     
-nsresult CProfileMgr::GetShowDialogOnStart(PRBool* showIt)
-{
-    nsresult rv = NS_OK;
-        
-    *showIt = PR_TRUE;
-                
-    nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
-    rv = registry->OpenWellKnownRegistry(nsIRegistry::ApplicationRegistry);
-    if (NS_FAILED(rv)) return rv;
-
-    nsRegistryKey profilesTreeKey;
-    
-    rv = registry->GetKey(nsIRegistry::Common, 
-                          kRegistryGlobalPrefsSubtreeString.get(), 
-                          &profilesTreeKey);
-
-    if (NS_SUCCEEDED(rv)) 
-    {
-        PRInt32 flagValue;
-        rv = registry->GetInt(profilesTreeKey, 
-                              kRegistryShowProfilesAtStartup, 
-                              &flagValue);
-         
-        if (NS_SUCCEEDED(rv))
-            *showIt = (flagValue != 0);
-    }
-    return rv;        
-}
-
-nsresult CProfileMgr::SetShowDialogOnStart(PRBool showIt)
-{
-    nsresult rv = NS_OK;
-                        
-    nsCOMPtr<nsIRegistry> registry(do_CreateInstance(NS_REGISTRY_CONTRACTID, &rv));
-    rv = registry->OpenWellKnownRegistry(nsIRegistry::ApplicationRegistry);
-    if (NS_FAILED(rv)) return rv;
-
-    nsRegistryKey profilesTreeKey;
-    
-    rv = registry->GetKey(nsIRegistry::Common, 
-                          kRegistryGlobalPrefsSubtreeString.get(), 
-                          &profilesTreeKey);
-
-    if (NS_FAILED(rv)) 
-    {
-        rv = registry->AddKey(nsIRegistry::Common, 
-                              kRegistryGlobalPrefsSubtreeString.get(), 
-                              &profilesTreeKey);
-    }
-    if (NS_SUCCEEDED(rv))
-    {
-    
-        rv = registry->SetInt(profilesTreeKey, 
-                              kRegistryShowProfilesAtStartup, 
-                              showIt);
-    }
-    
-    return rv;        
-}
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/ProfileMgr.h
+++ /dev/null
@@ -1,63 +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):
- *   Conrad Carlen <ccarlen@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-#ifndef __ProfileMgr__
-#define __ProfileMgr__
-
-// Mozilla Includes
-#include "nsError.h"
- 
-// Forward Declarations
-class nsIRegistry;
-
-//*****************************************************************************
-//***    CProfileMgr
-//*****************************************************************************
-
-class CProfileMgr
-{
-  public:
-                        CProfileMgr();
-    virtual             ~CProfileMgr();
-    
-    virtual nsresult    StartUp();
-    virtual nsresult    DoManageProfilesDialog(PRBool bAtStartUp);
-        // If bAtStartUp is TRUE, a profile must be selected.
-    
-  protected:
-      
-    nsresult            GetShowDialogOnStart(PRBool* showIt);
-    nsresult            SetShowDialogOnStart(PRBool showIt);
-};
-
-
-
-
-#endif
deleted file mode 100644
--- a/embedding/tests/mfcembed/ProfilesDlg.cpp
+++ /dev/null
@@ -1,333 +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 ***** */
-
-// ProfilesDlg.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include <afxpriv.h>
-#include "mfcembed.h"
-#include "ProfilesDlg.h"
-
-// Mozilla
-#include "nsIProfile.h"
-#include "nsIServiceManager.h"
-#include "nsServiceManagerUtils.h"
-#include "nsMemory.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-// Static Routines
-static void ValidateProfileName(const CString& profileName, CDataExchange* pDX)
-{
-    USES_CONVERSION;
-
-    nsresult rv;
-    PRBool exists = FALSE;
-
-    {
-        nsCOMPtr<nsIProfile> profileService = 
-                 do_GetService(NS_PROFILE_CONTRACTID, &rv);
-        rv = profileService->ProfileExists(T2CW(profileName), &exists);
-    }
-
-    if (NS_SUCCEEDED(rv) && exists)
-    {
-        CString errMsg;
-        errMsg.Format(_T("Error: A profile named \"%s\" already exists."), profileName);
-        AfxMessageBox( errMsg, MB_ICONEXCLAMATION );
-        errMsg.Empty();
-        pDX->Fail();
-    }
-
-    if (profileName.FindOneOf(_T("\\/")) != -1)
-    {
-        AfxMessageBox( _T("Error: A profile name cannot contain the characters \"\\\" or \"/\"."), MB_ICONEXCLAMATION );
-        pDX->Fail();
-    }
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// CNewProfileDlg dialog
-
-
-CNewProfileDlg::CNewProfileDlg(CWnd* pParent /*=NULL*/)
-    : CDialog(CNewProfileDlg::IDD, pParent)
-{
-    //{{AFX_DATA_INIT(CNewProfileDlg)
-    m_LocaleIndex = -1;
-    m_Name = _T("");
-    //}}AFX_DATA_INIT
-}
-
-
-void CNewProfileDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-    //{{AFX_DATA_MAP(CNewProfileDlg)
-    DDX_CBIndex(pDX, IDC_LOCALE_COMBO, m_LocaleIndex);
-    DDX_Text(pDX, IDC_NEW_PROF_NAME, m_Name);
-    //}}AFX_DATA_MAP
-
-    pDX->PrepareEditCtrl(IDC_NEW_PROF_NAME);
-    if (pDX->m_bSaveAndValidate)
-    {
-        ValidateProfileName(m_Name, pDX);
-    }
-}
-
-
-BEGIN_MESSAGE_MAP(CNewProfileDlg, CDialog)
-    //{{AFX_MSG_MAP(CNewProfileDlg)
-        // NOTE: the ClassWizard will add message map macros here
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CNewProfileDlg message handlers
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CRenameProfileDlg dialog
-
-
-CRenameProfileDlg::CRenameProfileDlg(CWnd* pParent /*=NULL*/)
-    : CDialog(CRenameProfileDlg::IDD, pParent)
-{
-    //{{AFX_DATA_INIT(CRenameProfileDlg)
-    m_NewName = _T("");
-    //}}AFX_DATA_INIT
-}
-
-
-void CRenameProfileDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-    //{{AFX_DATA_MAP(CRenameProfileDlg)
-    DDX_Text(pDX, IDC_NEW_NAME, m_NewName);
-    //}}AFX_DATA_MAP
-
-    pDX->PrepareEditCtrl(IDC_NEW_NAME);
-    if (pDX->m_bSaveAndValidate)
-    {
-        ValidateProfileName(m_NewName, pDX);
-    }
-}
-
-
-BEGIN_MESSAGE_MAP(CRenameProfileDlg, CDialog)
-    //{{AFX_MSG_MAP(CRenameProfileDlg)
-        // NOTE: the ClassWizard will add message map macros here
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CRenameProfileDlg message handlers
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CProfilesDlg dialog
-
-
-CProfilesDlg::CProfilesDlg(CWnd* pParent /*=NULL*/)
-    : CDialog(CProfilesDlg::IDD, pParent)
-{
-    //{{AFX_DATA_INIT(CProfilesDlg)
-    m_bAtStartUp = FALSE;
-    m_bAskAtStartUp = FALSE;
-    //}}AFX_DATA_INIT
-}
-
-
-void CProfilesDlg::DoDataExchange(CDataExchange* pDX)
-{
-    CDialog::DoDataExchange(pDX);
-    //{{AFX_DATA_MAP(CProfilesDlg)
-    DDX_Control(pDX, IDC_LIST1, m_ProfileList);
-    DDX_Check(pDX, IDC_CHECK_ASK_AT_START, m_bAskAtStartUp);
-    //}}AFX_DATA_MAP
-
-    if (pDX->m_bSaveAndValidate)
-    {
-        USES_CONVERSION;
-
-        int itemIndex = m_ProfileList.GetCurSel();
-        if (itemIndex != LB_ERR)
-        {
-            CString itemText;
-            m_ProfileList.GetText(itemIndex, itemText);
-            m_SelectedProfile.Assign(T2CW(itemText));
-        }
-    }
-}
-
-
-BEGIN_MESSAGE_MAP(CProfilesDlg, CDialog)
-    //{{AFX_MSG_MAP(CProfilesDlg)
-    ON_BN_CLICKED(IDC_PROF_NEW, OnNewProfile)
-    ON_BN_CLICKED(IDC_PROF_RENAME, OnRenameProfile)
-    ON_BN_CLICKED(IDC_PROF_DELETE, OnDeleteProfile)
-    ON_LBN_DBLCLK(IDC_LIST1, OnDblclkProfile)
-    //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CProfilesDlg message handlers
-
-BOOL CProfilesDlg::OnInitDialog() 
-{
-    USES_CONVERSION;
-
-    CDialog::OnInitDialog();
-    
-    PRUnichar *curProfileName = nsnull;
-
-    // Fill the list of profiles
-    nsresult rv;
-    nsCOMPtr<nsIProfile> profileService = 
-             do_GetService(NS_PROFILE_CONTRACTID, &rv);
-    profileService->GetCurrentProfile(&curProfileName);
-
-    PRInt32     selectedRow = 0;
-    PRUint32    listLen;
-    PRUnichar   **profileList;
-    rv = profileService->GetProfileList(&listLen, &profileList);
-
-    for (PRUint32 index = 0; index < listLen; index++)
-    {
-        CString tmpStr(W2T(profileList[index]));
-        m_ProfileList.AddString(tmpStr);
-        if (wcscmp(profileList[index], curProfileName) == 0)
-            selectedRow = index;
-    }
-    nsMemory::Free(curProfileName);
-
-    m_ProfileList.SetCurSel(selectedRow);
-
-    if (m_bAtStartUp)
-    {
-        GetDlgItem(IDCANCEL)->EnableWindow(FALSE);
-    }
-    
-    return TRUE;  // return TRUE unless you set the focus to a control
-                  // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CProfilesDlg::OnNewProfile() 
-{
-    CNewProfileDlg dialog;
-
-    if (dialog.DoModal() == IDOK)
-    {
-        nsresult rv;
-
-        nsCOMPtr<nsIProfile> profileService = 
-                 do_GetService(NS_PROFILE_CONTRACTID, &rv);
-        ASSERT(NS_SUCCEEDED(rv));
-        if (NS_SUCCEEDED(rv))
-        {
-            USES_CONVERSION;
-
-            rv = profileService->CreateNewProfile(T2CW(dialog.m_Name), nsnull, nsnull, PR_FALSE);
-            ASSERT(NS_SUCCEEDED(rv));
-            if (NS_SUCCEEDED(rv))
-            {
-                int item = m_ProfileList.AddString(dialog.m_Name);
-                m_ProfileList.SetCurSel(item);
-                GetDlgItem(IDOK)->EnableWindow(TRUE);
-            }
-        }
-    }
-}
-
-void CProfilesDlg::OnRenameProfile() 
-{
-    CRenameProfileDlg dialog;
-
-    int itemIndex = m_ProfileList.GetCurSel();
-    ASSERT(itemIndex != LB_ERR);
-    if (itemIndex == LB_ERR)
-        return;
-
-    m_ProfileList.GetText(itemIndex, dialog.m_CurrentName);
-
-    if (dialog.DoModal() == IDOK)
-    {
-        USES_CONVERSION;
-
-        nsresult rv;
-
-        nsCOMPtr<nsIProfile> profileService = 
-                 do_GetService(NS_PROFILE_CONTRACTID, &rv);
-        ASSERT(NS_SUCCEEDED(rv));
-        if (NS_SUCCEEDED(rv))
-        {
-            rv = profileService->RenameProfile(T2CW(dialog.m_CurrentName), T2CW(dialog.m_NewName));
-            ASSERT(NS_SUCCEEDED(rv));
-        }
-    }    
-}
-
-void CProfilesDlg::OnDeleteProfile() 
-{
-    int itemIndex = m_ProfileList.GetCurSel();
-    ASSERT(itemIndex != LB_ERR);
-    if (itemIndex == LB_ERR)
-        return;
-
-    CString selectedProfile;
-    m_ProfileList.GetText(itemIndex, selectedProfile);
-    
-    nsresult rv;
-    nsCOMPtr<nsIProfile> profileService = 
-             do_GetService(NS_PROFILE_CONTRACTID, &rv);
-    ASSERT(NS_SUCCEEDED(rv));
-    if (NS_SUCCEEDED(rv))
-    {
-        USES_CONVERSION;
-
-        rv = profileService->DeleteProfile(T2CW(selectedProfile), PR_TRUE);
-        ASSERT(NS_SUCCEEDED(rv));
-        if (NS_SUCCEEDED(rv))
-        {
-            int itemCount = m_ProfileList.DeleteString(itemIndex);
-            if (itemCount == 0)
-                GetDlgItem(IDOK)->EnableWindow(FALSE);
-        }
-    }    
-}
-
-void CProfilesDlg::OnDblclkProfile() 
-{
-    OnOK();
-}
deleted file mode 100644
--- a/embedding/tests/mfcembed/ProfilesDlg.h
+++ /dev/null
@@ -1,150 +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 ***** */
-
-#if !defined(AFX_PROFILESDLG_H__48358887_EBFA_11D4_9905_00B0D0235410__INCLUDED_)
-#define AFX_PROFILESDLG_H__48358887_EBFA_11D4_9905_00B0D0235410__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-// ProfilesDlg.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CNewProfileDlg dialog
-
-class CNewProfileDlg : public CDialog
-{
-// Construction
-public:
-    CNewProfileDlg(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-    //{{AFX_DATA(CNewProfileDlg)
-    enum { IDD = IDD_PROFILE_NEW };
-    int        m_LocaleIndex;
-    CString    m_Name;
-    //}}AFX_DATA
-
-
-// Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CNewProfileDlg)
-    protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-    //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-    // Generated message map functions
-    //{{AFX_MSG(CNewProfileDlg)
-        // NOTE: the ClassWizard will add member functions here
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CRenameProfileDlg dialog
-
-class CRenameProfileDlg : public CDialog
-{
-// Construction
-public:
-    CRenameProfileDlg(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-    //{{AFX_DATA(CRenameProfileDlg)
-    enum { IDD = IDD_PROFILE_RENAME };
-    CString    m_NewName;
-    //}}AFX_DATA
-
-    CString     m_CurrentName;
-
-// Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CRenameProfileDlg)
-    protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-    //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-    // Generated message map functions
-    //{{AFX_MSG(CRenameProfileDlg)
-        // NOTE: the ClassWizard will add member functions here
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CProfilesDlg dialog
-
-class CProfilesDlg : public CDialog
-{
-// Construction
-public:
-    CProfilesDlg(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-    //{{AFX_DATA(CProfilesDlg)
-    enum { IDD = IDD_PROFILES };
-    CListBox    m_ProfileList;
-    BOOL        m_bAtStartUp;
-    BOOL        m_bAskAtStartUp;
-    //}}AFX_DATA
-
-    nsEmbedString m_SelectedProfile;
-
-// Overrides
-    // ClassWizard generated virtual function overrides
-    //{{AFX_VIRTUAL(CProfilesDlg)
-    protected:
-    virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-    //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-    // Generated message map functions
-    //{{AFX_MSG(CProfilesDlg)
-    virtual BOOL OnInitDialog();
-    afx_msg void OnNewProfile();
-    afx_msg void OnRenameProfile();
-    afx_msg void OnDeleteProfile();
-    afx_msg void OnDblclkProfile();
-    //}}AFX_MSG
-    DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_PROFILESDLG_H__48358887_EBFA_11D4_9905_00B0D0235410__INCLUDED_)
deleted file mode 100644
--- a/embedding/tests/mfcembed/README.TXT
+++ /dev/null
@@ -1,151 +0,0 @@
-***** BEGIN LICENSE BLOCK *****
-Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
-The contents of this file are subject to the Mozilla Public License Version 
-1.1 (the "License"); you may not use this file except in compliance with 
-the License. You may obtain a copy of the License at 
-http://www.mozilla.org/MPL/
-
-Software distributed under the License is distributed on an "AS IS" basis,
-WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-for the specific language governing rights and limitations under the
-License.
-
-The Original Code is mozilla.org code.
-
-The Initial Developer of the Original Code is
-Netscape Communications Corporation.
-Portions created by the Initial Developer are Copyright (C) 2___
-the Initial Developer. All Rights Reserved.
-
-Contributor(s):
-        Chak Nanga <chak@netscape.com> 
-
-Alternatively, the contents of this file may be used under the terms of
-either the GNU General Public License Version 2 or later (the "GPL"), or
-the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-in which case the provisions of the GPL or the LGPL are applicable instead
-of those above. If you wish to allow use of your version of this file only
-under the terms of either the GPL or the LGPL, and not to allow others to
-use your version of this file under the terms of the MPL, indicate your
-decision by deleting the provisions above and replace them with the notice
-and other provisions required by the GPL or the LGPL. If you do not delete
-the provisions above, a recipient may use your version of this file under
-the terms of any one of the MPL, the GPL or the LGPL.
-
-***** END LICENSE BLOCK *****
-
-This sample shows how to embed Mozilla from within 
-an MFC Windows application
-
-Mainly demonstrates the use of the following interfaces:
-
-	nsIWebBrowserChrome
-	nsIEmbeddingSiteWindow
-	nsIWebProgressListener
-	nsIContextMenuListener
-	nsIPrompt
-	nsIWebBrowserFind
-	
-General Overview:
------------------
-
-1. The MfcEmbedApp creates BrowserFrames
-
-2. BrowserFrame creates the toolbar, statusbar, URLbar 
-   BrowserView etc.
-   BrowserFrames implement the IBrowserFrameGlue interface
-   using which new BrowserFrames can be created, statusbar
-   updated etc. 
-
-3. BrowserView creates the embeddable browser instance and
-   manages user interaction such as URL navigation etc.
-   BrowserView connects the BrowserImpl with the BrowserFrame
-   via the IBrowserFrameGlue interface
-
-4. BrowserImpl implements the set of required/optional Gecko
-   embedding interfaces
-   
-
-Start by first looking at MfcEmbed.cpp
-
-Files:
-
-StdAfx.h	 
-	- Includes the required Mozilla header files
-
-MfcEmbed.cpp 
-	- CWinApp derived class
-	- Creates the browser's main frame window etc
-	  using the CreateNewBrowserFrame() and loads
-	  the HomePage
-	- Makes the required NS_InitEmbedding() and the
-	  NS_TermEmbedding() calls in the app's InitInstance()
-	  and ExitInstance() functions
-	- Keeps track of the list of new BrowserFrames created
-	  which it cleans up properly in ExitInstance()
-
-BrowserFrm.cpp 
-	- This is the browser's Frame window i.e. the one with the
-	  "chrome" - with the toolbar, urlbar etc.
-	- Creates the toolbar, URLbar, statusbar, progressbar 
-	  also the browser's view window. 
-
-BrowserFrameGlue.cpp
-	- Implements the IBrowserFrameGlue interface. This interface
-	  contains platform specific implementations of functions to
-	  update the statusbar, creating new browser frames etc. Embedded
-	  browser's callbacks use this interface when needed
-
-BrowserView.cpp 
-	- Creates the embedded browser object and handles most aspects
-	of the embedded browser interactions - like URL navigation,
-	clipboard interactions etc
-	- Also has code to keep the menu/toolbar/statusbar UI items up 
-	to date
-	- It's the view which conntects the BrowserFrame to the BrowserImpl
-	  (see below) by passing it the pointer to IBrowserFrameGlue
-
-BrowserImpl*.cpp 
-	- Implements the required and/or optional embedded browser 
-	interfaces
-	(BrowserImpl.cpp implements the set of interfaces which 
-	are required by Gecko of all embedding apps. The other
-	interfaces implemented in the BrowserImpl*.cpp files are 
-	optional)
-
-	- Calls on the statusbar/progressbar update functions exposed
-	via the IBrowserFrameGlue in response to the nsIProgressListener
-	interface callbacks
-
-Dialogs.cpp
-	- Contains dialog box code for displaying Prompts, getting
-	passwords, getting username/passwords etc
-	- Contains the CFindDialog class - used for searching text
-	in a web page
-
-winEmbedFileLocProvider.cpp, ProfilesDlg.cpp, ProfileMgr.cpp
-	- Profile management related code (by Conrad Carlen)
-
-MfcEmbed.htm
-	- This is a simple test harness for excercising some of the
-	implemented interfaces . For ex, the nsIWebBrowserChrome.
-	- Open the file in mfcemed by typing the following in it's
-	location bar. For ex: 
-
-			file:///c:/tmp/mfcembed.htm
-	- Read/Click on the links on that page more info
-	- This test page is just a start and will add more test
-	case to it over time
-
- 
-makefile.win
-	- We define "_AFXDLL" and for the compiler and specify
-	"-SUBSYSTEM:windows" for the linker using LCFLAGS and 
-	LLFLAGS, respectively
-	- We also define "USE_SINGLE_SIGN_ON" to enable the
-	single sign-on support
-
-mfcembed.dsp and mfcembed.dsw
-	- These VisualStudio workspace/project files can be used
-	to open/build this sample inside of the VC++ IDE
deleted file mode 100644
--- a/embedding/tests/mfcembed/StdAfx.cpp
+++ /dev/null
@@ -1,39 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// stdafx.cpp : source file that includes just the standard includes
-//	mozembed.pch will be the pre-compiled header
-//	stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
deleted file mode 100644
--- a/embedding/tests/mfcembed/StdAfx.h
+++ /dev/null
@@ -1,133 +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):
- *   Chak Nanga <chak@netscape.com>
- *
- * ***** END LICENSE BLOCK ***** */
-
-// stdafx.h : include file for standard system include files,
-//  or project specific include files that are used frequently, but
-//      are changed infrequently
-//
-
-#ifndef _STDAFX_H
-#define _STDAFX_H
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN        // Exclude rarely-used stuff from Windows headers
-
-//
-// These headers are very evil, as they will define DEBUG if _DEBUG is
-//  defined, which is lame and not what we want for things like
-//  MOZ_TRACE