r/a=valeski@netscape.com

nsDocShellTreeOwner not handling chrome/content correctly.
Asserts when no toplevel window set.
Need to start chrome up from NS_InitEmbedding()
Test App changes.
This commit is contained in:
dougt%netscape.com 2000-07-04 21:53:27 +00:00
Родитель 8b33bb5fa6
Коммит 8cc0076ed5
8 изменённых файлов: 170 добавлений и 109 удалений

Просмотреть файл

@ -24,6 +24,7 @@
#include "nsIServiceManager.h"
#include "nsIEventQueueService.h"
#include "nsIChromeRegistry.h"
#include "nsIStringBundle.h"
@ -160,7 +161,17 @@ nsresult NS_InitEmbedding(nsILocalFile *aPath)
}
#endif
return NS_OK;
// Init the chrome registry.
nsCOMPtr <nsIChromeRegistry> chromeReg = do_GetService("component://netscape/chrome/chrome-registry");
NS_ASSERTION(chromeReg, "chrome check couldn't get the chrome registry");
if (!chromeReg)
return NS_ERROR_FAILURE;
return chromeReg->CheckForNewChrome();
}

Просмотреть файл

@ -42,6 +42,7 @@
nsDocShellTreeOwner::nsDocShellTreeOwner() : mWebBrowser(nsnull),
mTreeOwner(nsnull),
mPrimaryContentShell(nsnull),
mWebBrowserChrome(nsnull),
mOwnerProgressListener(nsnull),
mOwnerWin(nsnull),
@ -121,12 +122,15 @@ NS_IMETHODIMP nsDocShellTreeOwner::FindItemWithName(const PRUnichar* aName,
return NS_OK;
}
NS_IMETHODIMP nsDocShellTreeOwner::ContentShellAdded(nsIDocShellTreeItem* aContentShell,
PRBool aPrimary, const PRUnichar* aID)
{
if(mTreeOwner)
return mTreeOwner->ContentShellAdded(aContentShell, aPrimary, aID);
if (aPrimary)
mPrimaryContentShell = aContentShell;
return NS_OK;
}
@ -134,7 +138,10 @@ NS_IMETHODIMP nsDocShellTreeOwner::GetPrimaryContentShell(nsIDocShellTreeItem**
{
NS_ENSURE_ARG_POINTER(aShell);
*aShell = mWebBrowser->mDocShellAsItem;
if (mTreeOwner)
return mTreeOwner->GetPrimaryContentShell(aShell);
*aShell = (mPrimaryContentShell ? mPrimaryContentShell : mWebBrowser->mDocShellAsItem.get());
NS_IF_ADDREF(*aShell);
return NS_OK;
@ -229,7 +236,8 @@ NS_IMETHODIMP nsDocShellTreeOwner::GetNewWindow(PRInt32 aChromeFlags,
NS_IMETHODIMP nsDocShellTreeOwner::InitWindow(nativeWindow aParentNativeWindow,
nsIWidget* aParentWidget, PRInt32 aX, PRInt32 aY, PRInt32 aCX, PRInt32 aCY)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->InitWindow(aParentNativeWindow, aParentWidget, aX, aY,
aCX, aCY);
@ -237,42 +245,48 @@ NS_IMETHODIMP nsDocShellTreeOwner::InitWindow(nativeWindow aParentNativeWindow,
NS_IMETHODIMP nsDocShellTreeOwner::Create()
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->Create();
}
NS_IMETHODIMP nsDocShellTreeOwner::Destroy()
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->Destroy();
}
NS_IMETHODIMP nsDocShellTreeOwner::SetPosition(PRInt32 aX, PRInt32 aY)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetPosition(aX, aY);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetPosition(PRInt32* aX, PRInt32* aY)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetPosition(aX, aY);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetSize(PRInt32 aCX, PRInt32 aCY, PRBool aRepaint)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetSize(aCX, aCY, aRepaint);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetSize(PRInt32* aCX, PRInt32* aCY)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetSize(aCX, aCY);
}
@ -280,7 +294,8 @@ NS_IMETHODIMP nsDocShellTreeOwner::GetSize(PRInt32* aCX, PRInt32* aCY)
NS_IMETHODIMP nsDocShellTreeOwner::SetPositionAndSize(PRInt32 aX, PRInt32 aY,
PRInt32 aCX, PRInt32 aCY, PRBool aRepaint)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetPositionAndSize(aX, aY, aCX, aCY, aRepaint);
}
@ -288,70 +303,80 @@ NS_IMETHODIMP nsDocShellTreeOwner::SetPositionAndSize(PRInt32 aX, PRInt32 aY,
NS_IMETHODIMP nsDocShellTreeOwner::GetPositionAndSize(PRInt32* aX, PRInt32* aY,
PRInt32* aCX, PRInt32* aCY)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetPositionAndSize(aX, aY, aCX, aCY);
}
NS_IMETHODIMP nsDocShellTreeOwner::Repaint(PRBool aForce)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->Repaint(aForce);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetParentWidget(nsIWidget** aParentWidget)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetParentWidget(aParentWidget);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetParentWidget(nsIWidget* aParentWidget)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetParentWidget(aParentWidget);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetParentNativeWindow(nativeWindow* aParentNativeWindow)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetParentNativeWindow(aParentNativeWindow);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetParentNativeWindow(nativeWindow aParentNativeWindow)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetParentNativeWindow(aParentNativeWindow);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetVisibility(PRBool* aVisibility)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetVisibility(aVisibility);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetVisibility(PRBool aVisibility)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetVisibility(aVisibility);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetMainWidget(nsIWidget** aMainWidget)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetMainWidget(aMainWidget);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetFocus()
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetFocus();
}
@ -359,21 +384,24 @@ NS_IMETHODIMP nsDocShellTreeOwner::SetFocus()
NS_IMETHODIMP nsDocShellTreeOwner::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool* aTookFocus)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->FocusAvailable(aCurrentFocus, aTookFocus);
}
NS_IMETHODIMP nsDocShellTreeOwner::GetTitle(PRUnichar** aTitle)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->GetTitle(aTitle);
}
NS_IMETHODIMP nsDocShellTreeOwner::SetTitle(const PRUnichar* aTitle)
{
NS_ENSURE_STATE(mOwnerWin);
if (!mOwnerWin)
return NS_ERROR_NULL_POINTER;
return mOwnerWin->SetTitle(aTitle);
}

