Bug 78510. Undoing backout; still no change.

This commit is contained in:
roc+@cs.cmu.edu
2005-08-16 01:03:45 +00:00
parent 4bf99796f5
commit 73222572a9

View File

@@ -66,6 +66,7 @@
#include "nsIWebBrowserChrome.h"
#include "nsPoint.h"
#include "nsGfxCIID.h"
#include "nsIObserverService.h"
#include "nsIPrompt.h"
#include "nsIAuthPrompt.h"
#include "nsTextFormatter.h"
@@ -7847,13 +7848,27 @@ NS_IMETHODIMP nsDocShell::MakeEditable(PRBool inWaitForUriLoad)
nsresult
nsDocShell::AddToGlobalHistory(nsIURI * aURI, PRBool aRedirect, nsIURI * aReferrer)
{
if (mItemType != typeContent)
if (mItemType != typeContent || !mGlobalHistory)
return NS_OK;
if (!mGlobalHistory)
return NS_OK;
PRBool visited;
nsresult rv = mGlobalHistory->IsVisited(aURI, &visited);
if (NS_FAILED(rv))
return rv;
rv = mGlobalHistory->AddURI(aURI, aRedirect, !IsFrame(), aReferrer);
if (NS_FAILED(rv))
return rv;
return mGlobalHistory->AddURI(aURI, aRedirect, !IsFrame(), aReferrer);
if (!visited) {
nsCOMPtr<nsIObserverService> obsService =
do_GetService("@mozilla.org/observer-service;1");
if (obsService) {
obsService->NotifyObservers(aURI, NS_LINK_VISITED_EVENT_TOPIC, nsnull);
}
}
return NS_OK;
}
//*****************************************************************************