Bug 1448810 - Rename the Places sidebar files and merge sidebarUtils into PlacesUIUtils. r=standard8 draft
authorMarco Bonardo <mbonardo@mozilla.com>
Mon, 26 Mar 2018 21:15:41 +0200
changeset 772795 6394e16be1df21d182647ea06c4cf592e8136071
parent 772522 f0d13136b3580182df241674cf97a3fbf1543c2a
push id104047
push usermak77@bonardo.net
push dateMon, 26 Mar 2018 22:59:52 +0000
reviewersstandard8
bugs1448810
milestone61.0a1
Bug 1448810 - Rename the Places sidebar files and merge sidebarUtils into PlacesUIUtils. r=standard8 MozReview-Commit-ID: GsPPBhiTPul
browser/base/content/browser-sets.inc
browser/components/places/PlacesUIUtils.jsm
browser/components/places/content/bookmarksPanel.js
browser/components/places/content/bookmarksPanel.xul
browser/components/places/content/bookmarksSidebar.js
browser/components/places/content/bookmarksSidebar.xul
browser/components/places/content/history-panel.js
browser/components/places/content/history-panel.xul
browser/components/places/content/historySidebar.js
browser/components/places/content/historySidebar.xul
browser/components/places/content/organizer.css
browser/components/places/content/places.css
browser/components/places/content/places.xul
browser/components/places/content/sidebarUtils.js
browser/components/places/jar.mn
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -115,25 +115,23 @@
              oncommand="zoomWindow();" />
 #endif
   </commandset>
 
 #include ../../components/places/content/placesCommands.inc.xul
 
   <broadcasterset id="mainBroadcasterSet">
     <broadcaster id="viewBookmarksSidebar" autoCheck="false" label="&bookmarksButton.label;"
-                 type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/bookmarks/bookmarksPanel.xul"
+                 type="checkbox" group="sidebar"
+                 sidebarurl="chrome://browser/content/places/bookmarksSidebar.xul"
                  oncommand="SidebarUI.toggle('viewBookmarksSidebar');"/>
 
-    <!-- for both places and non-places, the sidebar lives at
-         chrome://browser/content/history/history-panel.xul so there are no
-         problems when switching between versions -->
     <broadcaster id="viewHistorySidebar" autoCheck="false" sidebartitle="&historyButton.label;"
                  type="checkbox" group="sidebar"
-                 sidebarurl="chrome://browser/content/history/history-panel.xul"
+                 sidebarurl="chrome://browser/content/places/historySidebar.xul"
                  oncommand="SidebarUI.toggle('viewHistorySidebar');"/>
 
     <broadcaster id="viewWebPanelsSidebar" autoCheck="false"
                  type="checkbox" group="sidebar" sidebarurl="chrome://browser/content/web-panels.xul"
                  oncommand="SidebarUI.toggle('viewWebPanelsSidebar');"/>
 
     <broadcaster id="bookmarkThisPageBroadcaster"
                  label="&bookmarkThisPageCmd.label;"
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -5,23 +5,24 @@
 
 var EXPORTED_SYMBOLS = ["PlacesUIUtils"];
 
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
 
 XPCOMUtils.defineLazyModuleGetters(this, {
+  AppConstants: "resource://gre/modules/AppConstants.jsm",
   OpenInTabsUtils: "resource:///modules/OpenInTabsUtils.jsm",
+  PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
   PlacesUtils: "resource://gre/modules/PlacesUtils.jsm",
   PluralForm: "resource://gre/modules/PluralForm.jsm",
   PrivateBrowsingUtils: "resource://gre/modules/PrivateBrowsingUtils.jsm",
+  PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
   RecentWindow: "resource:///modules/RecentWindow.jsm",
-  PromiseUtils: "resource://gre/modules/PromiseUtils.jsm",
-  PlacesTransactions: "resource://gre/modules/PlacesTransactions.jsm",
   Weave: "resource://services-sync/main.js",
 });
 
 XPCOMUtils.defineLazyGetter(this, "bundle", function() {
   return Services.strings.createBundle("chrome://browser/locale/places/places.properties");
 });
 
 const gInContentProcess = Services.appinfo.processType == Ci.nsIXULRuntime.PROCESS_TYPE_CONTENT;
