New interfaces to nsIsessionHistory added

This commit is contained in:
radha%netscape.com 1999-06-21 22:15:11 +00:00
parent 993eef4613
commit 5a8751c744
2 changed files with 28 additions and 3 deletions

View File

@ -156,6 +156,7 @@ nsBrowserAppCore::nsBrowserAppCore()
nsBrowserAppCore::~nsBrowserAppCore()
{
// We own none of these things, so no need to release
//NS_IF_RELEASE(mToolbarWindow)
//NS_IF_RELEASE(mToolbarScriptContext);
@ -165,6 +166,12 @@ nsBrowserAppCore::~nsBrowserAppCore()
//NS_IF_RELEASE(mWebShell);
//NS_IF_RELEASE(mContentAreaWebShell);
if (nsnull != mGHistory) {
nsServiceManager::ReleaseService(kCGlobalHistoryCID, mGHistory);
}
NS_IF_RELEASE(mSHistory);
DecInstanceCount();
}
@ -289,9 +296,6 @@ nsBrowserAppCore::Init(const nsString& aId)
kISessionHistoryIID,
(void **) &mSHistory);
if (!mSHistory)
printf("********** Couldn't initialize Session History *********\n");
BeginObserving();
return rv;
@ -1385,6 +1389,23 @@ nsBrowserAppCore::getCurrentIndex(PRInt32 & aResult)
}
NS_IMETHODIMP
nsBrowserAppCore::GetURLForIndex(PRInt32 aIndex, const PRUnichar** aURL)
{
if (mSHistory)
mSHistory->GetURLForIndex(aIndex, aURL);
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::SetURLForIndex(PRInt32 aIndex, const PRUnichar* aURL)
{
if (mSHistory)
mSHistory->SetURLForIndex(aIndex, aURL);
return NS_OK;
}
/*
NS_IMETHODIMP
cloneHistory(nsISessionHistory * aSessionHistory) {

View File

@ -157,6 +157,10 @@ class nsBrowserAppCore : public nsBaseAppCore,
NS_IMETHOD SetLoadingHistoryEntry(nsHistoryEntry * aHistoryEntry);
NS_IMETHOD GetURLForIndex(PRInt32 aIndex, const PRUnichar ** aURL);
NS_IMETHOD SetURLForIndex(PRInt32 aIndex, const PRUnichar * aURL);
protected:
NS_IMETHOD DoDialog();