зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
ba9ba06c26
Коммит
d848a4410c
|
@ -34,6 +34,7 @@
|
|||
#include "nsISHContainer.h"
|
||||
#include "nsIDocShellTreeItem.h"
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellLoadInfo.h"
|
||||
|
||||
//*****************************************************************************
|
||||
//*** nsSHistory: Object Management
|
||||
|
@ -329,6 +330,7 @@ nsSHistory::GetCanGoForward(PRBool * aCanGoForward)
|
|||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHistory::GoBack()
|
||||
{
|
||||
|
@ -354,10 +356,10 @@ nsSHistory::GoForward()
|
|||
}
|
||||
|
||||
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
|
||||
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<nsISHEntry> shEntry;
|
||||
|
@ -450,22 +459,26 @@ nsSHistory::GotoIndex(PRInt32 aIndex)
|
|||
nsCOMPtr<nsISHEntry> nextEntry;
|
||||
GetEntryAtIndex(mIndex, PR_FALSE, getter_AddRefs(nextEntry));
|
||||
|
||||
PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, getter_AddRefs(docShell), getter_AddRefs(shEntry));
|
||||
|
||||
if (!result)
|
||||
mIndex = oldIndex;
|
||||
|
||||
if (!docShell || !shEntry || !mRootDocShell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> nexturi;
|
||||
nsCOMPtr<nsIDocShellLoadInfo> loadInfo;
|
||||
if (oldIndex != aIndex) {
|
||||
PRBool result = CompareSHEntry(prevEntry, nextEntry, mRootDocShell, getter_AddRefs(docShell), getter_AddRefs(shEntry));
|
||||
if (!result)
|
||||
mIndex = oldIndex;
|
||||
|
||||
if (!docShell || !shEntry || !mRootDocShell)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
shEntry->GetURI(getter_AddRefs(nexturi));
|
||||
}
|
||||
else
|
||||
nextEntry->GetURI(getter_AddRefs(nexturi));
|
||||
|
||||
shEntry->GetURI(getter_AddRefs(nexturi));
|
||||
mRootDocShell->CreateLoadInfo (getter_AddRefs(loadInfo));
|
||||
// This is not available yet
|
||||
// loadInfo->SetSessionHistoryEntry(nextEntry);
|
||||
|
||||
loadInfo->SetLoadType(aLoadType);
|
||||
loadInfo->SetSHEntry(nextEntry);
|
||||
// Time to initiate a document load
|
||||
return docShell->LoadURI(nexturi, loadInfo);
|
||||
|
||||
|
|
|
@ -47,11 +47,11 @@ protected:
|
|||
virtual ~nsSHistory();
|
||||
|
||||
// Could become part of nsIWebNavigation
|
||||
NS_IMETHOD GotoIndex(PRInt32 aIndex);
|
||||
NS_IMETHOD PrintHistory();
|
||||
NS_IMETHOD GetTransactionAtIndex(PRInt32 aIndex, nsISHTransaction ** aResult);
|
||||
PRBool CompareSHEntry(nsISHEntry * prevEntry, nsISHEntry * nextEntry, nsIDocShell * rootDocShell,
|
||||
nsIDocShell ** aResultDocShell, nsISHEntry ** aResultSHEntry);
|
||||
NS_IMETHOD LoadEntry(PRInt32 aIndex, PRBool aReloadFlag, long aLoadType);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsISHTransaction> mListRoot;
|
||||
|
|
Загрузка…
Ссылка в новой задаче