Bug 1514585 - Fix missing idl parameter to only flash Download Manager when requested via pref. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Tue, 18 Dec 2018 20:24:18 +0100
changeset 33169 5725e65df3d5
parent 33168 2ef791acbdef
child 33170 b794f9853ab5
push id2368
push userclokep@gmail.com
push dateMon, 28 Jan 2019 21:12:50 +0000
treeherdercomm-beta@56d23c07d815 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1514585
Bug 1514585 - Fix missing idl parameter to only flash Download Manager when requested via pref. r=IanN
suite/components/downloads/DownloadsCommon.jsm
suite/components/nsISuiteGlue.idl
suite/components/nsSuiteGlue.js
--- a/suite/components/downloads/DownloadsCommon.jsm
+++ b/suite/components/downloads/DownloadsCommon.jsm
@@ -610,17 +610,17 @@ DownloadsDataCtor.prototype = {
       return;
 
     var behavior = download.source.isPrivate ? 1 :
                      Services.prefs.getIntPref(PREF_DM_BEHAVIOR);
     switch (behavior) {
       case 0:
         Cc["@mozilla.org/suite/suiteglue;1"]
           .getService(Ci.nsISuiteGlue)
-          .showDownloadManager(download);
+          .showDownloadManager(true);
         break;
       case 1:
         Services.ww.openWindow(null, PROGRESS_DIALOG_URL, null,
                                "chrome,titlebar,centerscreen,minimizable=yes,dialog=no",
                                { wrappedJSObject: download });
         break;
     }
 
--- a/suite/components/nsISuiteGlue.idl
+++ b/suite/components/nsISuiteGlue.idl
@@ -24,17 +24,17 @@ interface nsIDOMWindow;
  */
 
 [scriptable, uuid(b3a787fd-4c05-4518-98e3-20bc10a0f586)]
 interface nsISuiteGlue : nsISupports
 {
   /**
    * Opens the Download Manager.
    */
-  void showDownloadManager();
+  void showDownloadManager( [optional] in boolean newDownload );
 
   /**
    * Deletes privacy sensitive data according to user preferences
    *
    * @param aParentWindow an optionally null window which is the parent of the
    *        sanitization dialog (if it has to be shown per user preferences)
    *
    */
--- a/suite/components/nsSuiteGlue.js
+++ b/suite/components/nsSuiteGlue.js
@@ -1234,31 +1234,30 @@ SuiteGlue.prototype = {
     this.dbgStop();
     this.dbgStart();
   },
 
   // ------------------------------
   // public nsISuiteGlue members
   // ------------------------------
 
-  showDownloadManager: function(aDownload)
+  showDownloadManager: function(newDownload)
   {
     if (!gDownloadManager) {
       gDownloadManager = Services.ww.openWindow(null, DOWNLOAD_MANAGER_URL,
-                                                null, "all,dialog=no",
-                                                { wrappedJSObject: aDownload });
+                                                null, "all,dialog=no", null);
       gDownloadManager.addEventListener("load", function() {
         gDownloadManager.addEventListener("unload", function() {
           gDownloadManager = null;
         });
         // Attach the taskbar progress meter to the download manager window.
         ChromeUtils.import("resource:///modules/DownloadsTaskbar.jsm", {})
                    .DownloadsTaskbar.attachIndicator(gDownloadManager);
       });
-    } else if (!aDownload ||
+    } else if (!newDownload ||
                Services.prefs.getBoolPref(PREF_FOCUS_WHEN_STARTING)) {
         gDownloadManager.focus();
     } else {
       // This preference may not be set, so defaulting to two.
       var flashCount = 2;
       try {
         flashCount = Services.prefs.getIntPref(PREF_FLASH_COUNT);
       } catch (e) { }