mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-09 21:33:43 +00:00
Bug 825060 - Enable the new Library Downloads view by default when the panel is enabled.
r=mconley
This commit is contained in:
parent
20dbf380a1
commit
ed0d87ed1c
@ -107,28 +107,11 @@ DownloadsUI.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function that opens the right download manager UI. Either the
|
||||
* new Downloads View in Places, or the toolkit download window if the
|
||||
* Places Downloads View is not enabled.
|
||||
* Helper function that opens the download manager UI.
|
||||
*/
|
||||
_showDownloadManagerUI:
|
||||
function DUI_showDownloadManagerUI(aWindowContext, aID, aReason)
|
||||
{
|
||||
// First, determine if the Places Downloads view is preffed on.
|
||||
let usePlacesView = false;
|
||||
try {
|
||||
usePlacesView =
|
||||
Services.prefs.getBoolPref("browser.library.useNewDownloadsView");
|
||||
} catch(e) {}
|
||||
|
||||
if (!usePlacesView) {
|
||||
// If we got here, then the browser.library.useNewDownloadsView pref
|
||||
// either didn't exist or was false, so just show the toolkit downloads
|
||||
// manager.
|
||||
this._toolkitUI.show(aWindowContext, aID, aReason);
|
||||
return;
|
||||
}
|
||||
|
||||
let organizer = Services.wm.getMostRecentWindow("Places:Organizer");
|
||||
if (!organizer) {
|
||||
let parentWindow = aWindowContext;
|
||||
|
@ -8,21 +8,13 @@
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script type="application/javascript"><![CDATA[
|
||||
let useNewView = false;
|
||||
try {
|
||||
useNewView = Services.prefs.getBoolPref("browser.library.useNewDownloadsView");
|
||||
}
|
||||
catch(ex) { }
|
||||
const DOWNLOADS_QUERY = "place:transition=" +
|
||||
Components.interfaces.nsINavHistoryService.TRANSITION_DOWNLOAD +
|
||||
"&sort=" +
|
||||
Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
|
||||
|
||||
if (useNewView) {
|
||||
const DOWNLOADS_QUERY = "place:transition=" +
|
||||
Components.interfaces.nsINavHistoryService.TRANSITION_DOWNLOAD +
|
||||
"&sort=" +
|
||||
Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
|
||||
|
||||
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
|
||||
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")));
|
||||
}
|
||||
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
|
||||
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")));
|
||||
]]></script>
|
||||
|
||||
<window id="places">
|
||||
|
Loading…
Reference in New Issue
Block a user