Backed out changeset cce44d592e67 (bug 822848)
authorJosh Matthews <josh@joshmatthews.net>
Thu, 27 Dec 2012 20:44:20 -0500
changeset 117148 311689a4858f49c62e7377e8ec0e7d6edc379bff
parent 117147 a17555ed859b310bfc52b153c42994c8b5491d99
child 117149 91c3020669f0bb7884fa8e033d28aa3d1af250c7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs822848
milestone20.0a1
backs outcce44d592e674fc93e39c0c19bc0616c7394b8b8
Backed out changeset cce44d592e67 (bug 822848)
browser/components/downloads/content/allDownloadsViewOverlay.js
browser/components/places/content/downloadsViewOverlay.xul
browser/components/places/content/places.js
--- a/browser/components/downloads/content/allDownloadsViewOverlay.js
+++ b/browser/components/downloads/content/allDownloadsViewOverlay.js
@@ -877,18 +877,18 @@ DownloadsPlacesView.prototype = {
 
     return val;
   },
 
   get selectedNodes() {
     let placesNodes = [];
     let selectedElements = this._richlistbox.selectedItems;
     for (let elt of selectedElements) {
-      if (elt._shell.placesNode)
-        placesNodes.push(elt._shell.placesNode);
+      if (elt.placesNode)
+        placesNodes.push(elt.placesNode);
     }
     return placesNodes;
   },
 
   get selectedNode() {
     let selectedNodes = this.selectedNodes;
     return selectedNodes.length == 1 ? selectedNodes[0] : null;
   },
--- a/browser/components/places/content/downloadsViewOverlay.xul
+++ b/browser/components/places/content/downloadsViewOverlay.xul
@@ -9,18 +9,17 @@
 
   <script type="application/javascript"><![CDATA[
     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")),
-      { showDetailsPane: false });
+      function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox")));
   ]]></script>
 
   <window id="places">
     <commandset id="downloadCommands"/>
     <menupopup id="downloadsContextMenu"/>
   </window>
 
   <deck id="placesViewsDeck">
--- a/browser/components/places/content/places.js
+++ b/browser/components/places/content/places.js
@@ -269,23 +269,16 @@ var PlacesOrganizer = {
       }
     }
   },
 
   /**
    * Handle focus changes on the places list and the current content view.
    */
   updateDetailsPane: function PO_updateDetailsPane() {
-    let detailsDeck = document.getElementById("detailsDeck");
-    let detailsPaneDisabled = detailsDeck.hidden =
-      !ContentArea.currentViewOptions.showDetailsPane;
-    if (detailsPaneDisabled) {
-      return;
-    }
-
     let view = PlacesUIUtils.getViewForNode(document.activeElement);
     if (view) {
       let selectedNodes = view.selectedNode ?
                           [view.selectedNode] : view.selectedNodes;
       this._fillDetailsPane(selectedNodes);
     }
   },
 
@@ -1263,20 +1256,20 @@ let ContentArea = {
    * @param aQueryString
    *        a query string
    * @return the view to be used for loading aQueryString.
    */
   getContentViewForQueryString:
   function CA_getContentViewForQueryString(aQueryString) {
     try {
       if (this._specialViews.has(aQueryString)) {
-        let { view, options } = this._specialViews.get(aQueryString);
+        let view = this._specialViews.get(aQueryString);
         if (typeof view == "function") {
           view = view();
-          this._specialViews.set(aQueryString, { view: view, options: options });
+          this._specialViews.set(aQueryString, view);
         }
         return view;
       }
     }
     catch(ex) {
       Cu.reportError(ex);
     }
     return ContentTree.view;
@@ -1285,75 +1278,52 @@ let ContentArea = {
   /**
    * Sets a custom view to be used rather than the default places tree
    * whenever the given query is selected in the left pane.
    * @param aQueryString
    *        a query string
    * @param aView
    *        Either the custom view or a function that will return the view
    *        the first (and only) time it's called.
-   * @param [optional] aOptions
-   *        Object defining special options for the view.
-   * @see ContentTree.viewOptions for supported options and default values.
    */
   setContentViewForQueryString:
-  function CA_setContentViewForQueryString(aQueryString, aView, aOptions) {
+  function CA_setContentViewForQueryString(aQueryString, aView) {
     if (!aQueryString ||
         typeof aView != "object" && typeof aView != "function")
       throw new Error("Invalid arguments");
 
-    this._specialViews.set(aQueryString, { view: aView,
-                                           options: aOptions || new Object() });
+    this._specialViews.set(aQueryString, aView);
   },
 
   get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel),
   set currentView(aView) {
     if (this.currentView != aView)
       this._deck.selectedPanel = aView.associatedElement;
     return aView;
   },
 
   get currentPlace() this.currentView.place,
   set currentPlace(aQueryString) {
     this.currentView = this.getContentViewForQueryString(aQueryString);
     this.currentView.place = aQueryString;
     return aQueryString;
   },
 
-  /**
-   * Options for the current view.
-   *
-   * @see ContentTree.viewOptions for supported options and default values.
-   */
-  get currentViewOptions() {
-    // Use ContentTree options as default.
-    let viewOptions = ContentTree.viewOptions;
-    if (this._specialViews.has(this.currentPlace)) {
-      let { view, options } = this._specialViews.get(this.currentPlace);
-      for (let option in options) {
-        viewOptions[option] = options[option];
-      }
-    }
-    return viewOptions;
-  },
-
   focus: function() {
     this._deck.selectedPanel.focus();
   }
 };
 
 let ContentTree = {
   init: function CT_init() {
     this._view = document.getElementById("placeContent");
   },
 
   get view() this._view,
 
-  get viewOptions() Object.seal({ showDetailsPane: true }),
-
   openSelectedNode: function CT_openSelectedNode(aEvent) {
     let view = this.view;
     PlacesUIUtils.openNodeWithEvent(view.selectedNode, aEvent, view);
   },
 
   onClick: function CT_onClick(aEvent) {
     // Only handle clicks on tree children.
     if (aEvent.target.localName != "treechildren")