From faefc106eddfdc785b585a0eb0a27767b9600f94 Mon Sep 17 00:00:00 2001 From: "tbogard%aol.net" Date: Sun, 16 Apr 2000 06:14:38 +0000 Subject: [PATCH] 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. --- content/events/src/nsEventStateManager.cpp | 27 +++++++--------------- layout/events/src/nsEventStateManager.cpp | 27 +++++++--------------- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/content/events/src/nsEventStateManager.cpp b/content/events/src/nsEventStateManager.cpp index eee45f695d36..a99d0da69892 100644 --- a/content/events/src/nsEventStateManager.cpp +++ b/content/events/src/nsEventStateManager.cpp @@ -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 pcContainer; mPresContext->GetContainer(getter_AddRefs(pcContainer)); if (pcContainer) { - nsCOMPtr webShell = do_QueryInterface(pcContainer); - if (webShell) { - nsCOMPtr root; - webShell->GetRootWebShell(*getter_AddRefs(root)); - if (nsnull != root) { - nsCOMPtr sHist; - root->GetSessionHistory(*getter_AddRefs(sHist)); - if (sHist) { - if (numLines > 0) - { - sHist->GoBack(root); - } - else - { - sHist->GoForward(root); - } - } - } + nsCOMPtr webNav(do_QueryInterface(pcContainer)); + if (webNav) { + if (numLines > 0) + webNav->GoBack(); + else + webNav->GoForward(); } } } diff --git a/layout/events/src/nsEventStateManager.cpp b/layout/events/src/nsEventStateManager.cpp index eee45f695d36..a99d0da69892 100644 --- a/layout/events/src/nsEventStateManager.cpp +++ b/layout/events/src/nsEventStateManager.cpp @@ -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 pcContainer; mPresContext->GetContainer(getter_AddRefs(pcContainer)); if (pcContainer) { - nsCOMPtr webShell = do_QueryInterface(pcContainer); - if (webShell) { - nsCOMPtr root; - webShell->GetRootWebShell(*getter_AddRefs(root)); - if (nsnull != root) { - nsCOMPtr sHist; - root->GetSessionHistory(*getter_AddRefs(sHist)); - if (sHist) { - if (numLines > 0) - { - sHist->GoBack(root); - } - else - { - sHist->GoForward(root); - } - } - } + nsCOMPtr webNav(do_QueryInterface(pcContainer)); + if (webNav) { + if (numLines > 0) + webNav->GoBack(); + else + webNav->GoForward(); } } }