@@ -1026,16 +1027,104 @@ var PlacesUIUtils = {
     }
 
     await this.batchUpdatesForNode(resultForBatching, itemsCount, async () => {
       await PlacesTransactions.batch(batchingItem);
     });
 
     return guidsToSelect;
   },
+
+  onSidebarTreeClick(event) {
+    // right-clicks are not handled here
+    if (event.button == 2)
+      return;
+
+    let tree = event.target.parentNode;
+    let tbo = tree.treeBoxObject;
+    let cell = tbo.getCellAt(event.clientX, event.clientY);
+    if (cell.row == -1 || cell.childElt == "twisty")
+      return;
+
+    // getCoordsForCellItem returns the x coordinate in logical coordinates
+    // (i.e., starting from the left and right sides in LTR and RTL modes,
+    // respectively.)  Therefore, we make sure to exclude the blank area
+    // before the tree item icon (that is, to the left or right of it in
+    // LTR and RTL modes, respectively) from the click target area.
+    let win = tree.ownerGlobal;
+    let rect = tbo.getCoordsForCellItem(cell.row, cell.col, "image");
+    let isRTL = win.getComputedStyle(tree).direction == "rtl";
+    let mouseInGutter = isRTL ? event.clientX > rect.x
+                              : event.clientX < rect.x;
+
+    let metaKey = AppConstants.platform === "macosx" ? event.metaKey
+                                                     : event.ctrlKey;
+    let modifKey = metaKey || event.shiftKey;
+    let isContainer = tbo.view.isContainer(cell.row);
+    let openInTabs = isContainer &&
+                     (event.button == 1 || (event.button == 0 && modifKey)) &&
+                     PlacesUtils.hasChildURIs(tree.view.nodeForTreeIndex(cell.row));
+
+    if (event.button == 0 && isContainer && !openInTabs) {
+      tbo.view.toggleOpenState(cell.row);
+    } else if (!mouseInGutter && openInTabs &&
+               event.originalTarget.localName == "treechildren") {
+      tbo.view.selection.select(cell.row);
+      this.openContainerNodeInTabs(tree.selectedNode, event, tree);
+    } else if (!mouseInGutter && !isContainer &&
+               event.originalTarget.localName == "treechildren") {
+      // Clear all other selection since we're loading a link now. We must
+      // do this *before* attempting to load the link since openURL uses
+      // selection as an indication of which link to load.
+      tbo.view.selection.select(cell.row);
+      this.openNodeWithEvent(tree.selectedNode, event);
+    }
+  },
+
+  onSidebarTreeKeyPress(event) {
+    let node = event.target.selectedNode;
+    if (node) {
+      if (event.keyCode == KeyEvent.DOM_VK_RETURN)
+        this.openNodeWithEvent(node, event);
+    }
+  },
+
+  /**
+   * The following function displays the URL of a node that is being
+   * hovered over.
+   */
+  onSidebarTreeMouseMove(event) {
+    let treechildren = event.target;
+    if (treechildren.localName != "treechildren")
+      return;
+
+    let tree = treechildren.parentNode;
+    let cell = tree.treeBoxObject.getCellAt(event.clientX, event.clientY);
+
+    // cell.row is -1 when the mouse is hovering an empty area within the tree.
+    // To avoid showing a URL from a previously hovered node for a currently
+    // hovered non-url node, we must clear the moused-over URL in these cases.
+    if (cell.row != -1) {
+      let node = tree.view.nodeForTreeIndex(cell.row);
+      if (PlacesUtils.nodeIsURI(node)) {
+        this.setMouseoverURL(node.uri, tree.ownerGlobal);
+        return;
+      }
+    }
+    this.setMouseoverURL("", tree.ownerGlobal);
+  },
+
+  setMouseoverURL(url, win) {
+    // When the browser window is closed with an open sidebar, the sidebar
+    // unload event happens after the browser's one.  In this case
+    // top.XULBrowserWindow has been nullified already.
+    if (win.top.XULBrowserWindow) {
+      win.top.XULBrowserWindow.setOverLink(url, null);
+    }
+  }
 };
 
 // These are lazy getters to avoid importing PlacesUtils immediately.
 XPCOMUtils.defineLazyGetter(PlacesUIUtils, "PLACES_FLAVORS", () => {
   return [PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER,
           PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR,
           PlacesUtils.TYPE_X_MOZ_PLACE];
 });
