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
This commit is contained in:
parent
435ed0e07a
commit
b7b1ee0f64
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user