Bug 723005 - Remove all checks for global privacy status in history-related code, and add them to callers when appropriate. r=mak sr=gavin

This commit is contained in:
Josh Matthews
2012-02-18 01:40:10 -05:00
parent c88986c829
commit e77a3bf92a
30 changed files with 230 additions and 212 deletions

View File

@@ -5334,7 +5334,8 @@ nsDocShell::SetTitle(const PRUnichar * aTitle)
treeOwnerAsWin->SetTitle(aTitle);
}
if (mCurrentURI && mLoadType != LOAD_ERROR_PAGE && mUseGlobalHistory) {
if (mCurrentURI && mLoadType != LOAD_ERROR_PAGE && mUseGlobalHistory &&
!mInPrivateBrowsing) {
nsCOMPtr<IHistory> history = services::GetHistoryService();
if (history) {
history->SetURITitle(mCurrentURI, mTitle);
@@ -8918,7 +8919,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
/* Set the title for the Global History entry for this anchor url.
*/
if (mUseGlobalHistory) {
if (mUseGlobalHistory && !mInPrivateBrowsing) {
nsCOMPtr<IHistory> history = services::GetHistoryService();
if (history) {
history->SetURITitle(aURI, mTitle);
@@ -10263,7 +10264,7 @@ nsDocShell::AddState(nsIVariant *aData, const nsAString& aTitle,
// AddURIVisit doesn't set the title for the new URI in global history,
// so do that here.
if (mUseGlobalHistory) {
if (mUseGlobalHistory && !mInPrivateBrowsing) {
nsCOMPtr<IHistory> history = services::GetHistoryService();
if (history) {
history->SetURITitle(newURI, mTitle);
@@ -11082,7 +11083,7 @@ nsDocShell::AddURIVisit(nsIURI* aURI,
// Only content-type docshells save URI visits. Also don't do
// anything here if we're not supposed to use global history.
if (mItemType != typeContent || !mUseGlobalHistory) {
if (mItemType != typeContent || !mUseGlobalHistory || mInPrivateBrowsing) {
return;
}