From c768114b78f3d4bb6e42127f6c777d87c93b592d Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 12 Mar 2009 12:28:17 +0330 Subject: [PATCH] Bug 464800 - Download manager title window is not cleared when switching to Private Browsing; r=sdwilsh --- .../mozapps/downloads/content/downloads.js | 9 ++ .../downloads/tests/chrome/Makefile.in | 1 + .../chrome/test_privatebrowsing_title.xul | 139 ++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js index 05d1b72bf48..a4ee0e7dc80 100644 --- a/toolkit/mozapps/downloads/content/downloads.js +++ b/toolkit/mozapps/downloads/content/downloads.js @@ -504,6 +504,15 @@ let gDownloadObserver = { break; case "private-browsing": if (aData == "enter" || aData == "exit") { + // We need to reset the title here, because otherwise the title of + // the download manager would still reflect the progress of current + // active downloads, if any, after switchiung the private browsing + // mode, even though the downloads will no longer be accessible. + // If any download is auto-started after switching the private + // browsing mode, the title will be updated as needed by the progress + // listener. + document.title = document.documentElement.getAttribute("statictitle"); + // We might get this notification before the download manager // service, so the new database connection might not be ready // yet. Defer this until all private-browsing notifications diff --git a/toolkit/mozapps/downloads/tests/chrome/Makefile.in b/toolkit/mozapps/downloads/tests/chrome/Makefile.in index 0661b4468a7..cf443119374 100644 --- a/toolkit/mozapps/downloads/tests/chrome/Makefile.in +++ b/toolkit/mozapps/downloads/tests/chrome/Makefile.in @@ -62,6 +62,7 @@ _CHROME_FILES = \ test_search_keys.xul \ test_select_all.xul \ test_space_key_pauses_resumes.xul \ + test_privatebrowsing_title.xul \ test_ui_stays_open_on_alert_clickback.xul \ test_unkownContentType_dialog_layout.xul \ test_bug_412360.xul \ diff --git a/toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul b/toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul new file mode 100644 index 00000000000..dca24ce6a33 --- /dev/null +++ b/toolkit/mozapps/downloads/tests/chrome/test_privatebrowsing_title.xul @@ -0,0 +1,139 @@ + + + + + + + + +

+ +

+  
+