Bug 597315 Part 1 (session history) - Frameset history does not work properly when restoring a tab [r=bz, a=blocking2.0:betaN+]

This commit is contained in:
Olli Pettay 2010-12-27 16:22:46 -05:00
Родитель 22fdc2e382
Коммит 846d176b60
3 изменённых файлов: 28 добавлений и 1 удалений

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

@ -178,3 +178,9 @@ interface nsISHistory: nsISupports
*/
readonly attribute nsISimpleEnumerator SHistoryEnumerator;
};
[scriptable, uuid(ac8b3eb3-2051-4cce-8303-d6e7938501dd)]
interface nsISHistory_2_0_BRANCH: nsISHistory
{
void reloadCurrentEntry();
};

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

@ -153,6 +153,7 @@ NS_INTERFACE_MAP_BEGIN(nsSHistory)
NS_INTERFACE_MAP_ENTRY(nsISHistory)
NS_INTERFACE_MAP_ENTRY(nsIWebNavigation)
NS_INTERFACE_MAP_ENTRY(nsISHistoryInternal)
NS_INTERFACE_MAP_ENTRY(nsISHistory_2_0_BRANCH)
NS_INTERFACE_MAP_END
//*****************************************************************************
@ -796,6 +797,25 @@ nsSHistory::Reload(PRUint32 aReloadFlags)
return LoadEntry(mIndex, loadType, HIST_CMD_RELOAD);
}
NS_IMETHODIMP
nsSHistory::ReloadCurrentEntry()
{
// Notify listeners
PRBool canNavigate = PR_TRUE;
if (mListener) {
nsCOMPtr<nsISHistoryListener> listener(do_QueryReferent(mListener));
if (listener) {
nsCOMPtr<nsIURI> currentURI;
GetCurrentURI(getter_AddRefs(currentURI));
listener->OnHistoryGotoIndex(mIndex, currentURI, &canNavigate);
}
}
if (!canNavigate)
return NS_OK;
return LoadEntry(mIndex, nsIDocShellLoadInfo::loadHistory, HIST_CMD_RELOAD);
}
void
nsSHistory::EvictWindowContentViewers(PRInt32 aFromIndex, PRInt32 aToIndex)
{

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

@ -62,7 +62,7 @@ class nsIDocShell;
class nsSHEnumerator;
class nsSHistoryObserver;
class nsSHistory: public PRCList,
public nsISHistory,
public nsISHistory_2_0_BRANCH,
public nsISHistoryInternal,
public nsIWebNavigation
{
@ -73,6 +73,7 @@ public:
NS_DECL_NSISHISTORY
NS_DECL_NSISHISTORYINTERNAL
NS_DECL_NSIWEBNAVIGATION
NS_DECL_NSISHISTORY_2_0_BRANCH
// One time initialization method called upon docshell module construction
static nsresult Startup();