rename from browser/components/places/content/bookmarksPanel.js
rename to browser/components/places/content/bookmarksSidebar.js
--- a/browser/components/places/content/bookmarksPanel.js
+++ b/browser/components/places/content/bookmarksSidebar.js
@@ -1,16 +1,21 @@
 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
 
 function init() {
+  let uidensity = window.top.document.documentElement.getAttribute("uidensity");
+  if (uidensity) {
+    document.documentElement.setAttribute("uidensity", uidensity);
+  }
+
   document.getElementById("bookmarks-view").place =
     "place:type=" + Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY;
 }
 
 function searchBookmarks(aSearchString) {
   var tree = document.getElementById("bookmarks-view");
   if (!aSearchString)
     tree.place = tree.place;
rename from browser/components/places/content/bookmarksPanel.xul
rename to browser/components/places/content/bookmarksSidebar.xul
--- a/browser/components/places/content/bookmarksPanel.xul
+++ b/browser/components/places/content/bookmarksSidebar.xul
@@ -1,34 +1,32 @@
-<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- -->
+<?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
 <!-- This Source Code Form is subject to the terms of the Mozilla Public
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
+<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://browser/content/places/places.css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
-<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
-%editMenuOverlayDTD;
+<!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
+%editMenuDTD;
 ]>
 
 <page id="bookmarksPanel"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       onload="init();"
-      onunload="SidebarUtils.setMouseoverURL('');">
+      onunload="PlacesUIUtils.setMouseoverURL('', window);">
 
   <script type="application/javascript"
