Bug 575561 - External links from within app tabs should always open in new tabs instead of replacing the app tab's page. r=gavin+bz, a=blocking-beta7
This commit is contained in:
@@ -159,7 +159,7 @@
|
||||
#include "nsIController.h"
|
||||
#include "nsPICommandUpdater.h"
|
||||
#include "nsIDOMHTMLAnchorElement.h"
|
||||
#include "nsIWebBrowserChrome2.h"
|
||||
#include "nsIWebBrowserChrome3.h"
|
||||
#include "nsITabChild.h"
|
||||
#include "nsIStrictTransportSecurityService.h"
|
||||
|
||||
@@ -711,6 +711,7 @@ nsDocShell::nsDocShell():
|
||||
mAllowKeywordFixup(PR_FALSE),
|
||||
mIsOffScreenBrowser(PR_FALSE),
|
||||
mIsActive(PR_TRUE),
|
||||
mIsAppTab(PR_FALSE),
|
||||
mFiredUnloadEvent(PR_FALSE),
|
||||
mEODForCurrentDocument(PR_FALSE),
|
||||
mURIResultedInDocument(PR_FALSE),
|
||||
@@ -4802,6 +4803,20 @@ nsDocShell::GetIsActive(PRBool *aIsActive)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetIsAppTab(PRBool aIsAppTab)
|
||||
{
|
||||
mIsAppTab = aIsAppTab;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::GetIsAppTab(PRBool *aIsAppTab)
|
||||
{
|
||||
*aIsAppTab = mIsAppTab;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetVisibility(PRBool aVisibility)
|
||||
{
|
||||
@@ -11311,8 +11326,22 @@ nsDocShell::OnLinkClick(nsIContent* aContent,
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
nsAutoString target;
|
||||
|
||||
nsCOMPtr<nsIWebBrowserChrome3> browserChrome3 = do_GetInterface(mTreeOwner);
|
||||
if (browserChrome3) {
|
||||
nsCOMPtr<nsIDOMNode> linkNode = do_QueryInterface(aContent);
|
||||
nsAutoString oldTarget(aTargetSpec);
|
||||
rv = browserChrome3->OnBeforeLinkTraversal(oldTarget, aURI,
|
||||
linkNode, mIsAppTab, target);
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
target = aTargetSpec;
|
||||
|
||||
nsCOMPtr<nsIRunnable> ev =
|
||||
new OnLinkClickEvent(this, aContent, aURI, aTargetSpec,
|
||||
new OnLinkClickEvent(this, aContent, aURI, target.get(),
|
||||
aPostDataStream, aHeadersDataStream);
|
||||
return NS_DispatchToCurrentThread(ev);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user