Bug 883962 - Make the download button in the appbar toggle the downloads infobar. r=sfoster
authorMarina Samuel <msamuel@mozilla.com>
Wed, 07 Aug 2013 18:41:25 -0400
changeset 154588 7edbd10a7d034b4d8e34ba2324893f046a60bd0c
parent 154587 760c16523e4da865f5611b5c67eeb842b13db232
child 154589 dcb7c39d1cf816810dc1f1adc231726d57427f0d
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfoster
bugs883962
milestone26.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 883962 - Make the download button in the appbar toggle the downloads infobar. r=sfoster
browser/metro/base/content/appbar.js
browser/metro/base/content/downloads.js
browser/metro/components/HelperAppDialog.js
--- a/browser/metro/base/content/appbar.js
+++ b/browser/metro/base/content/appbar.js
@@ -65,18 +65,18 @@ var Appbar = {
    * updated.
    */
   update: function update() {
     this._updatePinButton();
     this._updateStarButton();
   },
 
   onDownloadButton: function() {
-    // TODO: Bug 883962: Toggle the downloads infobar when the
-    // download button is clicked
+    let notificationBox = Browser.getNotificationBox();
+    notificationBox.notificationsHidden = !notificationBox.notificationsHidden;
     ContextUI.dismiss();
   },
 
   onPinButton: function() {
     if (this.pinButton.checked) {
       Browser.pinSite();
     } else {
       Browser.unpinSite();
--- a/browser/metro/base/content/downloads.js
+++ b/browser/metro/base/content/downloads.js
@@ -164,16 +164,17 @@ var Downloads = {
 
     if (!aIcon)
       aIcon = TOAST_URI_GENERIC_ICON_DOWNLOAD;
 
     notifier.showAlertNotification(aIcon, aTitle, aMessage, true, "", aObserver, aName);
   },
 
   showNotification: function dh_showNotification(title, msg, buttons, priority) {
+    this._notificationBox.notificationsHidden = false;
     return this._notificationBox.appendNotification(msg,
                                               title,
                                               URI_GENERIC_ICON_DOWNLOAD,
                                               priority,
                                               buttons);
   },
 
   _showDownloadFailedNotification: function (aDownload) {
--- a/browser/metro/components/HelperAppDialog.js
+++ b/browser/metro/components/HelperAppDialog.js
@@ -96,16 +96,17 @@ HelperAppLauncherDialog.prototype = {
     let notificationBox = chromeWin.Browser.getNotificationBox();
     downloadSize = this._getDownloadSize(aLauncher.contentLength);
 
     let msg = browserBundle.GetStringFromName("alertDownloadSave")
       .replace("#1", aLauncher.suggestedFileName)
       .replace("#2", downloadSize)
       .replace("#3", aLauncher.source.host);
 
+    notificationBox.notificationsHidden = false;
     let newBar = notificationBox.appendNotification(msg,
                                                     "save-download",
                                                     URI_GENERIC_ICON_DOWNLOAD,
                                                     notificationBox.PRIORITY_WARNING_HIGH,
                                                     buttons);
   },
 
   promptForSaveToFile: function hald_promptForSaveToFile(aLauncher, aContext, aDefaultFile, aSuggestedFileExt, aForcePrompt) {