Bug 1035439 - Part 1: Clear private undo close tab data when leaving private browsing. r=margaret

This commit is contained in:
Brian Nicholson 2014-07-14 17:21:13 -07:00
parent e608e66fe1
commit 8c1f089270

View File

@ -84,6 +84,7 @@ SessionStore.prototype = {
observerService.addObserver(this, "application-background", true);
observerService.addObserver(this, "ClosedTabs:StartNotifications", true);
observerService.addObserver(this, "ClosedTabs:StopNotifications", true);
observerService.addObserver(this, "last-pb-context-exited", true);
break;
case "final-ui-startup":
observerService.removeObserver(this, "final-ui-startup");
@ -169,6 +170,13 @@ SessionStore.prototype = {
case "ClosedTabs:StopNotifications":
this._notifyClosedTabs = false;
break;
case "last-pb-context-exited":
// Clear private closed tab data when we leave private browsing.
for (let [, window] in Iterator(this._windows)) {
window.closedTabs = window.closedTabs.filter(tab => !tab.isPrivate);
}
this._lastClosedTabIndex = -1;
break;
}
},