Added methods to set and get the presContext for the content listener. Made nsDocShellBase a friend class so we could move the constructor and all the non-interface methods into protected area.

This commit is contained in:
tbogard%aol.net 1999-11-07 10:00:53 +00:00
Родитель 7657253dc3
Коммит f07d391a5d
2 изменённых файлов: 22 добавлений и 7 удалений

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

@ -84,6 +84,8 @@ NS_IMETHODIMP nsDSURIContentListener::DoContent(const char* aContentType,
if(HandleInCurrentDocShell(aContentType, aCommand, aWindowTarget))
{
//XXX Start Load here....
//XXX mDocShell->SetCurrentURI(nsIChannel::GetURI()));
}
else
return mParentContentListener->DoContent(aContentType, aCommand,
@ -149,4 +151,15 @@ void nsDSURIContentListener::SetParentContentListener(nsIURIContentListener*
aParentListener)
{
mParentContentListener = aParentListener;
}
}
void nsDSURIContentListener::GetPresContext(nsIPresContext** aPresContext)
{
*aPresContext = mPresContext;
NS_IF_ADDREF(*aPresContext);
}
void nsDSURIContentListener::SetPresContext(nsIPresContext* aPresContext)
{
mPresContext = aPresContext;
}

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

@ -31,27 +31,29 @@ class nsDocShellBase;
class nsDSURIContentListener : public nsIURIContentListener
{
friend class nsDocShellBase;
public:
nsDSURIContentListener();
NS_DECL_ISUPPORTS
NS_DECL_NSIURICONTENTLISTENER
protected:
nsDSURIContentListener();
virtual ~nsDSURIContentListener();
void DocShellBase(nsDocShellBase* aDocShellBase);
nsDocShellBase* DocShellBase();
void GetParentContentListener(nsIURIContentListener** aParentListener);
void SetParentContentListener(nsIURIContentListener* aParentListener);
protected:
virtual ~nsDSURIContentListener();
void GetPresContext(nsIPresContext** aPresContext);
void SetPresContext(nsIPresContext* aPresContext);
PRBool HandleInCurrentDocShell(const char* aContentType,
const char* aCommand, const char* aWindowTarget);
protected:
nsDocShellBase* mDocShell;
nsCOMPtr<nsIURIContentListener> mParentContentListener;
nsCOMPtr<nsIPresContext> mPresContext;
};
#endif /* nsDSURIContentListener_h__ */