More checkins for feature bug 36547. CODE NOT PART OF THE BUILD. reviewer will be provided

when feature is enabled.
This commit is contained in:
radha%netscape.com 2005-08-18 11:15:37 +00:00
Родитель f94a6d05ae
Коммит 1472dbeb9c
2 изменённых файлов: 28 добавлений и 15 удалений

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

@ -34,6 +34,7 @@
#include "nsISHContainer.h" #include "nsISHContainer.h"
#include "nsIDocShellTreeItem.h" #include "nsIDocShellTreeItem.h"
#include "nsIDocShellTreeNode.h" #include "nsIDocShellTreeNode.h"
#include "nsIDocShellLoadInfo.h"
//***************************************************************************** //*****************************************************************************
//*** nsSHistory: Object Management //*** nsSHistory: Object Management
@ -329,6 +330,7 @@ nsSHistory::GetCanGoForward(PRBool * aCanGoForward)
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsSHistory::GoBack() nsSHistory::GoBack()
{ {
@ -354,10 +356,10 @@ nsSHistory::GoForward()
} }
NS_IMETHODIMP NS_IMETHODIMP
nsSHistory::Reload(PRInt32 reloadType) nsSHistory::Reload(PRInt32 aReloadType)
{ {
// NOT implemented
return NS_OK; return LoadEntry(mIndex, PR_TRUE, aReloadType);
} }
@ -438,6 +440,13 @@ nsSHistory::GetSHEForChild(PRInt32 aChildOffset, nsISHEntry ** aResult)
NS_IMETHODIMP NS_IMETHODIMP
nsSHistory::GotoIndex(PRInt32 aIndex) nsSHistory::GotoIndex(PRInt32 aIndex)
{
return LoadEntry(aIndex, PR_FALSE, nsIDocShellLoadInfo::loadHistory);
}
NS_IMETHODIMP
nsSHistory::LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType)
{ {
nsCOMPtr<nsIDocShell> docShell; nsCOMPtr<nsIDocShell> docShell;
nsCOMPtr<nsISHEntry> shEntry; nsCOMPtr<nsISHEntry> shEntry;
@ -450,22 +459,26 @@ nsSHistory::GotoIndex(PRInt32 aIndex)
nsCOMPtr<nsISHEntry> nextEntry; nsCOMPtr<nsISHEntry> nextEntry;
GetEntryAtIndex(mIndex, PR_FALSE, getter_AddRefs(nextEntry)); GetEntryAtIndex(mIndex, PR_FALSE, getter_AddRefs(nextEntry));
nsCOMPtr<nsIURI> nexturi;
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
if (oldIndex != aIndex) {
PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, getter_AddRefs(docShell), getter_AddRefs(shEntry)); PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, getter_AddRefs(docShell), getter_AddRefs(shEntry));
if (!result) if (!result)
mIndex = oldIndex; mIndex = oldIndex;
if (!docShell || !shEntry || !mRootDocShell) if (!docShell || !shEntry || !mRootDocShell)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
nsCOMPtr<nsIURI> nexturi;
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
shEntry->GetURI(getter_AddRefs(nexturi)); shEntry->GetURI(getter_AddRefs(nexturi));
}
else
nextEntry->GetURI(getter_AddRefs(nexturi));
mRootDocShell->CreateLoadInfo (getter_AddRefs(loadInfo)); mRootDocShell->CreateLoadInfo (getter_AddRefs(loadInfo));
// This is not available yet // This is not available yet
// loadInfo->SetSessionHistoryEntry(nextEntry); loadInfo->SetLoadType(aLoadType);
loadInfo->SetSHEntry(nextEntry);
// Time to initiate a document load // Time to initiate a document load
return docShell->LoadURI(nexturi, loadInfo); return docShell->LoadURI(nexturi, loadInfo);

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

@ -47,11 +47,11 @@ protected:
virtual ~nsSHistory(); virtual ~nsSHistory();
// Could become part of nsIWebNavigation // Could become part of nsIWebNavigation
NS_IMETHOD GotoIndex(PRInt32 aIndex);
NS_IMETHOD PrintHistory(); NS_IMETHOD PrintHistory();
NS_IMETHOD GetTransactionAtIndex(PRInt32 aIndex, nsISHTransaction ** aResult); NS_IMETHOD GetTransactionAtIndex(PRInt32 aIndex, nsISHTransaction ** aResult);
PRBool CompareSHEntry(nsISHEntry * prevEntry, nsISHEntry * nextEntry, nsIDocShell * rootDocShell, PRBool CompareSHEntry(nsISHEntry * prevEntry, nsISHEntry * nextEntry, nsIDocShell * rootDocShell,
nsIDocShell ** aResultDocShell, nsISHEntry ** aResultSHEntry); nsIDocShell ** aResultDocShell, nsISHEntry ** aResultSHEntry);
NS_IMETHOD LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType);
protected: protected:
nsCOMPtr<nsISHTransaction> mListRoot; nsCOMPtr<nsISHTransaction> mListRoot;