Bug 1192120 - Fix warnings that show up when opening the downloads window in private browsing mode; r=mconley
authorEhsan Akhgari <ehsan@mozilla.com>
Fri, 07 Aug 2015 00:15:24 -0400
changeset 256871 ae5f5a18ddd0d1e84e0b421c26de811cb6e99d10
parent 256870 b6362a1d61894f7888620672568ceda5d0ccb199
child 256872 da37ed115e8a82f2a22c49049ec59866da743663
push id63457
push usereakhgari@mozilla.com
push dateFri, 07 Aug 2015 22:32:21 +0000
treeherdermozilla-inbound@ae5f5a18ddd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmconley
bugs1192120
milestone42.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1192120 - Fix warnings that show up when opening the downloads window in private browsing mode; r=mconley
browser/components/downloads/DownloadsCommon.jsm
browser/components/downloads/content/contentAreaDownloadsView.js
--- a/browser/components/downloads/DownloadsCommon.jsm
+++ b/browser/components/downloads/DownloadsCommon.jsm
@@ -223,17 +223,17 @@ this.DownloadsCommon = {
   /**
    * Get access to one of the DownloadsData or PrivateDownloadsData objects,
    * depending on the privacy status of the window in question.
    *
    * @param aWindow
    *        The browser window which owns the download button.
    */
   getData(aWindow) {
-    if (PrivateBrowsingUtils.isWindowPrivate(aWindow)) {
+    if (PrivateBrowsingUtils.isContentWindowPrivate(aWindow)) {
       return PrivateDownloadsData;
     } else {
       return DownloadsData;
     }
   },
 
   /**
    * Initializes the Downloads back-end and starts receiving events for both the
@@ -245,17 +245,17 @@ this.DownloadsCommon = {
   },
 
   /**
    * Get access to one of the DownloadsIndicatorData or
    * PrivateDownloadsIndicatorData objects, depending on the privacy status of
    * the window in question.
    */
   getIndicatorData(aWindow) {
-    if (PrivateBrowsingUtils.isWindowPrivate(aWindow)) {
+    if (PrivateBrowsingUtils.isContentWindowPrivate(aWindow)) {
       return PrivateDownloadsIndicatorData;
     } else {
       return DownloadsIndicatorData;
     }
   },
 
   /**
    * Returns a reference to the DownloadsSummaryData singleton - creating one
@@ -263,17 +263,17 @@ this.DownloadsCommon = {
    *
    * @param aWindow
    *        The browser window which owns the download button.
    * @param aNumToExclude
    *        The number of items on the top of the downloads list to exclude
    *        from the summary.
    */
   getSummary(aWindow, aNumToExclude) {
-    if (PrivateBrowsingUtils.isWindowPrivate(aWindow)) {
+    if (PrivateBrowsingUtils.isContentWindowPrivate(aWindow)) {
       if (this._privateSummary) {
         return this._privateSummary;
       }
       return this._privateSummary = new DownloadsSummaryData(true, aNumToExclude);
     } else {
       if (this._summary) {
         return this._summary;
       }
--- a/browser/components/downloads/content/contentAreaDownloadsView.js
+++ b/browser/components/downloads/content/contentAreaDownloadsView.js
@@ -3,13 +3,13 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
 
 let ContentAreaDownloadsView = {
   init() {
     let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
     // Do not display the Places downloads in private windows
-    if (!PrivateBrowsingUtils.isWindowPrivate(window)) {
+    if (!PrivateBrowsingUtils.isContentWindowPrivate(window)) {
       view.place = "place:transition=7&sort=4";
     }
   },
 };