Просмотреть файл

@ -65,6 +65,8 @@ protected:
// Weak References
nsWebBrowser* mWebBrowser;
nsIDocShellTreeOwner* mTreeOwner;
nsIDocShellTreeItem* mPrimaryContentShell;
nsIWebBrowserChrome* mWebBrowserChrome;
nsIWebProgressListener* mOwnerProgressListener;
nsIBaseWindow* mOwnerWin;

Просмотреть файл

@ -46,9 +46,9 @@ static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
nsWebBrowser::nsWebBrowser() : mDocShellTreeOwner(nsnull),
mContentListener(nsnull), mInitInfo(nsnull), mParentNativeWindow(nsnull),
mParentWidget(nsnull), mParent(nsnull)
mParentWidget(nsnull), mParent(nsnull), mContentType(typeContentWrapper)
{
NS_INIT_REFCNT();
NS_INIT_REFCNT();
mInitInfo = new nsWebBrowserInitInfo();
}
@ -88,15 +88,15 @@ NS_IMPL_ADDREF(nsWebBrowser)
NS_IMPL_RELEASE(nsWebBrowser)
NS_INTERFACE_MAP_BEGIN(nsWebBrowser)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowser)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowser)
NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
NS_INTERFACE_MAP_ENTRY(nsIWebProgress)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIScrollable)
NS_INTERFACE_MAP_ENTRY(nsITextScroll)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowser)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowser)
NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
NS_INTERFACE_MAP_ENTRY(nsIWebProgress)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIScrollable)
NS_INTERFACE_MAP_ENTRY(nsITextScroll)
NS_INTERFACE_MAP_ENTRY(nsIDocShellTreeItem)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_END
///*****************************************************************************
@ -225,14 +225,15 @@ NS_IMETHODIMP nsWebBrowser::GetItemType(PRInt32* aItemType)
{
NS_ENSURE_ARG_POINTER(aItemType);
*aItemType = typeContentWrapper;
*aItemType = mContentType;
return NS_OK;
}
NS_IMETHODIMP nsWebBrowser::SetItemType(PRInt32 aItemType)
{
NS_ERROR("Can't call that on this");
return NS_ERROR_FAILURE;
NS_ENSURE_TRUE((aItemType == typeContentWrapper || aItemType == typeChromeWrapper), NS_ERROR_FAILURE);
mContentType = aItemType;
return NS_OK;
}
NS_IMETHODIMP nsWebBrowser::GetParent(nsIDocShellTreeItem** aParent)
@ -466,7 +467,7 @@ nsWebBrowser::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult)
{
// XXX Not yet implemented
return NS_OK;
return NS_OK;
}
@ -591,7 +592,14 @@ NS_IMETHODIMP nsWebBrowser::Create()
mInitInfo->cy), NS_ERROR_FAILURE);
mDocShellAsItem->SetName(mInitInfo->name.GetUnicode());
mDocShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent);
if (mContentType == typeChromeWrapper)
{
mDocShellAsItem->SetItemType(nsIDocShellTreeItem::typeChrome);
}
else
{
mDocShellAsItem->SetItemType(nsIDocShellTreeItem::typeContent);
}
mDocShellAsItem->SetTreeOwner(mDocShellTreeOwner);
mDocShell->SetParentURIContentListener(mContentListener);
@ -997,44 +1005,49 @@ NS_IMETHODIMP nsWebBrowser::ScrollByPages(PRInt32 aNumPages)
NS_IMETHODIMP nsWebBrowser::SetDocShell(nsIDocShell* aDocShell)
{
if(aDocShell)
{
NS_ENSURE_TRUE(!mDocShell, NS_ERROR_FAILURE);
if(aDocShell)
{
NS_ENSURE_TRUE(!mDocShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(aDocShell));
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(aDocShell));
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aDocShell));
nsCOMPtr<nsIWebNavigation> nav(do_QueryInterface(aDocShell));
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(aDocShell));
nsCOMPtr<nsIScrollable> scrollable(do_QueryInterface(aDocShell));
nsCOMPtr<nsITextScroll> textScroll(do_QueryInterface(aDocShell));
NS_ENSURE_TRUE(req && baseWin && item && nav && scrollable && textScroll &&
progress, NS_ERROR_FAILURE);
mDocShell = aDocShell;
mDocShellAsReq = req;
mDocShellAsWin = baseWin;
mDocShellAsItem = item;
mDocShellAsNav = nav;
mDocShellAsProgress = progress;
mDocShellAsScrollable = scrollable;
mDocShellAsTextScroll = textScroll;
AddProgressListener(NS_STATIC_CAST(nsIWebProgressListener *, mDocShellTreeOwner));
}
else
{
if (mDocShell)
{
RemoveProgressListener(NS_STATIC_CAST(nsIWebProgressListener *, mDocShellTreeOwner));
mDocShellAsWin->Destroy();
}
mDocShell = nsnull;
mDocShellAsReq = nsnull;
mDocShellAsWin = nsnull;
mDocShellAsItem = nsnull;
mDocShellAsNav = nsnull;
mDocShellAsProgress = nsnull;
mDocShellAsScrollable = nsnull;
mDocShellAsTextScroll = nsnull;
}
nsCOMPtr<nsIInterfaceRequestor> req(do_QueryInterface(aDocShell));
nsCOMPtr<nsIBaseWindow> baseWin(do_QueryInterface(aDocShell));
nsCOMPtr<nsIDocShellTreeItem> item(do_QueryInterface(aDocShell));
nsCOMPtr<nsIWebNavigation> nav(do_QueryInterface(aDocShell));
nsCOMPtr<nsIWebProgress> progress(do_GetInterface(aDocShell));
nsCOMPtr<nsIScrollable> scrollable(do_QueryInterface(aDocShell));
nsCOMPtr<nsITextScroll> textScroll(do_QueryInterface(aDocShell));
NS_ENSURE_TRUE(req && baseWin && item && nav && scrollable && textScroll &&
progress, NS_ERROR_FAILURE);
mDocShell = aDocShell;
mDocShellAsReq = req;
mDocShellAsWin = baseWin;
mDocShellAsItem = item;
mDocShellAsNav = nav;
mDocShellAsProgress = progress;
mDocShellAsScrollable = scrollable;
mDocShellAsTextScroll = textScroll;
}
else
{
if(mDocShell)
mDocShellAsWin->Destroy();
mDocShell = nsnull;
mDocShellAsReq = nsnull;
mDocShellAsWin = nsnull;
mDocShellAsItem = nsnull;
mDocShellAsNav = nsnull;
mDocShellAsProgress = nsnull;
mDocShellAsScrollable = nsnull;
mDocShellAsTextScroll = nsnull;
}
return NS_OK;
return NS_OK;
}
NS_IMETHODIMP nsWebBrowser::EnsureDocShellTreeOwner()

