diff --git a/chrome/content/bindings/downloads.xml b/chrome/content/bindings/downloads.xml new file mode 100644 --- /dev/null +++ b/chrome/content/bindings/downloads.xml @@ -0,0 +1,166 @@ + + + +%browserDTD; +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chrome/content/browser-ui.js b/chrome/content/browser-ui.js --- a/chrome/content/browser-ui.js +++ b/chrome/content/browser-ui.js @@ -186,10 +186,7 @@ _initPanel : function() { ExtensionsView.init(); - - let dloads = document.getElementById("downloads-container"); - if (!dloads.hasAttribute("src")) - dloads.setAttribute("src", "chrome://mozapps/content/downloads/downloads.xul"); + DownloadsView.init(); }, switchPane : function(id) { diff --git a/chrome/content/browser.css b/chrome/content/browser.css --- a/chrome/content/browser.css +++ b/chrome/content/browser.css @@ -78,3 +78,20 @@ richlistitem[typeName="message"] { -moz-binding: url("chrome://browser/content/bindings/extensions.xml#extension-message"); } + +richlistitem[typeName="download"] { + -moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-downloading"); +} + +richlistitem[typeName="download"][state="1"] { + -moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-done"); +} + +richlistitem[typeName="download"][state="2"], +richlistitem[typeName="download"][state="3"] { + -moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-retry"); +} + +richlistitem[typeName="download"][state="4"] { + -moz-binding: url("chrome://browser/content/bindings/downloads.xml#download-paused"); +} diff --git a/chrome/content/browser.js b/chrome/content/browser.js --- a/chrome/content/browser.js +++ b/chrome/content/browser.js @@ -1014,6 +1014,12 @@ return Browser.getNotificationBox(); } +function showDownloadsManager(aWindowContext, aID, aReason) { + BrowserUI.show(UIMODE_PANEL); + BrowserUI.switchPane("downloads-container"); + // TODO: select the download with aID +} + var AlertsHelper = { _timeoutID: -1, _listener: null, diff --git a/chrome/content/browser.xul b/chrome/content/browser.xul --- a/chrome/content/browser.xul +++ b/chrome/content/browser.xul @@ -75,6 +75,7 @@