Bug 1378089 - Part 2. Mass rename bookmarks files and dirs to corresponding Firefox ones. r=IanN a=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Sat, 03 Feb 2018 19:14:37 +0100
changeset 31458 1073c50c7d8c
parent 31457 49d90f6c578a
child 31459 2516f9f3631a
push id383
push userclokep@gmail.com
push date2018-05-07 21:52 +0000
reviewersIanN, IanN
bugs1378089
Bug 1378089 - Part 2. Mass rename bookmarks files and dirs to corresponding Firefox ones. r=IanN a=IanN
suite/browser/browser-places.js
suite/common/bookmarks/bm-panel.js
suite/common/bookmarks/bm-panel.xul
suite/common/bookmarks/bm-props.js
suite/common/bookmarks/bm-props.xul
suite/common/bookmarks/bookmarksManager.css
suite/common/bookmarks/bookmarksManager.js
suite/common/bookmarks/bookmarksManager.xul
suite/common/bookmarks/browser-places.js
suite/common/bookmarks/editBookmarkOverlay.js
suite/common/bookmarks/editBookmarkOverlay.xul
suite/common/bookmarks/moveBookmarks.js
suite/common/bookmarks/moveBookmarks.xul
suite/common/bookmarks/placesOverlay.xul
suite/common/history/controller.js
suite/common/history/history-panel.xul
suite/common/history/history.js
suite/common/history/history.xul
suite/common/history/places.css
suite/common/history/placesOverlay.xul
suite/common/history/tree.xml
suite/common/history/treeView.js
suite/common/places/PlacesUIUtils.jsm
suite/common/places/browserPlacesViews.js
suite/common/places/content/bookmarkProperties.js
suite/common/places/content/bookmarkProperties.xul
suite/common/places/content/bookmarksPanel.js
suite/common/places/content/bookmarksPanel.xul
suite/common/places/content/browserPlacesViews.js
suite/common/places/content/controller.js
suite/common/places/content/editBookmarkOverlay.js
suite/common/places/content/editBookmarkOverlay.xul
suite/common/places/content/history-panel.js
suite/common/places/content/history-panel.xul
suite/common/places/content/menu.xml
suite/common/places/content/moveBookmarks.js
suite/common/places/content/moveBookmarks.xul
suite/common/places/content/organizer.css
suite/common/places/content/places.css
suite/common/places/content/places.js
suite/common/places/content/places.xul
suite/common/places/content/placesOverlay.xul
suite/common/places/content/sidebarUtils.js
suite/common/places/content/tree.xml
suite/common/places/content/treeView.js
suite/common/places/controller.js
suite/common/places/menu.xml
suite/common/places/places.css
suite/common/places/sidebarUtils.js
suite/common/places/tree.xml
suite/common/places/treeView.js
suite/locales/en-US/chrome/common/bookmarks/bm-props.properties
suite/locales/en-US/chrome/common/bookmarks/editBookmarkOverlay.dtd
suite/locales/en-US/chrome/common/bookmarks/moveBookmarks.dtd
suite/locales/en-US/chrome/common/bookmarks/places.dtd
suite/locales/en-US/chrome/common/history/history.dtd
suite/locales/en-US/chrome/common/places/bookmarkProperties.properties
suite/locales/en-US/chrome/common/places/editBookmarkOverlay.dtd
suite/locales/en-US/chrome/common/places/moveBookmarks.dtd
suite/locales/en-US/chrome/common/places/places.dtd
suite/modules/PlacesUIUtils.jsm
suite/themes/classic/communicator/bookmarks/allBookmarks.png
suite/themes/classic/communicator/bookmarks/bookmark-folder-closed.png
suite/themes/classic/communicator/bookmarks/bookmark-folder-dis.png
suite/themes/classic/communicator/bookmarks/bookmark-folder-open.png
suite/themes/classic/communicator/bookmarks/bookmark-item-dis.png
suite/themes/classic/communicator/bookmarks/bookmark-item-updated.png
suite/themes/classic/communicator/bookmarks/bookmark-item.svg
suite/themes/classic/communicator/bookmarks/bookmark.png
suite/themes/classic/communicator/bookmarks/bookmarks.css
suite/themes/classic/communicator/bookmarks/bookmarksManager.css
suite/themes/classic/communicator/bookmarks/bookmarksMenu.png
suite/themes/classic/communicator/bookmarks/bookmarksToolbar.css
suite/themes/classic/communicator/bookmarks/bookmarksToolbar.png
suite/themes/classic/communicator/bookmarks/bookmarksWindow.css
suite/themes/classic/communicator/bookmarks/editBookmarkOverlay.css
suite/themes/classic/communicator/bookmarks/livemark-folder.png
suite/themes/classic/communicator/bookmarks/query.png
suite/themes/classic/communicator/bookmarks/tag.png
suite/themes/classic/communicator/bookmarks/toolbarDropMarker.png
suite/themes/classic/communicator/bookmarks/unsortedBookmarks.png
suite/themes/classic/communicator/history/calendar.png
suite/themes/classic/communicator/places/allBookmarks.png
suite/themes/classic/communicator/places/bookmark-folder-closed.png
suite/themes/classic/communicator/places/bookmark-folder-dis.png
suite/themes/classic/communicator/places/bookmark-folder-open.png
suite/themes/classic/communicator/places/bookmark-item-dis.png
suite/themes/classic/communicator/places/bookmark-item-updated.png
suite/themes/classic/communicator/places/bookmark-item.svg
suite/themes/classic/communicator/places/bookmark.png
suite/themes/classic/communicator/places/bookmarks.css
suite/themes/classic/communicator/places/bookmarksMenu.png
suite/themes/classic/communicator/places/bookmarksToolbar.css
suite/themes/classic/communicator/places/bookmarksToolbar.png
suite/themes/classic/communicator/places/calendar.png
suite/themes/classic/communicator/places/editBookmarkOverlay.css
suite/themes/classic/communicator/places/livemark-folder.png
suite/themes/classic/communicator/places/organizer.css
suite/themes/classic/communicator/places/query.png
suite/themes/classic/communicator/places/tag.png
suite/themes/classic/communicator/places/toolbarDropMarker.png
suite/themes/classic/communicator/places/unsortedBookmarks.png
suite/themes/classic/mac/communicator/bookmarks/bookmarks.css
suite/themes/classic/mac/communicator/bookmarks/bookmarksManager.css
suite/themes/classic/mac/communicator/bookmarks/bookmarksMenu.png
suite/themes/classic/mac/communicator/bookmarks/bookmarksToolbar.css
suite/themes/classic/mac/communicator/bookmarks/bookmarksToolbar.png
suite/themes/classic/mac/communicator/bookmarks/editBookmarkOverlay.css
suite/themes/classic/mac/communicator/bookmarks/livemark-folder.png
suite/themes/classic/mac/communicator/bookmarks/query.png
suite/themes/classic/mac/communicator/bookmarks/tag.png
suite/themes/classic/mac/communicator/bookmarks/toolbarDropMarker.png
suite/themes/classic/mac/communicator/places/bookmarks.css
suite/themes/classic/mac/communicator/places/bookmarksMenu.png
suite/themes/classic/mac/communicator/places/bookmarksToolbar.css
suite/themes/classic/mac/communicator/places/bookmarksToolbar.png
suite/themes/classic/mac/communicator/places/editBookmarkOverlay.css
suite/themes/classic/mac/communicator/places/livemark-folder.png
suite/themes/classic/mac/communicator/places/places.css
suite/themes/classic/mac/communicator/places/query.png
suite/themes/classic/mac/communicator/places/tag.png
suite/themes/classic/mac/communicator/places/toolbarDropMarker.png
suite/themes/modern/communicator/bookmarks/allBookmarks.png
suite/themes/modern/communicator/bookmarks/bookmark-folder-closed.gif
suite/themes/modern/communicator/bookmarks/bookmark-folder-dis.gif
suite/themes/modern/communicator/bookmarks/bookmark-folder-open.gif
suite/themes/modern/communicator/bookmarks/bookmark-item-dis.gif
suite/themes/modern/communicator/bookmarks/bookmark-item-updated.gif
suite/themes/modern/communicator/bookmarks/bookmark-item.svg
suite/themes/modern/communicator/bookmarks/bookmark.png
suite/themes/modern/communicator/bookmarks/bookmarks.css
suite/themes/modern/communicator/bookmarks/bookmarksManager.css
suite/themes/modern/communicator/bookmarks/bookmarksMenu.png
suite/themes/modern/communicator/bookmarks/bookmarksToolbar.css
suite/themes/modern/communicator/bookmarks/bookmarksToolbar.png
suite/themes/modern/communicator/bookmarks/editBookmarkOverlay.css
suite/themes/modern/communicator/bookmarks/livemark-folder.png
suite/themes/modern/communicator/bookmarks/query.png
suite/themes/modern/communicator/bookmarks/tag.png
suite/themes/modern/communicator/bookmarks/toolbarDropMarker.png
suite/themes/modern/communicator/bookmarks/unsortedBookmarks.png
suite/themes/modern/communicator/history/calendar.png
suite/themes/modern/communicator/places/allBookmarks.png
suite/themes/modern/communicator/places/bookmark-folder-closed.gif
suite/themes/modern/communicator/places/bookmark-folder-dis.gif
suite/themes/modern/communicator/places/bookmark-folder-open.gif
suite/themes/modern/communicator/places/bookmark-item-dis.gif
suite/themes/modern/communicator/places/bookmark-item-updated.gif
suite/themes/modern/communicator/places/bookmark-item.svg
suite/themes/modern/communicator/places/bookmark.png
suite/themes/modern/communicator/places/bookmarks.css
suite/themes/modern/communicator/places/bookmarksMenu.png
suite/themes/modern/communicator/places/bookmarksToolbar.css
suite/themes/modern/communicator/places/bookmarksToolbar.png
suite/themes/modern/communicator/places/calendar.png
suite/themes/modern/communicator/places/editBookmarkOverlay.css
suite/themes/modern/communicator/places/livemark-folder.png
suite/themes/modern/communicator/places/organizer.css
suite/themes/modern/communicator/places/query.png
suite/themes/modern/communicator/places/tag.png
suite/themes/modern/communicator/places/toolbarDropMarker.png
suite/themes/modern/communicator/places/unsortedBookmarks.png
rename from suite/common/bookmarks/browser-places.js
rename to suite/browser/browser-places.js
deleted file mode 100755
--- a/suite/common/history/controller.js
+++ /dev/null
@@ -1,574 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 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/. */
-
-// XXXmano: we should move most/all of these constants to PlacesUtils
-const ORGANIZER_ROOT_BOOKMARKS = "place:folder=BOOKMARKS_MENU&excludeItems=1&queryType=1";
-const ORGANIZER_SUBSCRIPTIONS_QUERY = "place:annotation=livemark%2FfeedURI";
-
-// when removing a bunch of pages we split them in chunks to avoid passing
-// a too big array to RemovePages
-// 300 is the best choice with an history of about 150000 visits
-// smaller chunks could cause a Slow Script warning with a huge history
-const REMOVE_PAGES_CHUNKLEN = 300;
-// if we are removing less than this pages we will remove them one by one
-// since it will be reflected faster on the UI
-// 10 is a good compromise, since allows the user to delete a little amount of
-// urls for privacy reasons, but does not cause heavy disk access
-const REMOVE_PAGES_MAX_SINGLEREMOVES = 10;
-
-/**
- * Places Controller
- */
-
-function PlacesController(aView) {
-  this._view = aView;
-}
-
-PlacesController.prototype = {
-  /**
-   * The places view.
-   */
-  _view: null,
-
-  supportsCommand: function PC_supportsCommand(aCommand) {
-    //LOG("supportsCommand: " + command);
-    // Non-Places specific commands that we also support
-    switch (aCommand) {
-    case "cmd_cut":
-    case "cmd_copy":
-    case "cmd_delete":
-    case "cmd_selectAll":
-      return true;
-    }
-
-    // All other Places Commands are prefixed with "placesCmd_" ... this
-    // filters out other commands that we do _not_ support (see 329587).
-    return (/^placesCmd_/.test(aCommand));
-  },
-
-  isCommandEnabled: function PC_isCommandEnabled(aCommand) {
-    switch (aCommand) {
-    case "cmd_cut":
-    case "cmd_delete":
-      return true; // history items can always be deleted
-    case "cmd_copy":
-    case "placesCmd_open:window":
-    case "placesCmd_open:tab":
-      return this._view.hasSelection;
-    case "cmd_selectAll":
-      if (this._view.selType != "single") {
-        var rootNode = this._view.getResultNode();
-        if (rootNode.containerOpen && rootNode.childCount > 0)
-          return true;
-      }
-      return false;
-    case "placesCmd_open":
-      var selectedNode = this._view.selectedNode;
-      return selectedNode && PlacesUtils.nodeIsURI(selectedNode);
-    case "placesCmd_delete:hostname":
-      gDeleteByHostname.setAttribute("accesskey",
-                                     PlacesUIUtils.getString("delete.hostname.accesskey"));
-      if (gLastHostname) {
-        gDeleteByHostname.setAttribute("label",
-                                       PlacesUIUtils.getFormattedString("delete.hostname.true",
-                                                                        [gLastHostname]));
-        return true;
-      }
-      gDeleteByHostname.setAttribute("label",
-                                     PlacesUIUtils.getString("delete.hostname.false"));
-      return false;
-    case "placesCmd_delete:domain":
-      gDeleteByDomain.setAttribute("accesskey",
-                                   PlacesUIUtils.getString("delete.domain.accesskey"));
-      if (gLastDomain) {
-        gDeleteByDomain.setAttribute("label",
-                                     PlacesUIUtils.getFormattedString("delete.domain.true",
-                                                                      [gLastDomain]));
-        return true;
-      }
-      gDeleteByDomain.setAttribute("label",
-                                   PlacesUIUtils.getString("delete.domain.false"));
-      return false;
-    default:
-      return false;
-    }
-  },
-
-  doCommand: function PC_doCommand(aCommand) {
-    switch (aCommand) {
-    case "cmd_cut":
-      this.cut();
-      break;
-    case "cmd_copy":
-      this.copy();
-      break;
-    case "cmd_delete":
-      this._removeRowsFromHistory();
-      break;
-    case "cmd_selectAll":
-      this.selectAll();
-      break;
-    case "placesCmd_open":
-      PlacesUIUtils.openNodeIn(this._view.selectedNode, "current");
-      break;
-    case "placesCmd_open:window":
-      PlacesUIUtils.openSelectionIn(this._view.getSelectionNodes(), "window");
-      break;
-    case "placesCmd_open:tab":
-      PlacesUIUtils.openSelectionIn(this._view.getSelectionNodes(), "tab");
-      break;
-    case "placesCmd_delete:hostname":
-      PlacesUtils.history
-                 .QueryInterface(Ci.nsIBrowserHistory)
-                 .removePagesFromHost(gLastHostname, false);
-      break;
-    case "placesCmd_delete:domain":
-      PlacesUtils.history
-                 .QueryInterface(Ci.nsIBrowserHistory)
-                 .removePagesFromHost(gLastDomain, true);
-      break;
-    }
-  },
-
-  onEvent: function PC_onEvent(eventName) { },
-
-  /**
-   * Gathers information about the selected nodes according to the following
-   * rules:
-   *    "link"              node is a URI
-   *    "query"             node is a query
-   *    "host"              node is a host
-   *    "day"               node is a date query
-   *
-   * @returns an array of objects corresponding the selected nodes. Each
-   *          object has each of the properties above set if its corresponding
-   *          node matches the rule.
-   * Notes:
-   *   1) This can be slow, so don't call it anywhere performance critical!
-   *   2) A single-object array corresponding the root node is returned if
-   *      there's no selection.
-   */
-  _buildSelectionMetadata: function PC__buildSelectionMetadata() {
-    var metadata = [];
-    var root = this._view.getResultNode();
-    var nodes = this._view.getSelectionNodes();
-    if (nodes.length == 0)
-      nodes.push(root); // See the second note above
-
-    for (var i = 0; i < nodes.length; i++) {
-      var nodeData = {};
-      var node = nodes[i];
-      var nodeType = node.type;
-      var uri = null;
-
-      if (node.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_URI)
-        nodeData["link"] = true;
-      else {
-        nodeData["query"] = true;
-        if (node.parent) {
-          if (PlacesUtils.asQuery(node.parent).queryOptions.resultType ==
-              Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY)
-            nodeData["host"] = true;
-          else
-            nodeData["day"] = true;
-        }
-      }
-
-      metadata.push(nodeData);
-    }
-
-    return metadata;
-  },
-
-  /**
-   * Determines if a context-menu item should be shown
-   * @param   aMenuItem
-   *          the context menu item
-   * @param   aMetaData
-   *          meta data about the selection
-   * @returns true if the conditions (see buildContextMenu) are satisfied
-   *          and the item can be displayed, false otherwise.
-   */
-  _shouldShowMenuItem: function PC__shouldShowMenuItem(aMenuItem, aMetaData) {
-    var selectiontype = aMenuItem.getAttribute("selectiontype");
-    if (selectiontype == "multiple" && aMetaData.length == 1)
-      return false;
-    if (selectiontype == "single" && aMetaData.length != 1)
-      return false;
-
-    var selectionAttr = aMenuItem.getAttribute("selection");
-    if (selectionAttr) {
-      if (selectionAttr == "any")
-        return true;
-
-      var showRules = selectionAttr.split("|");
-      var anyMatched = false;
-      function metaDataNodeMatches(metaDataNode, rules) {
-        for (var i=0; i < rules.length; i++) {
-          if (rules[i] in metaDataNode)
-            return true;
-        }
-
-        return false;
-      }
-      for (var i = 0; i < aMetaData.length; ++i) {
-        if (metaDataNodeMatches(aMetaData[i], showRules))
-          anyMatched = true;
-        else
-          return false;
-      }
-      return anyMatched;
-    }
-
-    return !aMenuItem.hidden;
-  },
-
-  /**
-   * Detects information (meta-data rules) about the current selection in the
-   * view (see _buildSelectionMetadata) and sets the visibility state for each
-   * of the menu-items in the given popup with the following rules applied:
-   *  1) The "selectiontype" attribute may be set on a menu-item to "single"
-   *     if the menu-item should be visible only if there is a single node
-   *     selected, or to "multiple" if the menu-item should be visible only if
-   *     multiple nodes are selected. If the attribute is not set or if it is
-   *     set to an invalid value, the menu-item may be visible for both types of
-   *     selection.
-   *  2) The "selection" attribute may be set on a menu-item to the various
-   *     meta-data rules for which it may be visible. The rules should be
-   *     separated with the | character.
-   *  3) A menu-item may be visible only if at least one of the rules set in
-   *     its selection attribute apply to each of the selected nodes in the
-   *     view.
-   *  4) The visibility state of a menu-item is unchanged if none of this
-   *     attribute is set.
-   *  5) This attribute should not be set on separators for which the
-   *     visibility state is "auto-detected."
-   * @param   aPopup
-   *          The menupopup to build children into.
-   * @return true if at least one item is visible, false otherwise.
-   */
-  buildContextMenu: function PC_buildContextMenu(aPopup) {
-    var metadata = this._buildSelectionMetadata();
-
-    var separator = null;
-    var visibleItemsBeforeSep = false;
-    var anyVisible = false;
-    for (var i = 0; i < aPopup.childNodes.length; ++i) {
-      var item = aPopup.childNodes[i];
-      if (item.localName != "menuseparator") {
-        item.hidden = !this._shouldShowMenuItem(item, metadata);
-
-        if (!item.hidden) {
-          visibleItemsBeforeSep = true;
-          anyVisible = true;
-
-          // Show the separator above the menu-item if any
-          if (separator) {
-            separator.hidden = false;
-            separator = null;
-          }
-        }
-      }
-      else { // menuseparator
-        // Initially hide it. It will be unhidden if there will be at least one
-        // visible menu-item above and below it.
-        item.hidden = true;
-
-        // We won't show the separator at all if no items are visible above it
-        if (visibleItemsBeforeSep)
-          separator = item;
-
-        // New separator, count again:
-        visibleItemsBeforeSep = false;
-      }
-    }
-
-    return anyVisible;
-  },
-
-  /**
-   * Select all links in the current view.
-   */
-  selectAll: function PC_selectAll() {
-    this._view.selectAll();
-  },
-
-  /**
-   * Gives the user a chance to cancel loading lots of tabs at once
-   */
-  _confirmOpenTabs: function(numTabsToOpen) {
-    const kWarnOnOpenPref = "browser.tabs.warnOnOpen";
-    var reallyOpen = true;
-    if (Services.prefs.getBoolPref(kWarnOnOpenPref)) {
-      if (numTabsToOpen >= Services.prefs.getIntPref("browser.tabs.maxOpenBeforeWarn")) {
-        var promptService = Cc["@mozilla.org/embedcomp/prompt-service;1"]
-                              .getService(Ci.nsIPromptService);
-
-        // default to true: if it were false, we wouldn't get this far
-        var warnOnOpen = { value: true };
-
-        var messageKey = "tabs.openWarningMultipleBranded";
-        var openKey = "tabs.openButtonMultiple";
-        var strings = document.getElementById("placeBundle");
-        const BRANDING_BUNDLE_URI = "chrome://branding/locale/brand.properties";
-        var brandShortName = Cc["@mozilla.org/intl/stringbundle;1"]
-                               .getService(Ci.nsIStringBundleService)
-                               .createBundle(BRANDING_BUNDLE_URI)
-                               .GetStringFromName("brandShortName");
-
-        var buttonPressed = promptService.confirmEx(window,
-          PlacesUIUtils.getString("tabs.openWarningTitle"),
-          PlacesUIUtils.getFormattedString(messageKey,
-            [numTabsToOpen, brandShortName]),
-          (promptService.BUTTON_TITLE_IS_STRING * promptService.BUTTON_POS_0)
-          + (promptService.BUTTON_TITLE_CANCEL * promptService.BUTTON_POS_1),
-          PlacesUIUtils.getString(openKey),
-          null, null,
-          PlacesUIUtils.getFormattedString("tabs.openWarningPromptMeBranded",
-            [brandShortName]),
-          warnOnOpen);
-
-         reallyOpen = (buttonPressed == 0);
-         // don't set the pref unless they press OK and it's false
-         if (reallyOpen && !warnOnOpen.value)
-           Services.prefs.setBoolPref(kWarnOnOpenPref, false);
-      }
-    }
-    return reallyOpen;
-  },
-
-  /**
-   * Walk the list of folders we're removing in this delete operation, and
-   * see if the selected node specified is already implicitly being removed
-   * because it is a child of that folder.
-   * @param   node
-   *          Node to check for containment.
-   * @param   pastFolders
-   *          List of folders the calling function has already traversed
-   * @returns true if the node should be skipped, false otherwise.
-   */
-  _shouldSkipNode: function PC_shouldSkipNode(node, pastFolders) {
-    /**
-     * Determines if a node is contained by another node within a resultset.
-     * @param   node
-     *          The node to check for containment for
-     * @param   parent
-     *          The parent container to check for containment in
-     * @returns true if node is a member of parent's children, false otherwise.
-     */
-    function isContainedBy(node, parent) {
-      var cursor = node.parent;
-      while (cursor) {
-        if (cursor == parent)
-          return true;
-        cursor = cursor.parent;
-      }
-      return false;
-    }
-
-      for (var j = 0; j < pastFolders.length; ++j) {
-        if (isContainedBy(node, pastFolders[j]))
-          return true;
-      }
-      return false;
-  },
-
-  /**
-   * Removes the set of selected ranges from history.
-   */
-  _removeRowsFromHistory: function PC__removeRowsFromHistory() {
-    // Other containers are history queries, just delete from history
-    // history deletes are not undoable.
-    var nodes = this._view.getSelectionNodes();
-    var URIs = [];
-    var bhist = PlacesUtils.history.QueryInterface(Ci.nsIBrowserHistory);
-    var root = this._view.getResultNode();
-
-    for (var i = 0; i < nodes.length; ++i) {
-      var node = nodes[i];
-      if (PlacesUtils.nodeIsHost(node))
-        bhist.removePagesFromHost(node.title, true);
-      else if (PlacesUtils.nodeIsURI(node)) {
-        var uri = PlacesUtils._uri(node.uri);
-        // avoid trying to delete the same url twice
-        if (URIs.indexOf(uri) < 0) {
-          URIs.push(uri);
-        }
-      }
-      else if (PlacesUtils.nodeIsDay(node)) {
-        // this is the oldest date
-        // for the last node endDate is end of epoch
-        var beginDate = 0;
-        // this is the newest date
-        // day nodes have time property set to the last day in the interval
-        var endDate = node.time;
-
-        var nodeIdx = 0;
-        var cc = root.childCount;
-
-        // Find index of current day node
-        while (nodeIdx < cc && root.getChild(nodeIdx) != node)
-          ++nodeIdx;
-
-        // We have an older day
-        if (nodeIdx+1 < cc)
-          beginDate = root.getChild(nodeIdx+1).time;
-
-        // we want to exclude beginDate from the removal
-        bhist.removePagesByTimeframe(beginDate+1, endDate);
-      }
-    }
-
-    // if we have to delete a lot of urls RemovePage will be slow, it's better
-    // to delete them in bunch and rebuild the full treeView
-    if (URIs.length > REMOVE_PAGES_MAX_SINGLEREMOVES) {
-      // do removal in chunks to avoid passing a too big array to removePages
-      for (var i = 0; i < URIs.length; i += REMOVE_PAGES_CHUNKLEN) {
-        var URIslice = URIs.slice(i, i + REMOVE_PAGES_CHUNKLEN);
-        // set DoBatchNotify (third param) only on the last chunk, so we update
-        // the treeView when we are done.
-        bhist.removePages(URIslice, URIslice.length,
-                          (i + REMOVE_PAGES_CHUNKLEN) >= URIs.length);
-      }
-    }
-    else {
-      // if we have to delete fewer urls, removepage will allow us to avoid
-      // rebuilding the full treeView
-      for (var i = 0; i < URIs.length; ++i)
-        bhist.removePage(URIs[i]);
-    }
-  },
-
-  /**
-   * Fills a DataTransfer object with the content of the selection that can be
-   * dropped elsewhere.
-   * @param   aEvent
-   *          The dragstart event.
-   */
-  setDataTransfer: function PC_setDataTransfer(aEvent) {
-    var dt = aEvent.dataTransfer;
-    var doCopy = dt.effectAllowed == "copyLink" || dt.effectAllowed == "copy";
-
-    var result = this._view.getResult();
-    var didSuppressNotifications = result.suppressNotifications;
-    if (!didSuppressNotifications)
-      result.suppressNotifications = true;
-
-    try {
-      let nodes = this._view.getDragableSelection();
-
-      for (let i = 0; i < nodes.length; ++i) {
-        var node = nodes[i];
-
-        function addData(type, index, overrideURI) {
-          let wrapNode = PlacesUtils.wrapNode(node, type, overrideURI, doCopy);
-          dt.mozSetDataAt(type, wrapNode, index);
-        }
-
-        function addURIData(index, overrideURI) {
-          addData(PlacesUtils.TYPE_X_MOZ_URL, index, overrideURI);
-          addData(PlacesUtils.TYPE_UNICODE, index, overrideURI);
-          addData(PlacesUtils.TYPE_HTML, index, overrideURI);
-        }
-
-        // This order is _important_! It controls how this and other
-        // applications select data to be inserted based on type.
-        addData(PlacesUtils.TYPE_X_MOZ_PLACE, i);
-
-        if (node.uri)
-          addURIData(i);
-      }
-    }
-    finally {
-      if (!didSuppressNotifications)
-        result.suppressNotifications = false;
-    }
-  },
-
-  /**
-   * Copy Bookmarks and Folders to the clipboard
-   */
-  copy: function PC_copy() {
-    var result = this._view.getResult();
-
-    var didSuppressNotifications = result.suppressNotifications;
-    if (!didSuppressNotifications)
-      result.suppressNotifications = true;
-
-    try {
-      let nodes = this._view.getSelectionNodes();
-
-      let xferable = Cc["@mozilla.org/widget/transferable;1"]
-                       .createInstance(Ci.nsITransferable);
-      xferable.init(null);
-      let foundFolder = false, foundLink = false;
-      let copiedFolders = [];
-      let placeString, mozURLString, htmlString, unicodeString;
-      placeString = mozURLString = htmlString = unicodeString = "";
-
-      for (let i = 0; i < nodes.length; ++i) {
-        let node = nodes[i];
-        if (this._shouldSkipNode(node, copiedFolders))
-          continue;
-        if (PlacesUtils.nodeIsFolder(node))
-          copiedFolders.push(node);
-
-        function generateChunk(type, overrideURI) {
-          let suffix = i < (nodes.length - 1) ? PlacesUtils.endl : "";
-          let uri = overrideURI;
-
-          mozURLString += (PlacesUtils.wrapNode(node, PlacesUtils.TYPE_X_MOZ_URL,
-                                                 uri) + suffix);
-          unicodeString += (PlacesUtils.wrapNode(node, PlacesUtils.TYPE_UNICODE,
-                                                 uri) + suffix);
-          htmlString += (PlacesUtils.wrapNode(node, PlacesUtils.TYPE_HTML,
-                                                 uri) + suffix);
-
-          let placeSuffix = i < (nodes.length - 1) ? "," : "";
-          let resolveShortcuts = false; // !PlacesControllerDragHelper.canMoveNode(node);
-          return PlacesUtils.wrapNode(node, type, overrideURI, resolveShortcuts) + placeSuffix;
-        }
-
-        // all items wrapped as TYPE_X_MOZ_PLACE
-        placeString += generateChunk(PlacesUtils.TYPE_X_MOZ_PLACE);
-      }
-
-      function addData(type, data) {
-        xferable.addDataFlavor(type);
-        xferable.setTransferData(type, PlacesUIUtils._wrapString(data), data.length * 2);
-      }
-      // This order is _important_! It controls how this and other applications
-      // select data to be inserted based on type.
-      if (placeString)
-        addData(PlacesUtils.TYPE_X_MOZ_PLACE, placeString);
-      if (mozURLString)
-        addData(PlacesUtils.TYPE_X_MOZ_URL, mozURLString);
-      if (unicodeString)
-        addData(PlacesUtils.TYPE_UNICODE, unicodeString);
-      if (htmlString)
-        addData(PlacesUtils.TYPE_HTML, htmlString);
-
-      if (placeString || unicodeString || htmlString || mozURLString) {
-        Services.clipboard.setData(xferable, null,
-                                   Services.clipboard.kGlobalClipboard);
-      }
-    }
-    catch(e) {
-      dump(e);
-    }
-    finally {
-      if (!didSuppressNotifications)
-        result.suppressNotifications = false;
-    }
-  },
-
-  /**
-   * Cut Bookmarks and Folders to the clipboard
-   */
-  cut: function PC_cut() {
-    this.copy();
-    this._removeRowsFromHistory();
-  },
-};
deleted file mode 100644
--- a/suite/common/history/history.xul
+++ /dev/null
@@ -1,145 +0,0 @@
-<?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://communicator/skin/" type="text/css"?>
-
-<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/history/placesOverlay.xul"?>
-
-<!DOCTYPE window [
-<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/history.dtd">
-%historyDTD;
-<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
-%editMenuOverlayDTD;
-<!ENTITY % globalDTD SYSTEM "chrome://global/locale/global.dtd">
-%globalDTD;
-]>
-
-<window title="&historyWindowTitle.label;" id="history-window"
-        onload="HistoryCommonInit();"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        width="500" height="400"
-        persist="width height screenX screenY sizemode"
-        toggletoolbar="true"
-        windowtype="history:manager">
-
-  <commandset id="tasksCommands">
-    <!-- File Menu -->
-    <command id="cmd_close" oncommand="window.close()"/>
-    <command id="bm_cmd_saveas"/>
-    <!-- Search Box -->
-    <command id="cmd_search_focus"
-             oncommand="focusElement(gSearchBox);"/>
-  </commandset>
-  <commandset id="selectEditMenuItems">
-    <command id="cmd_cut"/>
-    <command id="cmd_copy"/>
-    <command id="cmd_delete"/>
-    <command id="cmd_selectAll"/>
-  </commandset>
-  <commandset id="placesCommands"/>
-
-  <broadcaster id="Communicator:WorkMode"/>
-
-  <keyset id="tasksKeys">
-    <!-- File Menu -->
-    <key id="key_close"/>
-    <!-- Edit Menu -->
-    <key id="key_cut"/>
-    <key id="key_copy"/>
-    <key id="key_delete"/>
-    <key id="key_delete2"/>
-    <key id="key_selectAll"/>
-    <!-- Search Box -->
-    <key id="key_search_focus"
-         command="cmd_search_focus"
-         key="&search.key;"
-         modifiers="accel"/>
-  </keyset>
-
-  <popupset id="placesPopupset">
-    <menupopup id="placesContext"/>
-  </popupset>
-
-  <toolbox id="history-toolbox">
-    <toolbar id="placesToolbar"
-             type="menubar">
-      <menubar id="history-menu"
-               grippytooltiptext="&menuBar.tooltip;">
-
-        <menu id="menu_File">
-          <menupopup id="menu_FilePopup">
-            <menuitem id="menu_close"/>
-          </menupopup>
-        </menu>
-
-        <menu id="menu_Edit">
-          <menupopup>
-            <menuitem id="menu_cut"/>
-            <menuitem id="menu_copy"/>
-            <menuitem id="menu_delete"/>
-            <menuitem id="menu_deleteByHostname" command="placesCmd_delete:hostname"/>
-            <menuitem id="menu_deleteByDomain" command="placesCmd_delete:domain"/>
-            <menuseparator/>
-            <menuitem id="menu_selectAll"/>
-          </menupopup>
-        </menu>
-
-        <menu id="menu_View">
-          <menupopup id="viewPopup"
-                     onpopupshowing="onViewToolbarsPopupShowing(event)"
-                     oncommand="onViewToolbarCommand(event);">
-            <menuseparator id="toolbarmode-sep"/>
-          </menupopup>
-        </menu>
-
-        <menu id="tasksMenu"/>
-        <menu id="windowMenu"/>
-        <menu id="menu_Help"/>
-      </menubar>
-    </toolbar>
-    <toolbar class="chromeclass-toolbar"
-             id="placesSearchToolbar"
-             align="center"
-             grippytooltiptext="&searchBar.tooltip;">
-      <textbox id="search-box"
-               clickSelectsAll="true"
-               type="search"
-               aria-controls="historyTree"
-               placeholder="&search.placeholder;"
-               oncommand="searchHistory(this.value);"/>
-    </toolbar>
-  </toolbox>
-
-  <tree id="historyTree"
-        class="placesTree plain"
-        context="placesContext"
-        flex="1" type="places"
-        enableColumnDrag="true"
-        onselect="historyOnSelect();"
-        onkeypress="if (event.keyCode == KeyEvent.DOM_VK_RETURN) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);">
-    <treecols context="">
-      <treecol label="&col.title.label;" id="Name" flex="4"
-               persist="width hidden ordinal sortActive sortDirection"/>
-      <splitter class="tree-splitter"/>
-      <treecol label="&col.url.label;" id="URL" flex="4"
-               persist="width hidden ordinal sortActive sortDirection"/>
-      <splitter class="tree-splitter"/>
-      <treecol label="&col.lastvisit.label;" id="Date" flex="1"
-               persist="width hidden ordinal sortActive sortDirection"/>
-      <splitter class="tree-splitter"/>
-      <treecol label="&col.visitcount.label;" id="VisitCount" flex="1" hidden="true"
-               persist="width hidden ordinal sortActive sortDirection"/>
-    </treecols>
-    <treechildren ondblclick="if (event.button == 0) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);"
-                  onclick="if (event.button == 1) PlacesUIUtils.openNodeWithEvent(gHistoryTree.selectedNode, event);"/>
-  </tree>
-  <statusbar id="status-bar" class="chromeclass-status">
-    <statusbarpanel id="statusbar-display" flex="1"/>
-    <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/>
-  </statusbar>
-
-</window>
deleted file mode 100644
--- a/suite/common/history/places.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/. */
-
-tree[type="places"] {
-  -moz-binding: url("chrome://communicator/content/history/tree.xml#places-tree");
-}
deleted file mode 100644
--- a/suite/common/history/placesOverlay.xul
+++ /dev/null
@@ -1,164 +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/. -->
-
-<!DOCTYPE overlay [
-<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/history.dtd">
-%historyDTD;
-<!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
-%utilityDTD;
-]>
-
-<?xml-stylesheet href="chrome://communicator/content/history/places.css"?>
-<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>
-
-<overlay id="placesOverlay"
-         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <script type="application/javascript"
-          src="chrome://global/content/globalOverlay.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/history.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/controller.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/treeView.js"/>
-
-  <commandset id="placesCommands"
-              commandupdater="true"
-              events="focus,sort"
-              oncommandupdate="updateHistoryCommands(this.firstChild);">
-    <command id="placesCmd_open"
-             oncommand="goDoCommand('placesCmd_open');"/>
-    <command id="placesCmd_open:window"
-             oncommand="goDoCommand('placesCmd_open:window');"/>
-    <command id="placesCmd_open:tab"
-             oncommand="goDoCommand('placesCmd_open:tab');"/>
-    <command id="placesCmd_delete:hostname"
-             oncommand="goDoCommand('placesCmd_delete:hostname');"/>
-    <command id="placesCmd_delete:domain"
-             oncommand="goDoCommand('placesCmd_delete:domain');"/>
-  </commandset>
-
-  <menupopup id="placesContext"
-         onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
-                         return this._view.buildContextMenu(this);"
-         onpopuphiding="this._view.destroyContextMenu();">
-    <menuitem id="placesContext_open"
-              command="placesCmd_open"
-              label="&cmd.open.label;"
-              accesskey="&cmd.open.accesskey;"
-              default="true"
-              selectiontype="single"
-              selection="link"/>
-    <menuitem id="placesContext_open:newtab"
-              command="placesCmd_open:tab"
-              label="&cmd.open_tab.label;"
-              accesskey="&cmd.open_tab.accesskey;"
-              selection="link"/>
-    <menuitem id="placesContext_open:newwindow"
-              command="placesCmd_open:window"
-              label="&cmd.open_window.label;"
-              accesskey="&cmd.open_window.accesskey;"
-              selection="link"/>
-    <menuseparator id="placesContext_openSeparator"/>
-    <menuitem id="addBookmarkContextItem"
-              label="&bookmarkLinkCmd.label;"
-              accesskey="&bookmarkLinkCmd.accesskey;"
-              selectiontype="single"
-              selection="link"
-              oncommand="historyAddBookmarks();"/>
-    <menuitem id="addMultipleBookmarksContextItem"
-              label="&bookmarkLinksCmd.label;"
-              accesskey="&bookmarkLinksCmd.accesskey;"
-              selectiontype="multiple"
-              selection="link"
-              oncommand="historyAddBookmarks();"/>
-    <menuitem id="placesContext_copy"
-              command="cmd_copy"
-              label="&copyCmd.label;"
-              accesskey="&copyCmd.accesskey;"
-              selection="any"/>
-    <menuseparator id="placesContext_editSeparator"/>
-    <menuitem id="placesContext_delete"
-              command="cmd_delete"
-              label="&deleteCmd.label;"
-              accesskey="&deleteCmd.accesskey;"
-              selection="link|host|day"/>
-    <menuitem id="placesContext_deleteByHostname"
-              command="placesCmd_delete:hostname"
-              selection="link|host"/>
-    <menuitem id="placesContext_deleteByDomain"
-              command="placesCmd_delete:domain"
-              selection="link|host"/>
-    <menuitem id="placesContext_selectAll"
-              command="cmd_selectAll"
-              label="&selectAllCmd.label;"
-              accesskey="&selectAllCmd.accesskey;"
-              selection="any"/>
-  </menupopup>
-
-  <menupopup id="viewPopup">
-    <menu id="viewColumns"
-          label="&view.columns.label;" accesskey="&view.columns.accesskey;">
-      <menupopup onpopupshowing="UpdateViewColumns(this.firstChild);"
-                 oncommand="ToggleColumn(event.target);">
-        <menuitem id="ToggleName" disabled="true" label="&col.title.label;"
-                  accesskey="&col.title.accesskey;" type="checkbox"/>
-        <menuitem id="ToggleURL" label="&col.url.label;"
-                  accesskey="&col.url.accesskey;" type="checkbox"/>
-        <menuitem id="ToggleDate" label="&col.lastvisit.label;"
-                  accesskey="&col.lastvisit.accesskey;" type="checkbox"/>
-        <menuitem id="ToggleVisitCount" label="&col.visitcount.label;"
-                  accesskey="&col.visitcount.accesskey;" type="checkbox"/>
-      </menupopup>
-    </menu>
-    <menu id="viewSortBy" label="&view.sortBy.label;"
-          accesskey="&view.sortBy.accesskey;">
-      <menupopup onpopupshowing="UpdateViewSort(this.firstChild);"
-                 oncommand="gHistoryTree.view.cycleHeader({id:event.target.id});">
-        <menuitem id="Unsorted" type="radio" name="columns"
-                  label="&view.unsorted.label;"
-                  accesskey="&view.unsorted.accesskey;"/>
-        <menuseparator/>
-        <menuitem id="SortByName" type="radio" name="columns"
-                  label="&col.title.label;"
-                  accesskey="&col.title.accesskey;"/>
-        <menuitem id="SortByURL" type="radio" name="columns"
-                  label="&col.url.label;"
-                  accesskey="&col.url.accesskey;"/>
-        <menuitem id="SortByDate" type="radio" name="columns"
-                  label="&col.lastvisit.label;"
-                  accesskey="&col.lastvisit.accesskey;"/>
-        <menuitem id="SortByVisitCount" type="radio" name="columns"
-                  label="&col.visitcount.label;"
-                  accesskey="&col.visitcount.accesskey;"/>
-        <menuseparator/>
-        <menuitem id="SortAscending" type="radio" name="direction"
-                  label="&view.sortAscending.label;"
-                  accesskey="&view.sortAscending.accesskey;"/>
-        <menuitem id="SortDescending" type="radio" name="direction"
-                  label="&view.sortDescending.label;"
-                  accesskey="&view.sortDescending.accesskey;"/>
-      </menupopup>
-    </menu>
-    <menu id="viewGroupBy" label="&view.groupBy.label;"
-          accesskey="&view.groupBy.accesskey;">
-      <menupopup oncommand="GroupBy(event.target);">
-        <menuitem id="GroupByNone" type="radio" name="group"
-                  label="&view.groupNone.label;"
-                  accesskey="&view.groupNone.accesskey;"/>
-        <menuitem id="GroupByDay" type="radio" name="group"
-                  label="&view.groupDay.label;"
-                  accesskey="&view.groupDay.accesskey;"/>
-        <menuitem id="GroupBySite" type="radio" name="group"
-                  label="&view.groupSite.label;"
-                  accesskey="&view.groupSite.accesskey;"/>
-        <menuitem id="GroupByBoth" type="radio" name="group"
-                  label="&view.groupDayAndSite.label;"
-                  accesskey="&view.groupDayAndSite.accesskey;"/>
-      </menupopup>
-    </menu>
-  </menupopup>
-</overlay>
deleted file mode 100644
--- a/suite/common/history/tree.xml
+++ /dev/null
@@ -1,276 +0,0 @@
-<?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/. -->
-
-<bindings id="placesTreeBindings"
-          xmlns="http://www.mozilla.org/xbl"
-          xmlns:xbl="http://www.mozilla.org/xbl"
-          xmlns:html="http://www.w3.org/1999/xhtml"
-          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-  <binding id="places-tree" extends="chrome://global/content/bindings/tree.xml#tree">
-    <implementation>
-      <constructor><![CDATA[
-        // Force an initial build.
-        if (this.place)
-          this.place = this.place;
-      ]]></constructor>
-
-      <destructor><![CDATA[
-        // Break the treeviewer->result->treeviewer cycle.
-        // Note: unsetting the result's viewer also unsets
-        // the viewer's reference to our treeBoxObject.
-        var result = this.getResult();
-        if (result)
-          result.root.containerOpen = false;
-        this.view = null;
-      ]]></destructor>
-
-      <property name="controller"
-                readonly="true"
-                onget="return this._controller;"/>
-
-      <!-- overriding -->
-      <property name="view">
-        <getter><![CDATA[
-          try {
-            return this.treeBoxObject.view
-                .QueryInterface(Ci.nsITreeView)
-                .QueryInterface(Ci.nsINavHistoryResultTreeViewer);
-          }
-          catch(e) {
-            return null;
-          }
-        ]]></getter>
-        <setter><![CDATA[
-          return this.treeBoxObject.view = val;
-        ]]></setter>
-      </property>
-
-      <property name="sortingMode" readonly="true">
-        <getter><![CDATA[
-          var result = this.getResult();
-          if (result)
-            // If we have a result then simply return its sorting mode.
-            return result.sortingMode;
-          else {
-            // Find the sorted column from the persisted attributes.
-            const NHQO = Ci.nsINavHistoryQueryOptions;
-            var sortedColumn = this.columns.getSortedColumn();
-            if (!sortedColumn)
-              return NHQO.SORT_BY_NONE;
-
-            var sortDescending =
-              sortedColumn.element.getAttribute("sortDirection") != "ascending";
-            switch (sortedColumn.id) {
-              case "Name":
-                return NHQO.SORT_BY_TITLE_ASCENDING + sortDescending;
-              case "URL":
-                return NHQO.SORT_BY_URI_ASCENDING + sortDescending;
-              case "Date":
-                return NHQO.SORT_BY_DATE_ASCENDING + sortDescending;
-              case "VisitCount":
-                return NHQO.SORT_BY_VISITCOUNT_ASCENDING + sortDescending;
-            }
-            return NHQO.SORT_BY_NONE;
-          }
-        ]]></getter>
-      </property>
-
-      <method name="applyFilter">
-        <parameter name="filterString"/>
-        <body><![CDATA[
-          // preserve grouping
-          var queryNode = asQuery(this.getResultNode());
-          var options = queryNode.queryOptions.clone();
-
-          var query = PlacesUtils.history.getNewQuery();
-          query.searchTerms = filterString;
-
-          this.load([query], options);
-        ]]></body>
-      </method>
-
-      <method name="load">
-        <parameter name="queries"/>
-        <parameter name="options"/>
-        <body><![CDATA[
-          var result = PlacesUtils.history.executeQueries(queries, queries.length,
-                                                          options);
-
-          var treeView = new PlacesTreeView();
-
-          // Observer removal is done within the view itself. When the tree
-          // goes away, treeboxobject calls view.setTree(null), which then
-          // calls removeObserver.
-          result.addObserver(treeView);
-          this.view = treeView;
-          if (!this._controller) {
-            this._controller = new PlacesController(this);
-            this.controllers.appendController(this._controller);
-          }
-        ]]></body>
-      </method>
-
-      <!-- nsIPlacesView -->
-      <method name="getResult">
-        <body><![CDATA[
-          try {
-            return this.view.QueryInterface(Ci.nsINavHistoryResultObserver).result;
-          }
-          catch (e) {
-            return null;
-          }
-        ]]></body>
-      </method>
-
-      <!-- nsIPlacesView -->
-      <method name="getResultNode">
-        <body><![CDATA[
-          return this.getResult().root;
-        ]]></body>
-      </method>
-
-      <!-- nsIPlacesView -->
-      <property name="place">
-        <getter><![CDATA[
-          return this.getAttribute("place");
-        ]]></getter>
-        <setter><![CDATA[
-          this.setAttribute("place", val);
-
-          var queriesRef = { };
-          var queryCountRef = { };
-          var optionsRef = { };
-          PlacesUtils.history.queryStringToQueries(val, queriesRef, queryCountRef, optionsRef);
-          if (queryCountRef.value == 0)
-            queriesRef.value = [PlacesUtils.history.getNewQuery()];
-          if (!optionsRef.value)
-            optionsRef.value = PlacesUtils.history.getNewQueryOptions();
-
-          this.load(queriesRef.value, optionsRef.value);
-
-          return val;
-        ]]></setter>
-      </property>
-
-      <!-- nsIPlacesView -->
-      <property name="hasSelection">
-        <getter><![CDATA[
-          return this.view && this.view.selection.count >= 1;
-        ]]></getter>
-      </property>
-
-      <!-- nsIPlacesView -->
-      <method name="getSelectionNodes">
-        <body><![CDATA[
-          var nodes = [];
-          if (!this.hasSelection)
-            return nodes;
-
-          var selection = this.view.selection;
-          var rc = selection.getRangeCount();
-          var resultview = this.view;
-          for (var i = 0; i < rc; ++i) {
-            var min = { }, max = { };
-            selection.getRangeAt(i, min, max);
-
-            for (var j = min.value; j <= max.value; ++j)
-              nodes.push(resultview.nodeForTreeIndex(j));
-          }
-          return nodes;
-        ]]></body>
-      </method>
-
-      <!-- nsIPlacesView -->
-      <method name="getDragableSelection">
-        <body><![CDATA[
-          return this.getSelectionNodes();
-        ]]></body>
-      </method>
-
-      <!-- nsIPlacesView -->
-      <property name="selectedNode">
-        <getter><![CDATA[
-          var view = this.view;
-          if (!view || view.selection.count != 1)
-            return null;
-
-          var selection = view.selection;
-          var min = { }, max = { };
-          selection.getRangeAt(0, min, max);
-
-          return this.view.nodeForTreeIndex(min.value);
-        ]]></getter>
-      </property>
-
-      <!-- nsIPlacesView -->
-      <property name="insertionPoint">
-        <getter><![CDATA[
-          // there is no insertion point for history queries
-          // so just bail out
-          return null;
-        ]]></getter>
-      </property>
-
-      <!-- nsIPlacesView -->
-      <method name="selectAll">
-        <body><![CDATA[
-          this.view.selection.selectAll();
-        ]]></body>
-      </method>
-
-      <method name="buildContextMenu">
-        <parameter name="aPopup"/>
-        <body><![CDATA[
-          return this.controller.buildContextMenu(aPopup);
-        ]]></body>
-      </method>
-
-      <method name="destroyContextMenu">
-        <parameter name="aPopup"/>
-        <body/>
-      </method>
-    </implementation>
-    <handlers>
-      <handler event="focus"><![CDATA[
-        // See select handler. We need the sidebar's places commandset to be
-        // updated as well
-        document.commandDispatcher.updateCommands("focus");
-      ]]></handler>
-      <handler event="select"><![CDATA[
-        // This additional complexity is here for the sidebars
-        var win = window;
-        while (true) {
-          win.document.commandDispatcher.updateCommands("focus");
-          if (win == window.top)
-            break;
-
-          win = win.parent;
-        }
-      ]]></handler>
-      <handler event="dragstart"><![CDATA[
-        if (event.target.localName != "treechildren")
-          return;
-
-        var nodes = this.getSelectionNodes();
-        for (var i = 0; i < nodes.length; ++i) {
-          // Disallow dragging the root node of a tree.
-          if (!nodes[i].parent) {
-            event.preventDefault();
-            event.stopPropagation();
-            return;
-          }
-
-          // History nodes can always be dragged off.
-        }
-
-        // Stuff the encoded selection into the transferable data object.
-        this._controller.setDataTransfer(event);
-        event.stopPropagation();
-      ]]></handler>
-    </handlers>
-  </binding>
-
-</bindings>
deleted file mode 100644
--- a/suite/common/history/treeView.js
+++ /dev/null
@@ -1,1184 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 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/. */
-
-ChromeUtils.import("resource://gre/modules/Services.jsm");
-
- /**
- * This returns the key for any node/details object.
- *
- * @param nodeOrDetails
- *        A node, or an object containing the following properties:
- *        - uri
- *        - time
- *        - itemId
- *        In case any of these is missing, an empty string will be returned. This is
- *        to facilitate easy delete statements which occur due to assignment to items in `this._rows`,
- *        since the item we are deleting may be undefined in the array.
- *
- * @return key or empty string.
- */
-function makeNodeDetailsKey(nodeOrDetails) {
-  if (nodeOrDetails &&
-      typeof nodeOrDetails === "object" &&
-      "uri" in nodeOrDetails &&
-      "time" in nodeOrDetails &&
-      "itemId" in nodeOrDetails) {
-    return `${nodeOrDetails.uri}*${nodeOrDetails.time}*${nodeOrDetails.itemId}`;
-  }
-  return "";
-}
-
-function PlacesTreeView() {
-  this._tree = null;
-  this._result = null;
-  this._selection = null;
-  this._rootNode = null;
-  this._rows = [];
-  this._nodeDetails = new Map();
-}
-
-PlacesTreeView.prototype = {
-
-  QueryInterface: function PTV_QueryInterface(aIID) {
-    if (aIID.equals(Ci.nsITreeView) ||
-        aIID.equals(Ci.nsINavHistoryResultObserver) ||
-        aIID.equals(Ci.nsINavHistoryResultTreeViewer) ||
-        aIID.equals(Ci.nsISupportsWeakReference) ||
-        aIID.equals(Ci.nsISupports))
-      return this;
-
-    throw Cr.NS_ERROR_NO_INTERFACE;
-  },
-
-  /**
-   * This is called once both the result and the tree are set.
-   */
-  _finishInit: function PTV__finishInit() {
-    var selection = this.selection;
-    if (selection)
-      selection.selectEventsSuppressed = true;
-
-    if (!this._rootNode.containerOpen) {
-      // This triggers containerStateChanged which then builds the visible section.
-      this._rootNode.containerOpen = true;
-    }
-    else
-      this.invalidateContainer(this._rootNode);
-
-    // "Activate" the sorting column and update commands.
-    this.sortingChanged(this._result.sortingMode);
-
-    if (selection)
-      selection.selectEventsSuppressed = false;
-  },
-
-  /**
-   * Plain Container: container result nodes which may never include sub
-   * hierarchies.
-   *
-   * When the rows array is constructed, we don't set the children of plain
-   * containers.  Instead, we keep placeholders for these children.  We then
-   * build these children lazily as the tree asks us for information about each
-   * row.  Luckily, the tree doesn't ask about rows outside the visible area.
-   *
-   * @see _getNodeForRow and _getRowForNode for the actual magic.
-   *
-   * @note It's guaranteed that all containers are listed in the rows
-   * elements array.
-   *
-   * @param aContainer
-   *        A container result node.
-   *
-   * @return true if aContainer is a plain container, false otherwise.
-   */
-  _isPlainContainer: function PTV__isPlainContainer(aContainer) {
-    // All history containers are query containers, but we need to QI
-    aContainer.QueryInterface(Ci.nsINavHistoryQueryResultNode);
-
-    // Of all history containers, only URI containers are flat, and they don't
-    // contain folders, no need to check that either.
-    return aContainer.queryOptions.resultType ==
-               Ci.nsINavHistoryQueryOptions.RESULTS_AS_URI;
-  },
-
-  /**
-   * Gets the row number for a given node.  Assumes that the given node is
-   * visible (i.e. it's not an obsolete node).
-   *
-   * @param aNode
-   *        A result node.  Do not pass an obsolete node, or any
-   *        node which isn't supposed to be in the tree.
-   * @param [optional] aForceBuild
-   *        @see _isPlainContainer.
-   *        If true, the row will be computed even if the node still isn't set
-   *        in our rows array.
-   * @param [optional] aParentRow
-   *        The row of aNode's parent.
-   *        DO NOT compute this yourself for the purpose of calling this
-   *        function.  However, do pass it if you have it handy.
-   *        Ignored for the root node.
-   * @param [optional] aNodeIndex
-   *        The index of aNode in its parent.  Only used if aParentRow is
-   *        set too.
-   *
-   * @throws if aNode is invisible.
-   * @return aNode's row if it's in the rows list or if aForceBuild is set, -1
-   *         otherwise.
-   */
-  _getRowForNode:
-  function PTV__getRowForNode(aNode, aForceBuild, aParentRow, aNodeIndex) {
-    if (aNode == this._rootNode)
-      throw new Error("The root node is never visible");
-
-    // A node is removed form the view either if it has no parent or if its
-    // root-ancestor is not the root node (in which case that's the node
-    // for which nodeRemoved was called).
-    let ancestors = Array.from(PlacesUtils.nodeAncestors(aNode));
-    if (ancestors.length == 0 ||
-        ancestors[ancestors.length - 1] != this._rootNode) {
-      throw new Error("Removed node passed to _getRowForNode");
-    }
-
-    // Ensure that the entire chain is open, otherwise that node is invisible.
-    for (let ancestor of ancestors) {
-      if (!ancestor.containerOpen)
-        throw new Error("Invisible node passed to _getRowForNode");
-    }
-
-    // Non-plain containers are initially built with their contents.
-    let parent = aNode.parent;
-    let parentIsPlain = this._isPlainContainer(parent);
-    if (!parentIsPlain) {
-      if (parent == this._rootNode)
-        return this._rows.indexOf(aNode);
-
-      return this._rows.indexOf(aNode, aParentRow);
-    }
-
-    let row = -1;
-    let useNodeIndex = typeof(aNodeIndex) == "number";
-    if (parent == this._rootNode)
-      row = useNodeIndex ? aNodeIndex : this._rootNode.getChildIndex(aNode);
-    else if (useNodeIndex && typeof(aParentRow) == "number") {
-      // If we have both the row of the parent node, and the node's index, we
-      // can avoid searching the rows array if the parent is a plain container.
-      row = aParentRow + aNodeIndex + 1;
-    }
-    else {
-      // Look for the node in the nodes array.  Start the search at the parent
-      // row.  If the parent row isn't passed, we'll pass undefined to indexOf,
-      // which is fine.
-      row = this._rows.indexOf(aNode, aParentRow);
-      if (row == -1 && aForceBuild) {
-        let parentRow = typeof(aParentRow) == "number" ? aParentRow
-                                                       : this._getRowForNode(parent);
-        row = parentRow + parent.getChildIndex(aNode) + 1;
-      }
-    }
-
-    if (row != -1) {
-      this._nodeDetails.delete(makeNodeDetailsKey(this._rows[row]));
-      this._nodeDetails.set(makeNodeDetailsKey(aNode), aNode);
-      this._rows[row] = aNode;
-    }
-
-    return row;
-  },
-
-  /**
-   * Given a row, finds and returns the parent details of the associated node.
-   *
-   * @param aChildRow
-   *        Row number.
-   * @return [parentNode, parentRow]
-   */
-  _getParentByChildRow: function PTV__getParentByChildRow(aChildRow) {
-    let node = this._getNodeForRow(aChildRow);
-    let parent = (node === null) ? this._rootNode : node.parent;
-
-    // The root node is never visible
-    if (parent == this._rootNode)
-      return [this._rootNode, -1];
-
-    let parentRow = this._rows.lastIndexOf(parent, aChildRow - 1);
-    return [parent, parentRow];
-  },
-
-  /**
-   * Gets the node at a given row.
-   */
-  _getNodeForRow: function PTV__getNodeForRow(aRow) {
-    if (aRow < 0) {
-      return null;
-    }
-
-    let node = this._rows[aRow];
-    if (node !== undefined)
-      return node;
-
-    // Find the nearest node.
-    let rowNode, row;
-    for (let i = aRow - 1; i >= 0 && rowNode === undefined; i--) {
-      rowNode = this._rows[i];
-      row = i;
-    }
-
-    // If there's no container prior to the given row, it's a child of
-    // the root node (remember: all containers are listed in the rows array).
-    if (!rowNode) {
-      let newNode = this._rootNode.getChild(aRow);
-      this._nodeDetails.delete(makeNodeDetailsKey(this._rows[aRow]));
-      this._nodeDetails.set(makeNodeDetailsKey(newNode), newNode);
-      return this._rows[aRow] = newNode;
-    }
-
-    // Unset elements may exist only in plain containers.  Thus, if the nearest
-    // node is a container, it's the row's parent, otherwise, it's a sibling.
-    if (rowNode instanceof Ci.nsINavHistoryContainerResultNode) {
-      let newNode = rowNode.getChild(aRow - row - 1);
-      this._nodeDetails.delete(makeNodeDetailsKey(this._rows[aRow]));
-      this._nodeDetails.set(makeNodeDetailsKey(newNode), newNode);
-      return this._rows[aRow] = newNode;
-    }
-
-    let [parent, parentRow] = this._getParentByChildRow(row);
-    let newNode = parent.getChild(aRow - parentRow - 1);
-    this._nodeDetails.delete(makeNodeDetailsKey(this._rows[aRow]));
-    this._nodeDetails.set(makeNodeDetailsKey(newNode), newNode);
-    return this._rows[aRow] = newNode;
-  },
-
-  /**
-   * This takes a container and recursively appends our rows array per its
-   * contents.  Assumes that the rows arrays has no rows for the given
-   * container.
-   *
-   * @param [in] aContainer
-   *        A container result node.
-   * @param [in] aFirstChildRow
-   *        The first row at which nodes may be inserted to the row array.
-   *        In other words, that's aContainer's row + 1.
-   * @param [out] aToOpen
-   *        An array of containers to open once the build is done.
-   *
-   * @return the number of rows which were inserted.
-   */
-  _buildVisibleSection:
-  function PTV__buildVisibleSection(aContainer, aFirstChildRow, aToOpen)
-  {
-    // There's nothing to do if the container is closed.
-    if (!aContainer.containerOpen)
-      return 0;
-
-    // Inserting the new elements into the rows array in one shot (by
-    // Array.prototype.concat) is faster than resizing the array (by splice) on
-    // each loop iteration.
-    var cc = aContainer.childCount;
-    var newElements = new Array(cc);
-
-    // We need to clean up the node details from aFirstChildRow + 1 to the end of rows.
-    for (let i = aFirstChildRow + 1; i < this._rows.length; i++) {
-      this._nodeDetails.delete(makeNodeDetailsKey(this._rows[i]));
-    }
-
-    this._rows = this._rows.splice(0, aFirstChildRow)
-                           .concat(newElements, this._rows);
-
-    if (this._isPlainContainer(aContainer))
-      return cc;
-
-    var sortingMode = this._result.sortingMode;
-
-    var rowsInserted = 0;
-    for (let i = 0; i < cc; i++) {
-      var curChild = aContainer.getChild(i);
-      var curChildType = curChild.type;
-
-      var row = aFirstChildRow + rowsInserted;
-
-      this._nodeDetails.delete(makeNodeDetailsKey(this._rows[row]));
-      this._nodeDetails.set(makeNodeDetailsKey(curChild), curChild);
-      this._rows[row] = curChild;
-      rowsInserted++;
-
-      // recursively do containers
-      if (curChild instanceof Ci.nsINavHistoryContainerResultNode) {
-        NS_ASSERT(curChild.uri, "if there is no uri, we can't persist the open state");
-        var isopen = curChild.uri &&
-                     PlacesUIUtils.xulStore.hasValue(location, curChild.uri, "open");
-        if (isopen != curChild.containerOpen)
-          aToOpen.push(curChild);
-        else if (curChild.containerOpen && curChild.childCount > 0)
-          rowsInserted += this._buildVisibleSection(curChild, row + 1, aToOpen);
-      }
-    }
-
-    return rowsInserted;
-  },
-
-  /**
-   * This counts how many rows a node takes in the tree.  For containers it
-   * will count the node itself plus any child node following it.
-   */
-  _countVisibleRowsForNodeAtRow:
-  function PTV__countVisibleRowsForNodeAtRow(aNodeRow) {
-    let node = this._rows[aNodeRow];
-
-    // If it's not listed yet, we know that it's a leaf node (instanceof also
-    // null-checks).
-    if (!(node instanceof Ci.nsINavHistoryContainerResultNode))
-      return 1;
-
-    let outerLevel = node.indentLevel;
-    for (let i = aNodeRow + 1; i < this._rows.length; i++) {
-      let rowNode = this._rows[i];
-      if (rowNode && rowNode.indentLevel <= outerLevel)
-        return i - aNodeRow;
-    }
-
-    // This node plus its children take up the bottom of the list.
-    return this._rows.length - aNodeRow;
-  },
-
-  _getSelectedNodesInRange:
-  function PTV__getSelectedNodesInRange(aFirstRow, aLastRow) {
-    var selection = this.selection;
-    var rc = selection.getRangeCount();
-    if (rc == 0)
-      return [];
-
-    // The visible-area borders are needed for checking whether a
-    // selected row is also visible.
-    var firstVisibleRow = this._tree.getFirstVisibleRow();
-    var lastVisibleRow = this._tree.getLastVisibleRow();
-
-    var nodesInfo = [];
-    for (let rangeIndex = 0; rangeIndex < rc; rangeIndex++) {
-      let min = { }, max = { };
-      selection.getRangeAt(rangeIndex, min, max);
-
-      // If this range does not overlap the replaced chunk, we don't need to
-      // persist the selection.
-      if (max.value < aFirstRow || min.value > aLastRow)
-        continue;
-
-      let firstRow = Math.max(min.value, aFirstRow);
-      let lastRow = Math.min(max.value, aLastRow);
-      for (let i = firstRow; i <= lastRow; i++) {
-        nodesInfo.push({
-          node: this._rows[i],
-          oldRow: i,
-          wasVisible: i >= firstVisibleRow && i <= lastVisibleRow
-        });
-      }
-    }
-
-    return nodesInfo;
-  },
-
-  /**
-   * Tries to find an equivalent node for a node which was removed.  We first
-   * look for the original node, in case it was just relocated.  Then, if we
-   * that node was not found, we look for a node that has the same itemId, uri
-   * and time values.
-   *
-   * @param aUpdatedContainer
-   *        An ancestor of the node which was removed.  It does not have to be
-   *        its direct parent.
-   * @param aOldNode
-   *        The node which was removed.
-   *
-   * @return the row number of an equivalent node for aOldOne, if one was
-   *         found, -1 otherwise.
-   */
-  _getNewRowForRemovedNode:
-  function PTV__getNewRowForRemovedNode(aUpdatedContainer, aOldNode) {
-    var parent = aOldNode.parent;
-    if (parent) {
-      // If the node's parent is still set, the node is not obsolete
-      // and we should just find out its new position.
-      // However, if any of the node's ancestor is closed, the node is
-      // invisible.
-      let ancestors = PlacesUtils.nodeAncestors(aOldNode);
-      for (let ancestor of ancestors) {
-        if (!ancestor.containerOpen) {
-          return -1;
-        }
-      }
-
-      return this._getRowForNode(aOldNode, true);
-    }
-
-    // There's a broken edge case here.
-    // If a visit appears in two queries, and the second one was
-    // the old node, we'll select the first one after refresh.  There's
-    // nothing we could do about that, because aOldNode.parent is
-    // gone by the time invalidateContainer is called.
-    let newNode = this._nodeDetails.get(makeNodeDetailsKey(aOldNode));
-
-    if (!newNode)
-      return -1;
-
-    return this._getRowForNode(newNode, true);
-  },
-
-  /**
-   * Restores a given selection state as near as possible to the original
-   * selection state.
-   *
-   * @param aNodesInfo
-   *        The persisted selection state as returned by
-   *        _getSelectedNodesInRange.
-   * @param aUpdatedContainer
-   *        The container which was updated.
-   */
-  _restoreSelection:
-  function PTV__restoreSelection(aNodesInfo, aUpdatedContainer) {
-    if (aNodesInfo.length == 0)
-      return;
-
-    var selection = this.selection;
-
-    // Attempt to ensure that previously-visible selection will be visible
-    // if it's re-selected.  However, we can only ensure that for one row.
-    var scrollToRow = -1;
-    for (let i = 0; i < aNodesInfo.length; i++) {
-      let nodeInfo = aNodesInfo[i];
-      let row = this._getNewRowForRemovedNode(aUpdatedContainer,
-                                              aNodesInfo[i].node);
-      // Select the found node, if any.
-      if (row != -1) {
-        selection.rangedSelect(row, row, true);
-        if (nodeInfo.wasVisible && scrollToRow == -1)
-          scrollToRow = row;
-      }
-    }
-
-    // If only one node was previously selected and there's no selection now,
-    // select the node at its old row, if any.
-    if (aNodesInfo.length == 1 && selection.count == 0) {
-      let row = Math.min(aNodesInfo[0].oldRow, this._rows.length - 1);
-      selection.rangedSelect(row, row, true);
-      if (aNodesInfo[0].wasVisible && scrollToRow == -1)
-        scrollToRow = aNodesInfo[0].oldRow;
-    }
-
-    if (scrollToRow != -1)
-      this._tree.ensureRowIsVisible(scrollToRow);
-  },
-
-  _convertPRTimeToString: function PTV__convertPRTimeToString(aTime) {
-    const MS_PER_MINUTE = 60000;
-    const MS_PER_DAY = 86400000;
-    let timeMs = aTime / 1000; // PRTime is in microseconds
-
-    // Date is calculated starting from midnight, so the modulo with a day are
-    // milliseconds from today's midnight.
-    // getTimezoneOffset corrects that based on local time, notice midnight
-    // can have a different offset during DST-change days.
-    let dateObj = new Date();
-    let now = dateObj.getTime() - dateObj.getTimezoneOffset() * MS_PER_MINUTE;
-    let midnight = now - (now % MS_PER_DAY);
-    midnight += new Date(midnight).getTimezoneOffset() * MS_PER_MINUTE;
-
-    let timeObj = new Date(timeMs);
-    return timeMs >= midnight ? this._todayFormatter.format(timeObj)
-                              : this._dateFormatter.format(timeObj);
-  },
-
-  // We use a different formatter for times within the current day,
-  // so we cache both a "today" formatter and a general date formatter.
-  __todayFormatter: null,
-  get _todayFormatter() {
-    if (!this.__todayFormatter) {
-      const dtOptions = { timeStyle: "short" };
-      this.__todayFormatter = Services.intl.createDateTimeFormat(undefined, dtOptions);
-    }
-    return this.__todayFormatter;
-  },
-
-  __dateFormatter: null,
-  get _dateFormatter() {
-    if (!this.__dateFormatter) {
-      const dtOptions = { dateStyle: "short", timeStyle: "short" };
-      this.__dateFormatter = Services.intl.createDateTimeFormat(undefined, dtOptions);
-    }
-    return this.__dateFormatter;
-  },
-
-  // nsINavHistoryResultObserver
-  nodeInserted: function PTV_nodeInserted(aParentNode, aNode, aNewIndex) {
-    NS_ASSERT(this._result, "Got a notification but have no result!");
-    if (!this._tree || !this._result)
-      return;
-
-    var parentRow;
-    if (aParentNode != this._rootNode) {
-      parentRow = this._getRowForNode(aParentNode);
-
-      // Update parent when inserting the first item, since twisty has changed.
-      if (aParentNode.childCount == 1)
-        this._tree.invalidateRow(parentRow);
-    }
-
-    // Compute the new row number of the node.
-    var row = -1;
-    if (aNewIndex == 0 || this._isPlainContainer(aParentNode)) {
-      // We don't need to worry about sub hierarchies of the parent node
-      // if it's a plain container, or if the new node is its first child.
-      if (aParentNode == this._rootNode)
-        row = aNewIndex;
-      else
-        row = parentRow + aNewIndex + 1;
-    }
-    else {
-      // Here, we try to find the next visible element in the child list so we
-      // can set the new visible index to be right before that. Note that we
-      // have to search down instead of up, because some siblings could have
-      // children themselves that would be in the way.
-      if (aNewIndex + 1 < aParentNode.childCount) {
-        let node = aParentNode.getChild(aNewIndex + 1);
-        // The children have not been shifted so the next item will have what
-        // should be our index.
-        row = this._getRowForNode(node, false, parentRow, i);
-      }
-      if (row < 0) {
-        // At the end of the child list without finding a visible sibling. This
-        // is a little harder because we don't know how many rows the last node
-        // in our list takes up (it could be a container with many children).
-        let prevChild = aParentNode.getChild(aNewIndex - 1);
-        let prevIndex = this._getRowForNode(prevChild, false, parentRow,
-                                            aNewIndex - 1);
-        row = prevIndex + this._countVisibleRowsForNodeAtRow(prevIndex);
-      }
-    }
-
-    this._nodeDetails.set(makeNodeDetailsKey(aNode), aNode);
-    this._rows.splice(row, 0, aNode);
-    this._tree.rowCountChanged(row, 1);
-
-    if (PlacesUtils.nodeIsContainer(aNode) && PlacesUtils.asContainer(aNode).containerOpen)
-      this.invalidateContainer(aNode);
-  },
-
-  /**
-   * THIS FUNCTION DOES NOT HANDLE cases where a collapsed node is being
-   * removed but the node it is collapsed with is not being removed (this then
-   * just swap out the removee with its collapsing partner). The only time
-   * when we really remove things is when deleting URIs, which will apply to
-   * all collapsees. This function is called sometimes when resorting nodes.
-   * However, we won't do this when sorted by date because dates will never
-   * change for visits, and date sorting is the only time things are collapsed.
-   */
-  nodeRemoved: function PTV_nodeRemoved(aParentNode, aNode, aOldIndex) {
-    NS_ASSERT(this._result, "Got a notification but have no result!");
-    if (!this._tree || !this._result)
-      return;
-
-    // XXX bug 517701: We don't know what to do when the root node is removed.
-    if (aNode == this._rootNode)
-      throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-
-    let oldRow = this._getRowForNode(aNode, true);
-    if (oldRow < 0)
-      throw Cr.NS_ERROR_UNEXPECTED;
-
-    // If the node was exclusively selected, the node next to it will be
-    // selected.
-    var selectNext = false;
-    var selection = this.selection;
-    if (selection.getRangeCount() == 1) {
-      let min = { }, max = { };
-      selection.getRangeAt(0, min, max);
-      if (min.value == max.value &&
-          this.nodeForTreeIndex(min.value) == aNode)
-        selectNext = true;
-    }
-
-    // Remove the node and its children, if any.
-    var count = this._countVisibleRowsForNodeAtRow(oldRow);
-    for (let splicedNode of this._rows.splice(oldRow, count)) {
-      this._nodeDetails.delete(makeNodeDetailsKey(splicedNode));
-    }
-    this._tree.rowCountChanged(oldRow, -count);
-
-    // Redraw the parent if its twisty state has changed.
-    if (aParentNode != this._rootNode && !aParentNode.hasChildren) {
-      let parentRow = oldRow - 1;
-      this._tree.invalidateRow(parentRow);
-    }
-
-    // Restore selection if the node was exclusively selected.
-    if (!selectNext)
-      return;
-
-    // Restore selection.
-    var rowToSelect = Math.min(oldRow, this._rows.length - 1);
-    this.selection.rangedSelect(rowToSelect, rowToSelect, true);
-  },
-
-  nodeMoved:
-  function PTV_nodeMoved(aNode, aOldParent, aOldIndex, aNewParent, aNewIndex) {
-    NS_ASSERT(this._result, "Got a notification but have no result!");
-    if (!this._tree || !this._result)
-      return;
-
-    // Note that at this point the node has already been moved by the backend,
-    // so we must give hints to _getRowForNode to get the old row position.
-    let oldParentRow = aOldParent == this._rootNode ?
-                         undefined : this._getRowForNode(aOldParent, true);
-    let oldRow = this._getRowForNode(aNode, true, oldParentRow, aOldIndex);
-    if (oldRow < 0)
-      throw Cr.NS_ERROR_UNEXPECTED;
-
-    // If this node is a container it could take up more than one row.
-    var count = this._countVisibleRowsForNodeAtRow(oldRow);
-
-    // Persist selection state.
-    var nodesToReselect =
-      this._getSelectedNodesInRange(oldRow, oldRow + count);
-    if (nodesToReselect.length > 0)
-      this.selection.selectEventsSuppressed = true;
-
-    // Redraw the parent if its twisty state has changed.
-    if (aOldParent != this._rootNode && !aOldParent.hasChildren) {
-      let parentRow = oldRow - 1;
-      this._tree.invalidateRow(parentRow);
-    }
-
-    // Remove node and its children, if any, from the old position.
-    for (let splicedNode of this._rows.splice(oldRow, count)) {
-      this._nodeDetails.delete(makeNodeDetailsKey(splicedNode));
-    }
-    this._tree.rowCountChanged(oldRow, -count);
-
-    // Insert the node into the new position
-    this.nodeInserted(aNewParent, aNode, aNewIndex);
-
-    // Restore selection
-    if (nodesToReselect.length > 0) {
-      this._restoreSelection(nodesToReselect, aNewParent);
-      this.selection.selectEventsSuppressed = false;
-    }
-  },
-
-  // This is _invalidateCellValue in the original implementation.
-  invalidateNode: function PTV_invalidateNode(aNode) {
-    NS_ASSERT(this._result, "Got a notification but have no result!");
-    var viewIndex = aNode.viewIndex;
-    if (this._tree && viewIndex >= 0)
-      this._tree.invalidateRow(viewIndex);
-  },
-
-  nodeTitleChanged: function PTV_nodeTitleChanged(aNode, aNewTitle) {
-    this.invalidateNode(aNode);
-  },
-
-  nodeURIChanged: function PTV_nodeURIChanged(aNode, aOldURI) {
-    this._nodeDetails.delete(makeNodeDetailsKey({uri: aOldURI,
-                                                 itemId: aNode.itemId,
-                                                 time: aNode.time}));
-    this._nodeDetails.set(makeNodeDetailsKey(aNode), aNode);
-  },
-
-  nodeIconChanged: function PTV_nodeIconChanged(aNode) { },
-
-  nodeHistoryDetailsChanged:
-  function PTV_nodeHistoryDetailsChanged(aNode, aOldVisitDate,
-                                         aOldVisitCount) {
-    this._nodeDetails.delete(makeNodeDetailsKey({uri: aNode.uri,
-                                                 itemId: aNode.itemId,
-                                                 time: aOldVisitDate}));
-    this._nodeDetails.set(makeNodeDetailsKey(aNode), aNode);
-    this.invalidateNode(aNode);
-  },
-
-  nodeTagsChanged: function PTV_nodeTagsChanged(aNode) { },
-
-  nodeKeywordChanged: function PTV_nodeKeywordChanged(aNode, aNewKeyword) { },
-
-  nodeAnnotationhanged: function PTV_nodeAnnotationhanged(aNode, aAnno) { },
-
-  nodeDateAddedChanged: function PTV_nodeDateAddedChanged(aNode, aNewValue) { },
-
-  nodeLastModifiedChanged: function PTV_nodeLastModifiedChanged(aNode, aNewValue) { },
-
-  containerStateChanged:
-  function PTV_containerStateChanged(aNode, aOldState, aNewState) {
-    this.invalidateContainer(aNode);
-  },
-
-  invalidateContainer: function PTV_invalidateContainer(aContainer) {
-    NS_ASSERT(this._result, "Need to have a result to update");
-    if (!this._tree)
-      return;
-
-    var startReplacement, replaceCount;
-    if (aContainer == this._rootNode) {
-      startReplacement = 0;
-      replaceCount = this._rows.length;
-
-      // If the root node is now closed, the tree is empty.
-      if (!this._rootNode.containerOpen) {
-        this._nodeDetails.clear();
-        this._rows = [];
-        if (replaceCount)
-          this._tree.rowCountChanged(startReplacement, -replaceCount);
-
-        return;
-      }
-    }
-    else {
-      // Update the twisty state.
-      let row = this._getRowForNode(aContainer);
-      this._tree.invalidateRow(row);
-
-      // We don't replace the container node itself, so we should decrease the
-      // replaceCount by 1.
-      startReplacement = row + 1;
-      replaceCount = this._countVisibleRowsForNodeAtRow(row) - 1;
-    }
-
-    // Persist selection state.
-    var nodesToReselect =
-      this._getSelectedNodesInRange(startReplacement,
-                                    startReplacement + replaceCount);
-
-    // Now update the number of elements.
-    this.selection.selectEventsSuppressed = true;
-
-    // First remove the old elements
-    for (let splicedNode of this._rows.splice(startReplacement, replaceCount)) {
-      this._nodeDetails.delete(makeNodeDetailsKey(splicedNode));
-    }
-
-    // If the container is now closed, we're done.
-    if (!aContainer.containerOpen) {
-      let oldSelectionCount = this.selection.count;
-      if (replaceCount)
-        this._tree.rowCountChanged(startReplacement, -replaceCount);
-
-      // Select the row next to the closed container if any of its
-      // children were selected, and nothing else is selected.
-      if (nodesToReselect.length > 0 &&
-          nodesToReselect.length == oldSelectionCount) {
-        this.selection.rangedSelect(startReplacement, startReplacement, true);
-        this._tree.ensureRowIsVisible(startReplacement);
-      }
-
-      this.selection.selectEventsSuppressed = false;
-      return;
-    }
-
-    // Otherwise, start a batch first.
-    this._tree.beginUpdateBatch();
-    if (replaceCount)
-      this._tree.rowCountChanged(startReplacement, -replaceCount);
-
-    var toOpenElements = [];
-    var elementsAddedCount = this._buildVisibleSection(aContainer,
-                                                       startReplacement,
-                                                       toOpenElements);
-    if (elementsAddedCount)
-      this._tree.rowCountChanged(startReplacement, elementsAddedCount);
-
-    // Now, open any containers that were persisted.
-    for (let i = 0; i < toOpenElements.length; i++) {
-      let item = toOpenElements[i];
-      let parent = item.parent;
-
-      // Avoid recursively opening containers.
-      while (parent) {
-        if (parent.uri == item.uri)
-          break;
-        parent = parent.parent;
-      }
-
-      // If we don't have a parent, we made it all the way to the root
-      // and didn't find a match, so we can open our item.
-      if (!parent && !item.containerOpen)
-        item.containerOpen = true;
-    }
-
-    this._tree.endUpdateBatch();
-
-    // Restore selection.
-    this._restoreSelection(nodesToReselect, aContainer);
-    this.selection.selectEventsSuppressed = false;
-  },
-
-  sortingChanged: function PTV__sortingChanged(aSortingMode) {
-    if (!this._tree || !this._result)
-      return;
-
-    // Depending on the sort mode, certain commands may be disabled
-    window.updateCommands("sort");
-
-    var columns = this._tree.columns;
-
-    // Clear old sorting indicator
-    var sortedColumn = columns.getSortedColumn();
-    if (sortedColumn)
-      sortedColumn.element.removeAttribute("sortDirection");
-
-    switch (aSortingMode) {
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING:
-        columns.Name.element.setAttribute("sortDirection", "ascending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_DESCENDING:
-        columns.Name.element.setAttribute("sortDirection", "descending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING:
-        columns.Date.element.setAttribute("sortDirection", "ascending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING:
-        columns.Date.element.setAttribute("sortDirection", "descending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_URI_ASCENDING:
-        columns.URL.element.setAttribute("sortDirection", "ascending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_URI_DESCENDING:
-        columns.URL.element.setAttribute("sortDirection", "descending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_ASCENDING:
-        columns.VisitCount.element.setAttribute("sortDirection", "ascending");
-        break;
-      case Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING:
-        columns.VisitCount.element.setAttribute("sortDirection", "descending");
-        break;
-    }
-  },
-
-  _inBatchMode: false,
-  batching: function PTV_batching(aBatching) {
-    if (aBatching == this._inBatchMode)
-      return;
-    this._inBatchMode = this.selection.selectEventsSuppressed = aBatching;
-    if (aBatching)
-      this._tree.beginUpdateBatch();
-    else
-      this._tree.endUpdateBatch();
-  },
-
-  get result() {
-    return this._result;
-  },
-
-  set result(val) {
-    if (this._result) {
-      this._result.removeObserver(this);
-      this._rootNode.containerOpen = false;
-    }
-
-    if (val) {
-      this._result = val;
-      this._rootNode = val.root;
-      this._cellProperties = new Map();
-    }
-    else if (this._result) {
-      delete this._result;
-      delete this._rootNode;
-      delete this._cellProperties;
-    }
-
-    // If the tree is not set yet, setTree will call finishInit.
-    if (this._tree && val)
-      this._finishInit();
-
-    return val;
-  },
-
-  nodeForTreeIndex: function PTV_nodeForTreeIndex(aIndex) {
-    if (aIndex > this._rows.length)
-      throw Cr.NS_ERROR_INVALID_ARG;
-
-    return this._getNodeForRow(aIndex);
-  },
-
-  treeIndexForNode: function PTV_treeNodeForIndex(aNode) {
-    // The API allows passing invisible nodes.
-    try {
-      return this._getRowForNode(aNode, true);
-    }
-    catch(ex) { }
-
-    return Ci.nsINavHistoryResultTreeViewer.INDEX_INVISIBLE;
-  },
-
-  // nsITreeView
-  get rowCount() {
-    return this._rows.length;
-  },
-
-  get selection() {
-    return this._selection;
-  },
-
-  set selection(val) {
-    return this._selection = val;
-  },
-
-  getRowProperties: function PTV_getRowProperties(aRow) { return ""; },
-
-  getCellProperties: function PTV_getCellProperties(aRow, aColumn) {
-    if (aColumn.id != "Name")
-      return "";
-
-    let node = this._getNodeForRow(aRow);
-    let properties = this._cellProperties.get(node);
-    if (!properties) {
-      properties = "Name";
-      if (node.type == Ci.nsINavHistoryResultNode.RESULT_TYPE_QUERY) {
-        properties += " query";
-        if (PlacesUtils.nodeIsDay(node))
-          properties += " dayContainer";
-        else if (PlacesUtils.nodeIsHost(node))
-          properties += " hostContainer";
-      }
-
-      this._cellProperties.set(node, properties);
-    }
-    return properties;
-  },
-
-  getColumnProperties: function(aColumn) { return ""; },
-
-  isContainer: function PTV_isContainer(aRow) {
-    // Only leaf nodes aren't listed in the rows array.
-    var node = this._rows[aRow];
-    if (node === undefined)
-      return false;
-
-    if (PlacesUtils.nodeIsContainer(node)) {
-      // the root node is always expandable
-      if (!node.parent)
-        return true;
-
-      // treat non-expandable childless queries as non-containers
-      if (PlacesUtils.nodeIsQuery(node)) {
-        let parent = node.parent;
-        if ((PlacesUtils.nodeIsQuery(parent) ||
-             PlacesUtils.nodeIsFolder(parent)) &&
-            !node.hasChildren)
-          return PlacesUtils.asQuery(parent).queryOptions.expandQueries;
-      }
-      return true;
-    }
-    return false;
-  },
-
-  isContainerOpen: function PTV_isContainerOpen(aRow) {
-    // All containers are listed in the rows array.
-    return this._rows[aRow].containerOpen;
-  },
-
-  isContainerEmpty: function PTV_isContainerEmpty(aRow) {
-    // All containers are listed in the rows array.
-    return !this._rows[aRow].hasChildren;
-  },
-
-  isSeparator: function PTV_isSeparator(aRow) { return false; },
-
-  isSorted: function PTV_isSorted() {
-    return this._result.sortingMode !=
-           Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
-  },
-
-  canDrop: function PTV_canDrop(aRow, aOrientation, aDataTransfer) { return false; },
-  drop: function PTV_drop(aRow, aOrientation, aDataTransfer) { return; },
-
-  getParentIndex: function PTV_getParentIndex(aRow) {
-    let [parentNode, parentRow] = this._getParentByChildRow(aRow);
-    return parentRow;
-  },
-
-  hasNextSibling: function PTV_hasNextSibling(aRow, aAfterIndex) {
-    if (aRow == this._rows.length - 1) {
-      // The last row has no sibling.
-      return false;
-    }
-
-    var node = this._rows[aRow];
-    if (node === undefined || this._isPlainContainer(node.parent)) {
-      // The node is a child of a plain container.
-      // If the next row is either unset or has the same parent,
-      // it's a sibling.
-      let nextNode = this._rows[aRow + 1];
-      return (nextNode == undefined || nextNode.parent == node.parent);
-    }
-
-    var thisLevel = node.indentLevel;
-    for (let i = aAfterIndex + 1; i < this._rows.length; ++i) {
-      let rowNode = this._getNodeForRow(i);
-      let nextLevel = rowNode.indentLevel;
-      if (nextLevel == thisLevel)
-        return true;
-      if (nextLevel < thisLevel)
-        break;
-    }
-
-    return false;
-  },
-
-  getLevel: function(aRow) {
-    return this._getNodeForRow(aRow).indentLevel;
-  },
-
-  getImageSrc: function PTV_getImageSrc(aRow, aColumn) {
-    // Only the title column has an image.
-    if (aColumn.id != "Name")
-      return "";
-
-    return this._getNodeForRow(aRow).icon;
-  },
-
-  getProgressMode: function(aRow, aColumn) { },
-  getCellValue: function(aRow, aColumn) { },
-
-  getCellText: function PTV_getCellText(aRow, aColumn) {
-    var node = this._getNodeForRow(aRow);
-    switch (aColumn.id) {
-      case "Name":
-        // normally, this is just the title, but we don't want empty nodes in
-        // the tree view so return a special string if the title is empty.
-        // Do it here so that callers can still get at the 0 length title
-        // if they go through the "result" API.
-        return PlacesUIUtils.getBestTitle(node);
-      case "URL":
-        if (PlacesUtils.nodeIsURI(node))
-          return node.uri;
-        return "";
-      case "Date":
-        if (node.time == 0 || !PlacesUtils.nodeIsURI(node)) {
-          // hosts and days shouldn't have a value for the date column.
-          // Actually, you could argue this point, but looking at the
-          // results, seeing the most recently visited date is not what
-          // I expect, and gives me no information I know how to use.
-          // Only show this for URI-based nodes.
-          return "";
-        }
-        return this._convertPRTimeToString(node.time);
-      case "VisitCount":
-        return node.accessCount || "";
-    }
-    return "";
-  },
-
-  setTree: function PTV_setTree(aTree) {
-    // If we are replacing the tree during a batch, there is a concrete risk
-    // that the treeView goes out of sync, thus it's safer to end the batch now.
-    // This is a no-op if we are not batching.
-    this.batching(false);
-
-    var hasOldTree = this._tree != null;
-    this._tree = aTree;
-
-    if (this._result) {
-      if (hasOldTree) {
-        // detach from result when we are detaching from the tree.
-        // This breaks the reference cycle between us and the result.
-        if (!aTree) {
-          this._result.removeObserver(this);
-          this._rootNode.containerOpen = false;
-        }
-      }
-      if (aTree)
-        this._finishInit();
-    }
-  },
-
-  toggleOpenState: function PTV_toggleOpenState(aRow) {
-    if (!this._result)
-      throw Cr.NS_ERROR_UNEXPECTED;
-
-    var node = this._rows[aRow];
-    NS_ASSERT(node.uri, "if there is no uri, we can't persist the open state");
-
-    if (node.uri) {
-      if (node.containerOpen)
-        PlacesUIUtils.xulStore.removeValue(location, node.uri, "open");
-      else
-        PlacesUIUtils.xulStore.setValue(location, node.uri, "open", "true");
-    }
-
-    // 474287 Places enforces title sorting for groups, which we don't want.
-    if (!node.containerOption && PlacesUtils.asQuery(node).queryOptions.resultType ==
-        Ci.nsINavHistoryQueryOptions.RESULTS_AS_URI)
-      node.queryOptions.sortingMode = this._result.sortingMode;
-    node.containerOpen = !node.containerOpen;
-  },
-
-  cycleHeader: function PTV_cycleHeader(aColumn) {
-    if (!this._result)
-      throw Cr.NS_ERROR_UNEXPECTED;
-
-    var oldSort = this._result.sortingMode;
-    const NHQO = Ci.nsINavHistoryQueryOptions;
-    var newSort = NHQO.SORT_BY_NONE;
-    switch (aColumn.id) {
-      case "SortAscending":
-        // this bit-twiddling only subtracts one from even numbers
-        newSort = (oldSort - 1) | 1;
-        break;
-
-      case "SortDescending":
-        // add one to odd numbers (ascending sorts are all odd)
-        newSort = oldSort + (oldSort & 1);
-        break;
-
-      case "SortByName":
-      case "Name":
-        if (oldSort == NHQO.SORT_BY_TITLE_ASCENDING)
-          newSort = NHQO.SORT_BY_TITLE_DESCENDING;
-        else if (oldSort != NHQO.SORT_BY_TITLE_DESCENDING)
-          newSort = NHQO.SORT_BY_TITLE_ASCENDING;
-        break;
-
-      case "SortByURL":
-      case "URL":
-        if (oldSort == NHQO.SORT_BY_URI_ASCENDING)
-          newSort = NHQO.SORT_BY_URI_DESCENDING;
-        else if (oldSort != NHQO.SORT_BY_URI_DESCENDING)
-          newSort = NHQO.SORT_BY_URI_ASCENDING;
-        break;
-
-        // date default is unusual because we sort by descending
-        // by default because you are most likely to be looking for
-        // recently visited sites when you click it
-      case "SortByDate":
-      case "Date":
-        if (oldSort == NHQO.SORT_BY_DATE_DESCENDING)
-          newSort = NHQO.SORT_BY_DATE_ASCENDING;
-        else if (oldSort != NHQO.SORT_BY_DATE_ASCENDING)
-          newSort = NHQO.SORT_BY_DATE_DESCENDING;
-        break;
-
-      case "SortByVisitCount":
-      case "VisitCount":
-        // visit count default is unusual because we sort by descending
-        // by default because you are most likely to be looking for
-        // highly visited sites when you click it
-        if (oldSort == NHQO.SORT_BY_VISITCOUNT_DESCENDING)
-          newSort = NHQO.SORT_BY_VISITCOUNT_ASCENDING;
-        else if (oldSort != NHQO.SORT_BY_VISITCOUNT_ASCENDING)
-          newSort = NHQO.SORT_BY_VISITCOUNT_DESCENDING;
-        break;
-
-      default:
-        if (oldSort == newSort)
-          return;
-    }
-    this._result.sortingMode = newSort;
-  },
-
-  isEditable: function(aRow, aColumn) { return false; },
-  setCellText: function(aRow, aColumn, aText) { },
-  selectionChanged: function() { },
-  cycleCell: function(aRow, aColumn) { },
-  isSelectable: function(aRow, aColumn) { return false; },
-  performAction: function(aAction) { },
-  performActionOnRow: function(aAction, aRow) { },
-  performActionOnCell: function(aAction, aRow, aColumn) { }
-};
rename from suite/modules/PlacesUIUtils.jsm
rename to suite/common/places/PlacesUIUtils.jsm
rename from suite/common/bookmarks/bm-props.js
rename to suite/common/places/content/bookmarkProperties.js
rename from suite/common/bookmarks/bm-props.xul
rename to suite/common/places/content/bookmarkProperties.xul
rename from suite/common/bookmarks/bm-panel.js
rename to suite/common/places/content/bookmarksPanel.js
rename from suite/common/bookmarks/bm-panel.xul
rename to suite/common/places/content/bookmarksPanel.xul
rename from suite/common/places/browserPlacesViews.js
rename to suite/common/places/content/browserPlacesViews.js
rename from suite/common/places/controller.js
rename to suite/common/places/content/controller.js
rename from suite/common/bookmarks/editBookmarkOverlay.js
rename to suite/common/places/content/editBookmarkOverlay.js
rename from suite/common/bookmarks/editBookmarkOverlay.xul
rename to suite/common/places/content/editBookmarkOverlay.xul
rename from suite/common/history/history.js
rename to suite/common/places/content/history-panel.js
rename from suite/common/history/history-panel.xul
rename to suite/common/places/content/history-panel.xul
rename from suite/common/places/menu.xml
rename to suite/common/places/content/menu.xml
rename from suite/common/bookmarks/moveBookmarks.js
rename to suite/common/places/content/moveBookmarks.js
rename from suite/common/bookmarks/moveBookmarks.xul
rename to suite/common/places/content/moveBookmarks.xul
rename from suite/common/bookmarks/bookmarksManager.css
rename to suite/common/places/content/organizer.css
rename from suite/common/places/places.css
rename to suite/common/places/content/places.css
rename from suite/common/bookmarks/bookmarksManager.js
rename to suite/common/places/content/places.js
rename from suite/common/bookmarks/bookmarksManager.xul
rename to suite/common/places/content/places.xul
rename from suite/common/bookmarks/placesOverlay.xul
rename to suite/common/places/content/placesOverlay.xul
rename from suite/common/places/sidebarUtils.js
rename to suite/common/places/content/sidebarUtils.js
rename from suite/common/places/tree.xml
rename to suite/common/places/content/tree.xml
rename from suite/common/places/treeView.js
rename to suite/common/places/content/treeView.js
deleted file mode 100644
--- a/suite/locales/en-US/chrome/common/history/history.dtd
+++ /dev/null
@@ -1,57 +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/. -->
-
-<!-- history.xul, history-panel.xul, placesOverlay.xul -->
-
-<!ENTITY historyWindowTitle.label       "History">
-<!ENTITY menuBar.tooltip                "Menu Bar">
-<!ENTITY searchBar.tooltip              "Search Bar">
-
-<!ENTITY search.placeholder             "Search History">
-<!ENTITY search.key                     "f">
-<!ENTITY view.label                     "View">
-
-<!ENTITY view.columns.label             "Show Columns">
-<!ENTITY view.columns.accesskey         "C">
-<!ENTITY view.sortBy.label              "Sort by">
-<!ENTITY view.sortBy.accesskey          "S">
-<!ENTITY view.groupBy.label             "Group by">
-<!ENTITY view.groupBy.accesskey         "G">
-
-<!ENTITY view.unsorted.label            "Unsorted">
-<!ENTITY view.unsorted.accesskey        "U">
-<!ENTITY view.sortAscending.label       "A > Z Sort Order">
-<!ENTITY view.sortAscending.accesskey   "A">
-<!ENTITY view.sortDescending.label      "Z > A Sort Order">
-<!ENTITY view.sortDescending.accesskey  "Z">
-
-<!ENTITY view.groupNone.label           "None">
-<!ENTITY view.groupNone.accesskey       "N">
-<!ENTITY view.groupDay.label            "Day">
-<!ENTITY view.groupDay.accesskey        "D">
-<!ENTITY view.groupSite.label           "Website">
-<!ENTITY view.groupSite.accesskey       "W">
-<!ENTITY view.groupDayAndSite.label     "Day and Website">
-<!ENTITY view.groupDayAndSite.accesskey "a">
-
-<!ENTITY cmd.open.label                 "Open">
-<!ENTITY cmd.open.accesskey             "O">
-<!ENTITY cmd.open_window.label          "Open Link in New Window">
-<!ENTITY cmd.open_window.accesskey      "W">
-<!ENTITY cmd.open_tab.label             "Open Link in New Tab">
-<!ENTITY cmd.open_tab.accesskey         "T">
-
-<!ENTITY bookmarkLinkCmd.label          "Bookmark This Link…">
-<!ENTITY bookmarkLinkCmd.accesskey      "B">
-<!ENTITY bookmarkLinksCmd.label         "Bookmark These Links…">
-<!ENTITY bookmarkLinksCmd.accesskey     "B">
-
-<!ENTITY col.title.label                "Title">
-<!ENTITY col.title.accesskey            "T">
-<!ENTITY col.url.label                  "Location">
-<!ENTITY col.url.accesskey              "L">
-<!ENTITY col.lastvisit.label            "Last Visited">
-<!ENTITY col.lastvisit.accesskey        "V">
-<!ENTITY col.visitcount.label           "Visit Count">
-<!ENTITY col.visitcount.accesskey       "C">
rename from suite/locales/en-US/chrome/common/bookmarks/bm-props.properties
rename to suite/locales/en-US/chrome/common/places/bookmarkProperties.properties
rename from suite/locales/en-US/chrome/common/bookmarks/editBookmarkOverlay.dtd
rename to suite/locales/en-US/chrome/common/places/editBookmarkOverlay.dtd
rename from suite/locales/en-US/chrome/common/bookmarks/moveBookmarks.dtd
rename to suite/locales/en-US/chrome/common/places/moveBookmarks.dtd
rename from suite/locales/en-US/chrome/common/bookmarks/places.dtd
rename to suite/locales/en-US/chrome/common/places/places.dtd
deleted file mode 100644
--- a/suite/themes/classic/communicator/bookmarks/bookmarksWindow.css
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C; c-basic-offset: 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 url("chrome://communicator/skin/bookmarks/bookmarks.css");
-
-@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
-
-#status-bar {
-  height: 1em;
-}
-
-#panel-bar,
-#search-bar {
-  border-top: 1px solid ThreeDHighlight;
-  border-bottom: 1px solid ThreeDShadow;
-}
-
-bookmarks-tree.inset {
-  margin: 0px;
-  -moz-border-top-colors: ThreeDDarkShadow ThreeDShadow;
-  -moz-border-right-colors: ThreeDFace ThreeDHighlight;
-  -moz-border-bottom-colors: ThreeDFace ThreeDHighlight;
-  -moz-border-left-colors: ThreeDDarkShadow ThreeDShadow;
-}
rename from suite/themes/classic/communicator/bookmarks/allBookmarks.png
rename to suite/themes/classic/communicator/places/allBookmarks.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-folder-closed.png
rename to suite/themes/classic/communicator/places/bookmark-folder-closed.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-folder-dis.png
rename to suite/themes/classic/communicator/places/bookmark-folder-dis.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-folder-open.png
rename to suite/themes/classic/communicator/places/bookmark-folder-open.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-item-dis.png
rename to suite/themes/classic/communicator/places/bookmark-item-dis.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-item-updated.png
rename to suite/themes/classic/communicator/places/bookmark-item-updated.png
rename from suite/themes/classic/communicator/bookmarks/bookmark-item.svg
rename to suite/themes/classic/communicator/places/bookmark-item.svg
rename from suite/themes/classic/communicator/bookmarks/bookmark.png
rename to suite/themes/classic/communicator/places/bookmark.png
rename from suite/themes/classic/communicator/bookmarks/bookmarks.css
rename to suite/themes/classic/communicator/places/bookmarks.css
rename from suite/themes/classic/communicator/bookmarks/bookmarksMenu.png
rename to suite/themes/classic/communicator/places/bookmarksMenu.png
rename from suite/themes/classic/communicator/bookmarks/bookmarksToolbar.css
rename to suite/themes/classic/communicator/places/bookmarksToolbar.css
rename from suite/themes/classic/communicator/bookmarks/bookmarksToolbar.png
rename to suite/themes/classic/communicator/places/bookmarksToolbar.png
rename from suite/themes/classic/communicator/history/calendar.png
rename to suite/themes/classic/communicator/places/calendar.png
rename from suite/themes/classic/communicator/bookmarks/editBookmarkOverlay.css
rename to suite/themes/classic/communicator/places/editBookmarkOverlay.css
rename from suite/themes/classic/communicator/bookmarks/livemark-folder.png
rename to suite/themes/classic/communicator/places/livemark-folder.png
rename from suite/themes/classic/communicator/bookmarks/bookmarksManager.css
rename to suite/themes/classic/communicator/places/organizer.css
rename from suite/themes/classic/communicator/bookmarks/query.png
rename to suite/themes/classic/communicator/places/query.png
rename from suite/themes/classic/communicator/bookmarks/tag.png
rename to suite/themes/classic/communicator/places/tag.png
rename from suite/themes/classic/communicator/bookmarks/toolbarDropMarker.png
rename to suite/themes/classic/communicator/places/toolbarDropMarker.png
rename from suite/themes/classic/communicator/bookmarks/unsortedBookmarks.png
rename to suite/themes/classic/communicator/places/unsortedBookmarks.png
rename from suite/themes/classic/mac/communicator/bookmarks/bookmarks.css
rename to suite/themes/classic/mac/communicator/places/bookmarks.css
rename from suite/themes/classic/mac/communicator/bookmarks/bookmarksMenu.png
rename to suite/themes/classic/mac/communicator/places/bookmarksMenu.png
rename from suite/themes/classic/mac/communicator/bookmarks/bookmarksToolbar.css
rename to suite/themes/classic/mac/communicator/places/bookmarksToolbar.css
rename from suite/themes/classic/mac/communicator/bookmarks/bookmarksToolbar.png
rename to suite/themes/classic/mac/communicator/places/bookmarksToolbar.png
rename from suite/themes/classic/mac/communicator/bookmarks/editBookmarkOverlay.css
rename to suite/themes/classic/mac/communicator/places/editBookmarkOverlay.css
rename from suite/themes/classic/mac/communicator/bookmarks/livemark-folder.png
rename to suite/themes/classic/mac/communicator/places/livemark-folder.png
rename from suite/themes/classic/mac/communicator/bookmarks/bookmarksManager.css
rename to suite/themes/classic/mac/communicator/places/places.css
rename from suite/themes/classic/mac/communicator/bookmarks/query.png
rename to suite/themes/classic/mac/communicator/places/query.png
rename from suite/themes/classic/mac/communicator/bookmarks/tag.png
rename to suite/themes/classic/mac/communicator/places/tag.png
rename from suite/themes/classic/mac/communicator/bookmarks/toolbarDropMarker.png
rename to suite/themes/classic/mac/communicator/places/toolbarDropMarker.png
rename from suite/themes/modern/communicator/bookmarks/allBookmarks.png
rename to suite/themes/modern/communicator/places/allBookmarks.png
rename from suite/themes/modern/communicator/bookmarks/bookmark-folder-closed.gif
rename to suite/themes/modern/communicator/places/bookmark-folder-closed.gif
rename from suite/themes/modern/communicator/bookmarks/bookmark-folder-dis.gif
rename to suite/themes/modern/communicator/places/bookmark-folder-dis.gif
rename from suite/themes/modern/communicator/bookmarks/bookmark-folder-open.gif
rename to suite/themes/modern/communicator/places/bookmark-folder-open.gif
rename from suite/themes/modern/communicator/bookmarks/bookmark-item-dis.gif
rename to suite/themes/modern/communicator/places/bookmark-item-dis.gif
rename from suite/themes/modern/communicator/bookmarks/bookmark-item-updated.gif
rename to suite/themes/modern/communicator/places/bookmark-item-updated.gif
rename from suite/themes/modern/communicator/bookmarks/bookmark-item.svg
rename to suite/themes/modern/communicator/places/bookmark-item.svg
rename from suite/themes/modern/communicator/bookmarks/bookmark.png
rename to suite/themes/modern/communicator/places/bookmark.png
rename from suite/themes/modern/communicator/bookmarks/bookmarks.css
rename to suite/themes/modern/communicator/places/bookmarks.css
rename from suite/themes/modern/communicator/bookmarks/bookmarksMenu.png
rename to suite/themes/modern/communicator/places/bookmarksMenu.png
rename from suite/themes/modern/communicator/bookmarks/bookmarksToolbar.css
rename to suite/themes/modern/communicator/places/bookmarksToolbar.css
rename from suite/themes/modern/communicator/bookmarks/bookmarksToolbar.png
rename to suite/themes/modern/communicator/places/bookmarksToolbar.png
rename from suite/themes/modern/communicator/history/calendar.png
rename to suite/themes/modern/communicator/places/calendar.png
rename from suite/themes/modern/communicator/bookmarks/editBookmarkOverlay.css
rename to suite/themes/modern/communicator/places/editBookmarkOverlay.css
rename from suite/themes/modern/communicator/bookmarks/livemark-folder.png
rename to suite/themes/modern/communicator/places/livemark-folder.png
rename from suite/themes/modern/communicator/bookmarks/bookmarksManager.css
rename to suite/themes/modern/communicator/places/organizer.css
rename from suite/themes/modern/communicator/bookmarks/query.png
rename to suite/themes/modern/communicator/places/query.png
rename from suite/themes/modern/communicator/bookmarks/tag.png
rename to suite/themes/modern/communicator/places/tag.png
rename from suite/themes/modern/communicator/bookmarks/toolbarDropMarker.png
rename to suite/themes/modern/communicator/places/toolbarDropMarker.png
rename from suite/themes/modern/communicator/bookmarks/unsortedBookmarks.png
rename to suite/themes/modern/communicator/places/unsortedBookmarks.png