Просмотреть файл

@ -106,6 +106,7 @@ protected:
nsCOMPtr<nsITextScroll> mDocShellAsTextScroll;
nsCOMPtr<nsIWidget> mInternalWidget;
nsWebBrowserInitInfo* mInitInfo;
PRUint32 mContentType;
nativeWindow mParentNativeWindow;
//Weak Reference interfaces...

Просмотреть файл

@ -41,6 +41,8 @@
#include "nsIScriptGlobalObject.h"
#include "nsIInterfaceRequestor.h"
#include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeOwner.h"
nsresult
ConvertDocShellToDOMWindow(nsIDocShell* aDocShell, nsIDOMWindow** aDOMWindow)
@ -73,34 +75,39 @@ WebBrowser::~WebBrowser()
}
nsresult
WebBrowser::Init(nsNativeWidget widget)
WebBrowser::Init(nsNativeWidget widget, nsIWebBrowserChrome* aTopWindow)
{
nsresult rv;
mWebBrowser = do_CreateInstance(NS_WEBBROWSER_PROGID, &rv);
if (NS_FAILED(rv))
return rv;
if (!mWebBrowser)
return NS_ERROR_FAILURE;
mBaseWindow = do_QueryInterface(mWebBrowser);
mTopWindow = aTopWindow;
mWebBrowser->SetTopLevelWindow(aTopWindow);
nsCOMPtr<nsIDocShellTreeItem> dsti = do_QueryInterface(mWebBrowser);
dsti->SetItemType(nsIDocShellTreeItem::typeChromeWrapper);
rv = mBaseWindow->InitWindow( widget,
nsnull,
0,
0,
100,
100);
mWebBrowser->SetTopLevelWindow(nsnull);
mBaseWindow->Create();
mBaseWindow->SetVisibility(PR_TRUE);
return rv;
}
nsresult
WebBrowser::GetIWebBrowser(nsIWebBrowser **outBrowser)
WebBrowser::GetWebBrowser(nsIWebBrowser **outBrowser)
{
*outBrowser = mWebBrowser;
NS_IF_ADDREF(*outBrowser);

Просмотреть файл

@ -29,24 +29,26 @@
#include "nsIBaseWindow.h"
#include "nsIWebBrowser.h"
#include "nsIEditorShell.h"
#include "nsIWebBrowserChrome.h"
class WebBrowser
{
public:
nsresult Init(nsNativeWidget widget);
nsresult Init(nsNativeWidget widget, nsIWebBrowserChrome* aTopWindow);
nsresult SetPositionAndSize(int x, int y, int cx, int cy);
nsresult GoTo(char* url);
nsresult Edit(char* url);
nsresult Print(void);
nsresult GetIWebBrowser(nsIWebBrowser **outBrowser);
nsresult GetWebBrowser(nsIWebBrowser **outBrowser);
WebBrowser();
virtual ~WebBrowser();
protected:
nsCOMPtr<nsIWebBrowser> mWebBrowser;
nsCOMPtr<nsIBaseWindow> mBaseWindow;
nsCOMPtr<nsIWebBrowserChrome> mTopWindow;
//for editing
nsCOMPtr<nsIEditorShell> mEditor;
};

Просмотреть файл

@ -29,17 +29,19 @@
#include "nsEmbedAPI.h"
#include "WebBrowser.h"
#include "WebBrowserChrome.h"
nsresult CreateWebBrowser(WebBrowser **outBrowser);
WebBrowser* CreateWebBrowser();
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title bar text
TCHAR szWindowClass[MAX_LOADSTRING]; // The title bar text
HINSTANCE hInst;
TCHAR szTitle[MAX_LOADSTRING];
TCHAR szWindowClass[MAX_LOADSTRING];
// Foward declarations of functions included in this code module:
ATOM MyRegisterClass(HINSTANCE hInstance);
@ -52,7 +54,7 @@ char gLastURI[100];
int main ()
{
printf("\nYour embedded, man!\n\n");
printf("\nYou are embedded, man!\n\n");
MSG msg;
HINSTANCE hInstance = GetModuleHandle(NULL);
@ -67,8 +69,7 @@ int main ()
// put up at lease on browser window ....
/////////////////////////////////////////////////////////////
WebBrowser* newBrowser;
CreateWebBrowser(&newBrowser);
WebBrowser* newBrowser = CreateWebBrowser();
if (!newBrowser)
return -1;
newBrowser->GoTo("http://people.netscape.com/dougt");
@ -126,7 +127,7 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
nsresult CreateWebBrowser(WebBrowser **outBrowser)
WebBrowser * CreateWebBrowser()
{
STARTUPINFO StartupInfo;
@ -139,7 +140,7 @@ nsresult CreateWebBrowser(WebBrowser **outBrowser)
WebBrowser *browser = new WebBrowser();
if (! browser)
return NS_ERROR_FAILURE;
return NULL;
HWND hWnd;
@ -157,16 +158,16 @@ nsresult CreateWebBrowser(WebBrowser **outBrowser)
if (!hWnd)
{
return NS_ERROR_FAILURE;
return NULL;
}
SetWindowLong( hWnd, GWL_USERDATA, (LONG)browser); // save the browser LONG_PTR.
WebBrowserChrome* chrome = nsnull;//new WebBrowserChrome();
if ( NS_FAILED( browser->Init(hWnd) ) ) // this will own hWnd
return NS_ERROR_FAILURE;
if ( NS_FAILED( browser->Init(hWnd, chrome) ) ) // this will own hWnd
return NULL;
RECT rect;
GetClientRect(hWnd, &rect);
rect.top += 32;
@ -176,9 +177,7 @@ nsresult CreateWebBrowser(WebBrowser **outBrowser)
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
*outBrowser = browser;
return NS_OK;
return browser;
}
//
@ -218,8 +217,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
gLastURI[0] = 0;
if (DialogBox(hInst, (LPCTSTR)MOZ_GetURI, hWnd, (DLGPROC)GetURI))
{
WebBrowser* newBrowser;
CreateWebBrowser(&newBrowser);
WebBrowser* newBrowser = CreateWebBrowser();
if (!newBrowser)
break;
newBrowser->GoTo(gLastURI);
@ -230,8 +228,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
gLastURI[0] = 0;
if (DialogBox(hInst, (LPCTSTR)MOZ_GetURI, hWnd, (DLGPROC)GetURI))
{
WebBrowser* newBrowser;
CreateWebBrowser(&newBrowser);
WebBrowser* newBrowser = CreateWebBrowser();
if (!newBrowser)
break;
newBrowser->Edit(gLastURI);