-          src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
-  <script type="application/javascript"
-          src="chrome://browser/content/bookmarks/bookmarksPanel.js"/>
+          src="chrome://browser/content/places/bookmarksSidebar.js"/>
   <script type="application/javascript"
           src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"><![CDATA[
     ChromeUtils.defineModuleGetter(window,
       "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
     ChromeUtils.defineModuleGetter(window,
@@ -51,23 +49,25 @@
 
   <hbox id="sidebar-search-container" align="center">
     <textbox id="search-box" flex="1" type="search"
              placeholder="&bookmarksSearch.placeholder;"
              aria-controls="bookmarks-view"
              oncommand="searchBookmarks(this.value);"/>
   </hbox>
 
-  <tree id="bookmarks-view" class="sidebar-placesTree" type="places"
+  <tree id="bookmarks-view"
+        class="sidebar-placesTree"
+        type="places"
         flex="1"
         hidecolumnpicker="true"
         context="placesContext"
-        onkeypress="SidebarUtils.handleTreeKeyPress(event);"
-        onclick="SidebarUtils.handleTreeClick(this, event, true);"
-        onmousemove="SidebarUtils.handleTreeMouseMove(event);"
-        onmouseout="SidebarUtils.setMouseoverURL('');">
+        onkeypress="PlacesUIUtils.onSidebarTreeKeyPress(event);"
+        onclick="PlacesUIUtils.onSidebarTreeClick(event);"
+        onmousemove="PlacesUIUtils.onSidebarTreeMouseMove(event);"
+        onmouseout="PlacesUIUtils.setMouseoverURL('', window);">
     <treecols>
       <treecol id="title" flex="1" primary="true" hideheader="true"/>
     </treecols>
-    <treechildren id="bookmarks-view-children" view="bookmarks-view"
+    <treechildren view="bookmarks-view"
                   class="sidebar-placesTreechildren" flex="1" tooltip="bhTooltip"/>
   </tree>
 </page>
rename from browser/components/places/content/history-panel.js
rename to browser/components/places/content/historySidebar.js
--- a/browser/components/places/content/history-panel.js
+++ b/browser/components/places/content/historySidebar.js
@@ -8,16 +8,21 @@
 ChromeUtils.import("resource://gre/modules/TelemetryStopwatch.jsm");
 
 var gHistoryTree;
 var gSearchBox;
 var gHistoryGrouping = "";
 var gSearching = false;
 
 function HistorySidebarInit() {
+  let uidensity = window.top.document.documentElement.getAttribute("uidensity");
+  if (uidensity) {
+    document.documentElement.setAttribute("uidensity", uidensity);
+  }
+
   gHistoryTree = document.getElementById("historyTree");
   gSearchBox = document.getElementById("search-box");
 
   gHistoryGrouping = document.getElementById("viewButton").
                               getAttribute("selectedsort");
 
   if (gHistoryGrouping == "site")
     document.getElementById("bysite").setAttribute("checked", "true");
@@ -79,17 +84,17 @@ function searchHistory(aInput) {
   options.sortingMode = sortingMode;
   options.resultType = resultType;
   options.includeHidden = !!aInput;
 
   if (gHistoryGrouping == "lastvisited")
     this.TelemetryStopwatch.start("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
 
   // call load() on the tree manually
-  // instead of setting the place attribute in history-panel.xul
+  // instead of setting the place attribute in historySidebar.xul
   // otherwise, we will end up calling load() twice
   gHistoryTree.load(query, options);
 
   if (gHistoryGrouping == "lastvisited")
     this.TelemetryStopwatch.finish("HISTORY_LASTVISITED_TREE_QUERY_TIME_MS");
 }
 
 window.addEventListener("SidebarFocused",
rename from browser/components/places/content/history-panel.xul
rename to browser/components/places/content/historySidebar.xul
--- a/browser/components/places/content/history-panel.xul
+++ b/browser/components/places/content/historySidebar.xul
@@ -1,37 +1,32 @@
 <?xml version="1.0"?> <!-- -*- Mode: xml; indent-tabs-mode: nil; -*- -->
-
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+<!-- This Source Code Form is subject to the terms of the Mozilla Public
+   - License, v. 2.0. If a copy of the MPL was not distributed with this
+   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
 <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
 
 <!DOCTYPE page [
 <!ENTITY % placesDTD SYSTEM "chrome://browser/locale/places/places.dtd">
 %placesDTD;
 <!ENTITY % editMenuDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
 %editMenuDTD;
 ]>
 
-<!-- we need to keep id="history-panel" for upgrade and switching
-     between versions of the browser -->
-
-<page id="history-panel" orient="vertical"
+<page id="history-panel"
+      orient="vertical"
       xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       onload="HistorySidebarInit();"
-      onunload="SidebarUtils.setMouseoverURL('');">
+      onunload="PlacesUIUtils.setMouseoverURL('', window);">
 
   <script type="application/javascript"
-          src="chrome://browser/content/bookmarks/sidebarUtils.js"/>
-  <script type="application/javascript"
-          src="chrome://browser/content/places/history-panel.js"/>
+          src="chrome://browser/content/places/historySidebar.js"/>
   <script type="application/javascript"
           src="chrome://global/content/globalOverlay.js"/>
   <script type="application/javascript"
           src="chrome://browser/content/utilityOverlay.js"/>
   <script type="application/javascript"><![CDATA[
     ChromeUtils.defineModuleGetter(window,
       "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
     ChromeUtils.defineModuleGetter(window,
@@ -91,20 +86,20 @@
       </menupopup>
     </button>
   </hbox>
 
   <tree id="historyTree"
         class="sidebar-placesTree"
         flex="1"
         type="places"
+        hidecolumnpicker="true"
         context="placesContext"
-        hidecolumnpicker="true"
-        onkeypress="SidebarUtils.handleTreeKeyPress(event);"
-        onclick="SidebarUtils.handleTreeClick(this, event, true);"
-        onmousemove="SidebarUtils.handleTreeMouseMove(event);"
-        onmouseout="SidebarUtils.setMouseoverURL('');">
+        onkeypress="PlacesUIUtils.onSidebarTreeKeyPress(event);"
+        onclick="PlacesUIUtils.onSidebarTreeClick(event);"
+        onmousemove="PlacesUIUtils.onSidebarTreeMouseMove(event);"
+        onmouseout="PlacesUIUtils.setMouseoverURL('', window);">
     <treecols>
       <treecol id="title" flex="1" primary="true" hideheader="true"/>
     </treecols>
     <treechildren class="sidebar-placesTreechildren" flex="1" tooltip="bhTooltip"/>
   </tree>
 </page>
deleted file mode 100644
--- a/browser/components/places/content/organizer.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#searchFilter {
-  width: 23em;
-}
--- a/browser/components/places/content/places.css
+++ b/browser/components/places/content/places.css
@@ -30,8 +30,12 @@ menupopup[placespopup="true"] {
 /* Apply crisp rendering for favicons at exactly 2dppx resolution */
 @media (resolution: 2dppx) {
   #bookmarksChildren,
   .sidebar-placesTreechildren,
   .placesTree > treechildren {
     image-rendering: -moz-crisp-edges;
   }
 }
+
+#searchFilter {
+  max-width: 23em;
+}
--- a/browser/components/places/content/places.xul
+++ b/browser/components/places/content/places.xul
@@ -1,16 +1,15 @@
 <?xml version="1.0"?>
 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
-<?xml-stylesheet href="chrome://browser/content/places/organizer.css"?>
 
 <?xml-stylesheet href="chrome://global/skin/"?>
 <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/organizer.css"?>
 <?xml-stylesheet href="chrome://browser/skin/places/editBookmark.css"?>
 
 <?xml-stylesheet href="chrome://browser/content/downloads/downloads.css"?>
 <?xml-stylesheet href="chrome://browser/skin/downloads/allDownloadsView.css"?>
@@ -348,16 +347,17 @@
 #else
         </menu>
       </menubar>
 #endif
 
       <spacer id="libraryToolbarSpacer" flex="1"/>
 
       <textbox id="searchFilter"
+               flex="1"
                type="search"
                aria-controls="placeContent"
                oncommand="PlacesSearchBox.search(this.value);"
                collection="bookmarks">
       </textbox>
       <toolbarbutton id="clearDownloadsButton"
 #ifdef XP_MACOSX
                      class="tabbable"
deleted file mode 100644
--- a/browser/components/places/content/sidebarUtils.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* import-globals-from ../PlacesUIUtils.jsm */
-/* import-globals-from ../../../../toolkit/components/places/PlacesUtils.jsm */
-
-ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
-
-let uidensity = window.top.document.documentElement.getAttribute("uidensity");
-if (uidensity) {
-  document.documentElement.setAttribute("uidensity", uidensity);
-}
-
-var SidebarUtils = {
-  handleTreeClick: function SU_handleTreeClick(aTree, aEvent, aGutterSelect) {
-    // right-clicks are not handled here
-    if (aEvent.button == 2)
-      return;
-
-    var tbo = aTree.treeBoxObject;
-    var cell = tbo.getCellAt(aEvent.clientX, aEvent.clientY);
-
-    if (cell.row == -1 || cell.childElt == "twisty")
-      return;
-
-    var mouseInGutter = false;
-    if (aGutterSelect) {
-      var rect = tbo.getCoordsForCellItem(cell.row, cell.col, "image");
-      // getCoordsForCellItem returns the x coordinate in logical coordinates
-      // (i.e., starting from the left and right sides in LTR and RTL modes,
-      // respectively.)  Therefore, we make sure to exclude the blank area
-      // before the tree item icon (that is, to the left or right of it in
-      // LTR and RTL modes, respectively) from the click target area.
-      var isRTL = window.getComputedStyle(aTree).direction == "rtl";
-      if (isRTL)
-        mouseInGutter = aEvent.clientX > rect.x;
-      else
-        mouseInGutter = aEvent.clientX < rect.x;
-    }
-
-    var metaKey = AppConstants.platform === "macosx" ? aEvent.metaKey
-                                                     : aEvent.ctrlKey;
-    var modifKey = metaKey || aEvent.shiftKey;
-    var isContainer = tbo.view.isContainer(cell.row);
-    var openInTabs = isContainer &&
-                     (aEvent.button == 1 ||
-                      (aEvent.button == 0 && modifKey)) &&
-                     PlacesUtils.hasChildURIs(aTree.view.nodeForTreeIndex(cell.row));
-
-    if (aEvent.button == 0 && isContainer && !openInTabs) {
-      tbo.view.toggleOpenState(cell.row);
-    } else if (!mouseInGutter && openInTabs &&
-            aEvent.originalTarget.localName == "treechildren") {
-      tbo.view.selection.select(cell.row);
-      PlacesUIUtils.openContainerNodeInTabs(aTree.selectedNode, aEvent, aTree);
-    } else if (!mouseInGutter && !isContainer &&
-             aEvent.originalTarget.localName == "treechildren") {
-      // Clear all other selection since we're loading a link now. We must
-      // do this *before* attempting to load the link since openURL uses
-      // selection as an indication of which link to load.
-      tbo.view.selection.select(cell.row);
-      PlacesUIUtils.openNodeWithEvent(aTree.selectedNode, aEvent);
-    }
-  },
-
-  handleTreeKeyPress: function SU_handleTreeKeyPress(aEvent) {
-    let node = aEvent.target.selectedNode;
-    if (node) {
-      if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN)
-        PlacesUIUtils.openNodeWithEvent(node, aEvent);
-    }
-  },
-
-  /**
-   * The following function displays the URL of a node that is being
-   * hovered over.
-   */
-  handleTreeMouseMove: function SU_handleTreeMouseMove(aEvent) {
-    if (aEvent.target.localName != "treechildren")
-      return;
-
-    var tree = aEvent.target.parentNode;
-    var tbo = tree.treeBoxObject;
-    var cell = tbo.getCellAt(aEvent.clientX, aEvent.clientY);
-
-    // cell.row is -1 when the mouse is hovering an empty area within the tree.
-    // To avoid showing a URL from a previously hovered node for a currently
-    // hovered non-url node, we must clear the moused-over URL in these cases.
-    if (cell.row != -1) {
-      var node = tree.view.nodeForTreeIndex(cell.row);
-      if (PlacesUtils.nodeIsURI(node))
-        this.setMouseoverURL(node.uri);
-      else
-        this.setMouseoverURL("");
-    } else
-      this.setMouseoverURL("");
-  },
-
-  setMouseoverURL: function SU_setMouseoverURL(aURL) {
-    // When the browser window is closed with an open sidebar, the sidebar
-    // unload event happens after the browser's one.  In this case
-    // top.XULBrowserWindow has been nullified already.
-    if (top.XULBrowserWindow) {
-      top.XULBrowserWindow.setOverLink(aURL, null);
-    }
-  }
-};
--- a/browser/components/places/jar.mn
+++ b/browser/components/places/jar.mn
@@ -4,25 +4,20 @@
 
 browser.jar:
 # Provide another URI for the bookmarkProperties dialog so we can persist the
 # attributes separately
 *   content/browser/places/bookmarkProperties2.xul       (content/bookmarkProperties.xul)
 *   content/browser/places/places.xul                    (content/places.xul)
     content/browser/places/places.js                     (content/places.js)
     content/browser/places/places.css                    (content/places.css)
-    content/browser/places/organizer.css                 (content/organizer.css)
 *   content/browser/places/bookmarkProperties.xul        (content/bookmarkProperties.xul)
     content/browser/places/bookmarkProperties.js         (content/bookmarkProperties.js)
     content/browser/places/menu.xml                      (content/menu.xml)
     content/browser/places/tree.xml                      (content/tree.xml)
     content/browser/places/controller.js                 (content/controller.js)
     content/browser/places/treeView.js                   (content/treeView.js)
     content/browser/places/browserPlacesViews.js         (content/browserPlacesViews.js)
-# keep the Places version of the history sidebar at history/history-panel.xul
-# to prevent having to worry about between versions of the browser
-*   content/browser/history/history-panel.xul            (content/history-panel.xul)
-    content/browser/places/history-panel.js              (content/history-panel.js)
-# ditto for the bookmarks sidebar
-*   content/browser/bookmarks/bookmarksPanel.xul         (content/bookmarksPanel.xul)
-    content/browser/bookmarks/bookmarksPanel.js          (content/bookmarksPanel.js)
-    content/browser/bookmarks/sidebarUtils.js            (content/sidebarUtils.js)
+*   content/browser/places/historySidebar.xul            (content/historySidebar.xul)
+    content/browser/places/historySidebar.js             (content/historySidebar.js)
+*   content/browser/places/bookmarksSidebar.xul          (content/bookmarksSidebar.xul)
+    content/browser/places/bookmarksSidebar.js           (content/bookmarksSidebar.js)
     content/browser/places/editBookmark.js               (content/editBookmark.js)