CreateContentViewer() and NewContentViewer() no longer take the uri loading command as a parameter since they don't use it. InternalLoad now takes a window target parameter. DoURILoad now takes the uriloader command and a window target.

This commit is contained in:
tbogard%aol.net 2000-04-04 00:04:04 +00:00
Родитель 77e5d29db7
Коммит e9faf678e6
3 изменённых файлов: 36 добавлений и 51 удалений

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

@ -96,7 +96,7 @@ NS_IMETHODIMP nsDSURIContentListener::DoContent(const char* aContentType,
mDocShell->OnLoadingSite(aOpenedChannel);
NS_ENSURE_SUCCESS(mDocShell->CreateContentViewer(aContentType, aCommand,
NS_ENSURE_SUCCESS(mDocShell->CreateContentViewer(aContentType,
aOpenedChannel, aContentHandler), NS_ERROR_FAILURE);
if(loadAttribs & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)

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

@ -56,17 +56,6 @@
#include "nsIConsoleService.h"
#include "nsIScriptError.h"
#ifdef XXX_NS_DEBUG // XXX: we'll need a logging facility for debugging
#define WEB_TRACE(_bit,_args) \
PR_BEGIN_MACRO \
if (WEB_LOG_TEST(gLogModule,_bit)) { \
PR_LogPrint _args; \
} \
PR_END_MACRO
#else
#define WEB_TRACE(_bit,_args)
#endif
static NS_DEFINE_IID(kDeviceContextCID, NS_DEVICE_CONTEXT_CID);
//*****************************************************************************
@ -211,7 +200,7 @@ NS_IMETHODIMP nsDocShell::LoadURI(nsIURI* aURI, nsIDocShellLoadInfo* aLoadInfo)
}
NS_ENSURE_SUCCESS(InternalLoad(aURI, referrer, nsnull,
NS_ENSURE_SUCCESS(InternalLoad(aURI, referrer, nsnull, nsnull,
replace ? loadNormalReplace : loadNormal), NS_ERROR_FAILURE);
return NS_OK;
@ -1007,23 +996,13 @@ NS_IMETHODIMP nsDocShell::GoForward()
NS_IMETHODIMP nsDocShell::LoadURI(const PRUnichar* aURI)
{
//XXXTAB Implement
NS_ERROR("Not Yet Implemeted");
return NS_ERROR_FAILURE;
nsCOMPtr<nsIURI> uri;
// CreateFixupURI(aURI, getter_AddRefs(uri));
CreateFixupURI(aURI, getter_AddRefs(uri));
NS_ENSURE_TRUE(uri, NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(LoadURI(uri, nsnull), NS_ERROR_FAILURE);
return NS_OK;
// Mangle URL
// If anchor goto Anchor
// Stop Current Loads
// URI Load
//XXX First Checkin
NS_ERROR("Not Yet Implemented");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocShell::Reload(PRInt32 aReloadType)
@ -1034,8 +1013,8 @@ NS_IMETHODIMP nsDocShell::Reload(PRInt32 aReloadType)
// XXXTAB Convert reload type to our type
loadType type = loadReloadNormal;
NS_ENSURE_SUCCESS(InternalLoad(mCurrentURI, mReferrerURI, nsnull, type),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(InternalLoad(mCurrentURI, mReferrerURI, nsnull, nsnull,
type), NS_ERROR_FAILURE);
return NS_OK;
}
@ -2064,8 +2043,7 @@ NS_IMETHODIMP nsDocShell::CreateAboutBlankContentViewer()
}
NS_IMETHODIMP nsDocShell::CreateContentViewer(const char* aContentType,
nsURILoadCommand aCommand, nsIChannel* aOpenedChannel,
nsIStreamListener** aContentHandler)
nsIChannel* aOpenedChannel, nsIStreamListener** aContentHandler)
{
// Can we check the content type of the current content viewer
// and reuse it without destroying it and re-creating it?
@ -2075,8 +2053,8 @@ NS_IMETHODIMP nsDocShell::CreateContentViewer(const char* aContentType,
// Instantiate the content viewer object
nsCOMPtr<nsIContentViewer> viewer;
if(NS_FAILED(NewContentViewerObj(aContentType, aCommand, aOpenedChannel,
loadGroup, aContentHandler, getter_AddRefs(viewer))))
if(NS_FAILED(NewContentViewerObj(aContentType, aOpenedChannel, loadGroup,
aContentHandler, getter_AddRefs(viewer))))
return NS_ERROR_FAILURE;
// let's try resetting the load group if we need to...
@ -2113,9 +2091,8 @@ NS_IMETHODIMP nsDocShell::CreateContentViewer(const char* aContentType,
}
nsresult nsDocShell::NewContentViewerObj(const char* aContentType,
nsURILoadCommand aCommand, nsIChannel* aOpenedChannel,
nsILoadGroup* aLoadGroup, nsIStreamListener** aContentHandler,
nsIContentViewer** aViewer)
nsIChannel* aOpenedChannel, nsILoadGroup* aLoadGroup,
nsIStreamListener** aContentHandler, nsIContentViewer** aViewer)
{
//XXX This should probably be some category thing....
char id[256];
@ -2250,7 +2227,7 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
//*****************************************************************************
NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
nsIInputStream* aPostData, loadType aLoadType)
const char* aWindowTarget, nsIInputStream* aPostData, loadType aLoadType)
{
PRBool wasAnchor = PR_FALSE;
NS_ENSURE_SUCCESS(ScrollIfAnchor(aURI, &wasAnchor), NS_ERROR_FAILURE);
@ -2261,20 +2238,27 @@ NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
}
NS_ENSURE_SUCCESS(StopCurrentLoads(), NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(DoURILoad(aURI), NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(DoURILoad(aURI, (loadLink == aLoadType) ?
nsIURILoader::viewUserClick : nsIURILoader::viewNormal, aWindowTarget),
NS_ERROR_FAILURE);
return NS_OK;
}
NS_IMETHODIMP nsDocShell::DoURILoad(nsIURI* aURI)
NS_IMETHODIMP nsDocShell::CreateFixupURI(const PRUnichar* aStringURI,
nsIURI** aURI)
{
NS_ERROR("Not Implemented");
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsDocShell::DoURILoad(nsIURI* aURI, nsURILoadCommand aLoadCmd,
const char* aWindowTarget)
{
nsCOMPtr<nsIURILoader> uriLoader = do_GetService(NS_URI_LOADER_PROGID);
NS_ENSURE_TRUE(uriLoader, NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(EnsureContentListener(), NS_ERROR_FAILURE);
//mContentListener->SetPresContext(aPresContext);
// we need to get the load group from our load cookie so we can pass it into open uri...
nsCOMPtr<nsILoadGroup> loadGroup;
NS_ENSURE_SUCCESS(
@ -2287,8 +2271,8 @@ NS_IMETHODIMP nsDocShell::DoURILoad(nsIURI* aURI)
NS_STATIC_CAST(nsIInterfaceRequestor*, this)),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(uriLoader->OpenURI(channel, nsIURILoader::viewNormal,
nsnull, NS_STATIC_CAST(nsIDocShell*, this)), NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(uriLoader->OpenURI(channel, aLoadCmd,
aWindowTarget, NS_STATIC_CAST(nsIDocShell*, this)), NS_ERROR_FAILURE);
return NS_OK;
}
@ -2454,7 +2438,7 @@ NS_IMETHODIMP nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry)
NS_ENSURE_SUCCESS(aEntry->GetPostData(getter_AddRefs(postData)),
NS_ERROR_FAILURE);
NS_ENSURE_SUCCESS(InternalLoad(uri, nsnull, postData, loadHistory),
NS_ENSURE_SUCCESS(InternalLoad(uri, nsnull, nsnull, postData, loadHistory),
NS_ERROR_FAILURE);
return NS_OK;

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

@ -121,12 +121,10 @@ protected:
NS_IMETHOD EnsureDeviceContext();
NS_IMETHOD CreateAboutBlankContentViewer();
NS_IMETHOD CreateContentViewer(const char* aContentType,
nsURILoadCommand aCommand, nsIChannel* aOpenedChannel,
nsIStreamListener** aContentHandler);
nsIChannel* aOpenedChannel, nsIStreamListener** aContentHandler);
NS_IMETHOD NewContentViewerObj(const char* aContentType,
nsURILoadCommand aCommand, nsIChannel* aOpenedChannel,
nsILoadGroup* aLoadGroup, nsIStreamListener** aContentHandler,
nsIContentViewer** aViewer);
nsIChannel* aOpenedChannel, nsILoadGroup* aLoadGroup,
nsIStreamListener** aContentHandler, nsIContentViewer** aViewer);
NS_IMETHOD SetupNewViewer(nsIContentViewer* aNewViewer);
// Site Loading
@ -142,9 +140,12 @@ protected:
loadLink
} loadType;
NS_IMETHOD InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
nsIInputStream* aPostData=nsnull, loadType aLoadType=loadNormal);
NS_IMETHOD DoURILoad(nsIURI* aURI);
NS_IMETHOD InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
const char* aWindowTarget=nsnull, nsIInputStream* aPostData=nsnull,
loadType aLoadType=loadNormal);
NS_IMETHOD CreateFixupURI(const PRUnichar* aStringURI, nsIURI** aURI);
NS_IMETHOD DoURILoad(nsIURI* aURI, nsURILoadCommand aLoadCmd,
const char* aWindowTarget);
NS_IMETHOD StopCurrentLoads();
NS_IMETHOD ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor);
NS_IMETHOD OnLoadingSite(nsIChannel* aChannel);