From b7b1ee0f64ddb079edcd6cf56e2a62d63badcf37 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. git-svn-id: svn://10.0.0.236/trunk@66123 18797224-902f-48f8-a5cc-f745e15eee43 --- .../events/src/nsEventStateManager.cpp | 27 ++++++------------- .../layout/events/src/nsEventStateManager.cpp | 27 ++++++------------- 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/mozilla/content/events/src/nsEventStateManager.cpp b/mozilla/content/events/src/nsEventStateManager.cpp index eee45f695d3..a99d0da6989 100644 --- a/mozilla/content/events/src/nsEventStateManager.cpp +++ b/mozilla/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/mozilla/layout/events/src/nsEventStateManager.cpp b/mozilla/layout/events/src/nsEventStateManager.cpp index eee45f695d3..a99d0da6989 100644 --- a/mozilla/layout/events/src/nsEventStateManager.cpp +++ b/mozilla/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(); } } }