Bug 858916 - Switch-to-tab does not work on always private browsing mode. r=Unfocused,f=jdm

This commit is contained in:
Avinash Kundaliya 2013-04-23 18:00:38 +12:00
parent 4b7c54972f
commit 3be5f624df
2 changed files with 10 additions and 6 deletions

View File

@ -6754,8 +6754,10 @@ let gPrivateBrowsingUI = {
}
}
if (gURLBar) {
// Disable switch to tab autocompletion for private windows
if (gURLBar &&
!PrivateBrowsingUtils.permanentPrivateBrowsing) {
// Disable switch to tab autocompletion for private windows
// (not for "Always use private browsing" mode)
gURLBar.setAttribute("autocompletesearchparam", "");
}
}
@ -6778,9 +6780,10 @@ function switchToTabHavingURI(aURI, aOpenNew) {
// This will switch to the tab in aWindow having aURI, if present.
function switchIfURIInWindow(aWindow) {
// Only switch to the tab if neither the source and desination window are
// private.
if (PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.isWindowPrivate(aWindow)) {
// private and they are not in permanent private borwsing mode
if ((PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.isWindowPrivate(aWindow)) &&
!PrivateBrowsingUtils.permanentPrivateBrowsing) {
return false;
}

View File

@ -643,7 +643,8 @@
// Tabs in private windows aren't registered as "Open" so
// that they don't appear as switch-to-tab candidates.
if (!isBlankPageURL(aLocation.spec) &&
!PrivateBrowsingUtils.isWindowPrivate(window)) {
(!PrivateBrowsingUtils.isWindowPrivate(window) ||
PrivateBrowsingUtils.permanentPrivateBrowsing)) {
autocomplete.registerOpenPage(aLocation);
this.mBrowser.registeredOpenURI = aLocation;
}