Renamed m_nReadyState as m_nBrowserReadyState

Added fix to get_LocationURL, courtesy of Ryota Ando <rando@ca2.so-net.ne.jp>
This commit is contained in:
locka%iol.ie 1999-01-18 23:04:25 +00:00
Родитель 8ed649fbb9
Коммит 031c3bb8a4
2 изменённых файлов: 33 добавлений и 24 удалений

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* *
* The contents of this file are subject to the Netscape Public License * The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in * Version 1.0 (the "NPL"); you may not use this file except in
@ -53,7 +53,7 @@ CMozillaBrowser::CMozillaBrowser()
#endif #endif
// Ready state of control // Ready state of control
m_nReadyState = READYSTATE_UNINITIALIZED; m_nBrowserReadyState = READYSTATE_UNINITIALIZED;
// Create the container that handles some things for us // Create the container that handles some things for us
m_pWebShellContainer = NULL; m_pWebShellContainer = NULL;
@ -64,26 +64,26 @@ CMozillaBrowser::CMozillaBrowser()
// Register components // Register components
NS_SetupRegistry(); NS_SetupRegistry();
// Create the Event Queue for the UI thread... // Create the Event Queue for the UI thread...
// //
// If an event queue already exists for the thread, then // If an event queue already exists for the thread, then
// CreateThreadEventQueue(...) will fail... // CreateThreadEventQueue(...) will fail...
nsresult rv; nsresult rv;
nsIEventQueueService* eventQService = NULL; nsIEventQueueService* eventQService = NULL;
rv = nsServiceManager::GetService(kEventQueueServiceCID, rv = nsServiceManager::GetService(kEventQueueServiceCID,
kIEventQueueServiceIID, kIEventQueueServiceIID,
(nsISupports **)&eventQService); (nsISupports **)&eventQService);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
rv = eventQService->CreateThreadEventQueue(); rv = eventQService->CreateThreadEventQueue();
nsServiceManager::ReleaseService(kEventQueueServiceCID, eventQService); nsServiceManager::ReleaseService(kEventQueueServiceCID, eventQService);
} }
} }
CMozillaBrowser::~CMozillaBrowser() CMozillaBrowser::~CMozillaBrowser()
{ {
// XXX: Do not call DestroyThreadEventQueue(...) for now... // XXX: Do not call DestroyThreadEventQueue(...) for now...
NG_TRACE(_T("CMozillaBrowser::~CMozillaBrowser\n")); NG_TRACE(_T("CMozillaBrowser::~CMozillaBrowser\n"));
} }
@ -114,7 +114,7 @@ LRESULT CMozillaBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
CreateWebShell(); CreateWebShell();
// Control is ready // Control is ready
m_nReadyState = READYSTATE_LOADED; m_nBrowserReadyState = READYSTATE_LOADED;
// Browse to a default page // Browse to a default page
USES_CONVERSION; USES_CONVERSION;
@ -176,8 +176,6 @@ LRESULT CMozillaBrowser::OnPageSetup(WORD wNotifyCode, WORD wID, HWND hWndCtl, B
LRESULT CMozillaBrowser::OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) LRESULT CMozillaBrowser::OnPrint(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{ {
// TODO show a print dialog
// Print the contents // Print the contents
if (m_pIWebShell) if (m_pIWebShell)
{ {
@ -1032,7 +1030,9 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationURL(BSTR __RPC_FAR *Locat
// Get the url from the web shell // Get the url from the web shell
PRUnichar *pszUrl = nsnull; PRUnichar *pszUrl = nsnull;
m_pIWebShell->GetURL(0, &pszUrl); PRInt32 aHistoryIndex;
m_pIWebShell->GetHistoryIndex(aHistoryIndex);
m_pIWebShell->GetURL(aHistoryIndex, &pszUrl);
if (pszUrl == nsnull) if (pszUrl == nsnull)
{ {
return E_FAIL; return E_FAIL;
@ -1555,7 +1555,7 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_ReadyState(READYSTATE __RPC_FAR *
return E_INVALIDARG; return E_INVALIDARG;
} }
*plReadyState = m_nReadyState; *plReadyState = m_nBrowserReadyState;
return S_OK; return S_OK;
} }
@ -1683,7 +1683,16 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_TheaterMode(VARIANT_BOOL __RPC_FA
return E_UNEXPECTED; return E_UNEXPECTED;
} }
return E_NOTIMPL; if (pbRegister == NULL)
{
NG_ASSERT(0);
return E_INVALIDARG;
}
// No theatermode!
*pbRegister = VARIANT_FALSE;
return S_OK;
} }
@ -1697,7 +1706,7 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_TheaterMode(VARIANT_BOOL bRegiste
return E_UNEXPECTED; return E_UNEXPECTED;
} }
return E_NOTIMPL; return S_OK;
} }

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

@ -179,7 +179,7 @@ protected:
PropertyList m_PropertyList; PropertyList m_PropertyList;
// Ready status of control // Ready status of control
READYSTATE m_nReadyState; READYSTATE m_nBrowserReadyState;
virtual HRESULT CreateWebShell(); virtual HRESULT CreateWebShell();
virtual BOOL IsValid(); virtual BOOL IsValid();