Bug 1179058 - Implement shouldAddToSessionHistory in WebBrowserChrome JS object. r=adw

--HG--
extra : rebase_source : b21952075a68b39cbfbbb36cde0713096c700c46
This commit is contained in:
Nihanth Subramanya 2015-07-02 11:04:06 -07:00
parent 4900e9e338
commit 5e74ed3e43
5 changed files with 3 additions and 41 deletions

View File

@ -4091,10 +4091,6 @@ var XULBrowserWindow = {
return true;
},
shouldAddToSessionHistory: function(aDocShell, aURI) {
return aURI.spec != NewTabURL.get();
},
onProgressChange: function (aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress) {

View File

@ -11751,21 +11751,11 @@ nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI)
return false;
}
if (buf.EqualsLiteral("blank")) {
if (buf.EqualsLiteral("blank") || buf.EqualsLiteral("newtab")) {
return false;
}
}
// Check if the webbrowser chrome wants us to proceed - by default it ensures
// aURI is not the newtab URI.
nsCOMPtr<nsIWebBrowserChrome3> browserChrome3 = do_GetInterface(mTreeOwner);
if (browserChrome3) {
bool shouldAdd;
rv = browserChrome3->ShouldAddToSessionHistory(this, aURI, &shouldAdd);
NS_ENSURE_SUCCESS(rv, true);
return shouldAdd;
}
return true;
}

View File

@ -12,7 +12,7 @@ interface nsIInputStream;
/**
* nsIWebBrowserChrome3 is an extension to nsIWebBrowserChrome2.
*/
[scriptable, uuid(da646a9c-5788-4860-88a4-bd5d0ad853da)]
[scriptable, uuid(542b6625-35a9-426a-8257-c12a345383b0)]
interface nsIWebBrowserChrome3 : nsIWebBrowserChrome2
{
/**
@ -47,7 +47,4 @@ interface nsIWebBrowserChrome3 : nsIWebBrowserChrome2
bool shouldLoadURI(in nsIDocShell aDocShell,
in nsIURI aURI,
in nsIURI aReferrer);
bool shouldAddToSessionHistory(in nsIDocShell aDocShell,
in nsIURI aURI);
};

View File

@ -462,24 +462,6 @@ NS_IMETHODIMP nsContentTreeOwner::ShouldLoadURI(nsIDocShell *aDocShell,
return NS_OK;
}
NS_IMETHODIMP
nsContentTreeOwner::ShouldAddToSessionHistory(nsIDocShell *aDocShell,
nsIURI *aURI,
bool *_retval)
{
NS_ENSURE_STATE(mXULWindow);
nsCOMPtr<nsIXULBrowserWindow> xulBrowserWindow;
mXULWindow->GetXULBrowserWindow(getter_AddRefs(xulBrowserWindow));
if (xulBrowserWindow) {
return xulBrowserWindow->ShouldAddToSessionHistory(aDocShell, aURI, _retval);
}
*_retval = true;
return NS_OK;
}
//*****************************************************************************
// nsContentTreeOwner::nsIWebBrowserChrome2
//*****************************************************************************

View File

@ -19,7 +19,7 @@ interface nsITabParent;
* internals of the browser area to tell the containing xul window to update
* its ui.
*/
[scriptable, uuid(8974a499-d49b-43e1-8b32-c9b3ed81be3f)]
[scriptable, uuid(a8675fa9-c8b4-4350-9803-c38f344a9e38)]
interface nsIXULBrowserWindow : nsISupports
{
/**
@ -62,9 +62,6 @@ interface nsIXULBrowserWindow : nsISupports
bool shouldLoadURI(in nsIDocShell aDocShell,
in nsIURI aURI,
in nsIURI aReferrer);
bool shouldAddToSessionHistory(in nsIDocShell aDocShell,
in nsIURI aURI);
/**
* Show/hide a tooltip (when the user mouses over a link, say).
*/