Changed over from using the webshell APIs and nsISessionHistory to using the webNavigation interface on the docshell to go back and forward. Don't have to get the root, docshell does that for you.

This commit is contained in:
tbogard%aol.net 2000-04-16 06:14:38 +00:00
Родитель 2e31c41c86
Коммит faefc106ed
2 изменённых файлов: 16 добавлений и 38 удалений

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

@ -55,10 +55,11 @@
#include "nsPIDOMWindow.h"
#include "nsIEnumerator.h"
#include "nsFrameTraversal.h"
#include "nsIDocShellTreeItem.h"
#include "nsIWebNavigation.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
#include "nsISessionHistory.h"
#include "nsXULAtoms.h"
#include "nsIDOMXULDocument.h"
@ -846,24 +847,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext,
nsCOMPtr<nsISupports> pcContainer;
mPresContext->GetContainer(getter_AddRefs(pcContainer));
if (pcContainer) {
nsCOMPtr<nsIWebShell> webShell = do_QueryInterface(pcContainer);
if (webShell) {
nsCOMPtr<nsIWebShell> root;
webShell->GetRootWebShell(*getter_AddRefs(root));
if (nsnull != root) {
nsCOMPtr<nsISessionHistory> sHist;
root->GetSessionHistory(*getter_AddRefs(sHist));
if (sHist) {
if (numLines > 0)
{
sHist->GoBack(root);
}
else
{
sHist->GoForward(root);
}
}
}
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer));
if (webNav) {
if (numLines > 0)
webNav->GoBack();
else
webNav->GoForward();
}
}
}

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

@ -55,10 +55,11 @@
#include "nsPIDOMWindow.h"
#include "nsIEnumerator.h"
#include "nsFrameTraversal.h"
#include "nsIDocShellTreeItem.h"
#include "nsIWebNavigation.h"
#include "nsIServiceManager.h"
#include "nsIPref.h"
#include "nsISessionHistory.h"
#include "nsXULAtoms.h"
#include "nsIDOMXULDocument.h"
@ -846,24 +847,12 @@ nsEventStateManager::PostHandleEvent(nsIPresContext* aPresContext,
nsCOMPtr<nsISupports> pcContainer;
mPresContext->GetContainer(getter_AddRefs(pcContainer));
if (pcContainer) {
nsCOMPtr<nsIWebShell> webShell = do_QueryInterface(pcContainer);
if (webShell) {
nsCOMPtr<nsIWebShell> root;
webShell->GetRootWebShell(*getter_AddRefs(root));
if (nsnull != root) {
nsCOMPtr<nsISessionHistory> sHist;
root->GetSessionHistory(*getter_AddRefs(sHist));
if (sHist) {
if (numLines > 0)
{
sHist->GoBack(root);
}
else
{
sHist->GoForward(root);
}
}
}
nsCOMPtr<nsIWebNavigation> webNav(do_QueryInterface(pcContainer));
if (webNav) {
if (numLines > 0)
webNav->GoBack();
else
webNav->GoForward();
}
}
}