bug 580660 - Switch SeaMonkey browser UI to places bookmarks, r=IanN
authorRobert Kaiser <kairo@kairo.at>
Sun, 08 Aug 2010 22:06:47 +0200
changeset 6099 05e7e38f82ea
parent 6098 50c4aad57952
child 6100 b7f04f55aa20
push id4716
push userkairo@kairo.at
push dateSun, 08 Aug 2010 20:07:31 +0000
treeherdercomm-central@b9e980d6f85d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs580660
bug 580660 - Switch SeaMonkey browser UI to places bookmarks, r=IanN
suite/browser/hiddenWindow.xul
suite/browser/navigator.css
suite/browser/navigator.js
suite/browser/navigator.xul
suite/browser/navigatorOverlay.xul
suite/browser/public/Makefile.in
suite/browser/src/Makefile.in
suite/build/nsSuiteModule.cpp
suite/common/bookmarks/bm-panel.js
suite/common/bookmarks/bm-panel.xul
suite/common/bookmarks/browser-places.js
suite/common/bookmarks/placesOverlay.xul
suite/common/contentAreaContextOverlay.xul
suite/common/feeds/subscribe.xhtml
suite/common/jar.mn
suite/common/nsContextMenu.js
suite/common/search/search-panel.js
suite/feeds/src/FeedConverter.js
suite/feeds/src/FeedWriter.js
suite/locales/en-US/chrome/browser/navigator.dtd
suite/locales/en-US/chrome/browser/navigator.properties
suite/locales/en-US/chrome/common/bookmarks/places.dtd
suite/locales/en-US/chrome/common/feeds/subscribe.dtd
suite/locales/jar.mn
suite/themes/classic/communicator/bookmarks/allBookmarks.png
suite/themes/classic/communicator/bookmarks/bookmark-folder-button.gif
suite/themes/classic/communicator/bookmarks/bookmark-group.png
suite/themes/classic/communicator/bookmarks/bookmark-item-updated.png
suite/themes/classic/communicator/bookmarks/bookmarks.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/livemark-folder.png
suite/themes/classic/communicator/bookmarks/livemark-item.png
suite/themes/classic/communicator/bookmarks/location-act.gif
suite/themes/classic/communicator/bookmarks/location-dis.gif
suite/themes/classic/communicator/bookmarks/location-hov.gif
suite/themes/classic/communicator/bookmarks/location.gif
suite/themes/classic/communicator/bookmarks/query.png
suite/themes/classic/communicator/bookmarks/toolbarDropMarker.png
suite/themes/classic/communicator/bookmarks/unsortedBookmarks.png
suite/themes/classic/jar.mn
suite/themes/classic/mac/communicator/bookmarks/bookmarks.css
suite/themes/classic/mac/navigator/navigator.css
suite/themes/classic/navigator/navigator.css
--- a/suite/browser/hiddenWindow.xul
+++ b/suite/browser/hiddenWindow.xul
@@ -68,17 +68,16 @@
   onunload="Shutdown();">
 
   <!-- JS from navigator.xul, to handle the menu commands -->
   <script type="application/javascript" src="chrome://navigator/content/browser.js"/>
   <script type="application/javascript" src="chrome://navigator/content/navigator.js"/>
 
   <!-- Shared Bookmarks Utility Library -->
   <script type="application/javascript" src="chrome://communicator/content/bookmarks/bookmarks.js"/>
-  <script type="application/javascript" src="chrome://communicator/content/bookmarks/bookmarksMenu.js"/>
 
   <stringbundleset id="stringbundleset">
     <stringbundle id="bundle_navigator" src="chrome://navigator/locale/navigator.properties"/>
     <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundle_navigator_region" src="chrome://navigator-region/locale/region.properties"/>
   </stringbundleset>
 
   <!-- keys are appended from the overlay -->
--- a/suite/browser/navigator.css
+++ b/suite/browser/navigator.css
@@ -38,16 +38,22 @@ panel[for="urlbar"] {
 }
 
 /* ::::: bookmarks menu ::::: */
 
 .isempty:not(:last-child) {
   display: none;
 }
 
+/* ::::: bookmarks toolbar ::::: */
+
+toolbarpaletteitem[place="palette"] > toolbaritem > hbox[type="places"] {
+  display: none;
+}
+
 /* ::::: autohide the menubar for full screen on linux too ::::: */
 
 #toolbar-menubar[autohide="true"]
 {
   -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-menubar-autohide");
   overflow: hidden;
 }
 
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -42,17 +42,16 @@
 Components.utils.import("resource://gre/modules/AddonManager.jsm");
 
 const REMOTESERVICE_CONTRACTID = "@mozilla.org/toolkit/remote-service;1";
 const XUL_NAMESPACE = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
 var gURLBar = null;
 var gProxyButton = null;
 var gProxyFavIcon = null;
 var gProxyDeck = null;
-var gBookmarksService = null;
 var gSearchService = null;
 var gNavigatorBundle;
 var gBrandBundle;
 var gNavigatorRegionBundle;
 var gLastValidURLStr = "";
 var gLastValidURL = null;
 var gClickSelectsAll = false;
 var gClickAtEndSelects = false;
@@ -186,17 +185,16 @@ function removePopupPermListener(observe
 * We can avoid adding multiple load event listeners and save some time by adding
 * one listener that calls all real handlers.
 */
 
 function pageShowEventHandlers(event)
 {
   // Filter out events that are not about the document load we are interested in
   if (event.originalTarget == content.document) {
-    UpdateBookmarksLastVisitedDate(event);
     UpdateInternetSearchResults(event);
     checkForDirectoryListing();
     postURLToNativeWidget();
   }
 }
 
 /**
  * Determine whether or not the content area is displaying a page with frames,
@@ -231,44 +229,16 @@ function updateHomeButtonTooltip()
 
   for (var i in homePage) {
     var label = document.createElementNS(XUL_NAMESPACE, "label");
     label.setAttribute("value", homePage[i]);
     tooltip.appendChild(label);
   }
 }
 
-//////////////////////////////// BOOKMARKS ////////////////////////////////////
-
-function UpdateBookmarksLastVisitedDate(event)
-{
-  var url = getWebNavigation().currentURI.spec;
-  if (url) {
-    // if the URL is bookmarked, update its "Last Visited" date
-    if (!gBookmarksService)
-      gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
-                                    .getService(Components.interfaces.nsIBookmarksService);
-
-    gBookmarksService.updateLastVisitedDate(url, content.document.characterSet);
-  }
-}
-
-function HandleBookmarkIcon(iconURL, addFlag)
-{
-  var url = content.document.documentURI;
-  if (url) {
-    // update URL with new icon reference
-    if (!gBookmarksService)
-      gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
-                                    .getService(Components.interfaces.nsIBookmarksService);
-    if (addFlag)    gBookmarksService.updateBookmarkIcon(url, iconURL);
-    else            gBookmarksService.removeBookmarkIcon(url, iconURL);
-  }
-}
-
 function UpdateInternetSearchResults(event)
 {
   var url = getWebNavigation().currentURI.spec;
   if (url && isSearchPanelOpen())
   {
     if (!gSearchService)
       gSearchService = Components.classes["@mozilla.org/rdf/datasource;1?name=internetsearch"]
                                  .getService(Components.interfaces.nsIInternetSearchService);
@@ -632,18 +602,20 @@ function Startup()
     document.getElementById("textfieldDirection-swap").hidden = false;
   }
 
   // Before and after callbacks for the customizeToolbar code
   getNavToolbox().customizeInit = BrowserToolboxCustomizeInit;
   getNavToolbox().customizeDone = BrowserToolboxCustomizeDone;
   getNavToolbox().customizeChange = BrowserToolboxCustomizeChange;
 
-  // now load bookmarks after a delay
-  setTimeout(LoadBookmarksCallback, 0);
+  PlacesToolbarHelper.init();
+
+  // bookmark-all-tabs command
+  gBookmarkAllTabsHandler.init();
 
   gBrowser.mPanelContainer.addEventListener("InstallBrowserTheme", LightWeightThemeWebInstaller, false, true);
   gBrowser.mPanelContainer.addEventListener("PreviewBrowserTheme", LightWeightThemeWebInstaller, false, true);
   gBrowser.mPanelContainer.addEventListener("ResetBrowserThemePreview", LightWeightThemeWebInstaller, false, true);
 
   // initialize the session-restore service
   setTimeout(InitSessionStoreCallback, 0);
 }
@@ -659,30 +631,16 @@ function UpdateNavBar()
     if (!next || !next.classList.contains("nav-bar-class"))
       element.classList.add("nav-bar-last");
     var previous = element.previousSibling;
     if (!previous || !previous.classList.contains("nav-bar-class"))
       element.classList.add("nav-bar-first");
   }
 }
 
-function LoadBookmarksCallback()
-{
-  // loads the services
-  initServices();
-  initBMService();
-  BMSVC.readBookmarks();
-  var bt = document.getElementById("bookmarks-ptf");
-  if (bt) {
-    bt.database.AddObserver(BookmarksToolbarRDFObserver);
-  }
-  window.addEventListener("resize", BookmarksToolbar.resizeFunc, false);
-  controllers.appendController(BookmarksMenuController);
-}
-
 function InitSessionStoreCallback()
 {
   try {
     var ss = Components.classes["@mozilla.org/suite/sessionstore;1"]
                        .getService(Components.interfaces.nsISessionStore);
     ss.init(window);
   } catch(ex) {
     dump("nsSessionStore could not be initialized: " + ex + "\n");
@@ -704,63 +662,38 @@ function WindowFocusTimerCallback(elemen
       document.commandDispatcher.focusedElement = null;
     } else if (element instanceof Components.interfaces.nsIDOMElement) {
       document.commandDispatcher.focusedWindow = element.ownerDocument.defaultView;
       document.commandDispatcher.focusedElement = element;
     }
   }
 }
 
-function BrowserFlushBookmarks()
-{
-  // Flush bookmarks (used when window closes or is cached).
-  try {
-    // If bookmarks are dirty, flush 'em to disk
-    var bmks = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
-                         .getService(Components.interfaces.nsIRDFRemoteDataSource);
-    bmks.Flush();
-  } catch(ex) {
-  }
-}
-
 function Shutdown()
 {
   AddonManager.removeAddonListener(gAddonListener);
 
   // shut down browser access support
   window.browserDOMWindow = null;
 
   try {
     getBrowser().removeProgressListener(window.XULBrowserWindow);
   } catch (ex) {
     // Perhaps we didn't get around to adding the progress listener
   }
 
-  try {
-    controllers.removeController(BookmarksMenuController);
-  } catch (ex) {
-    // Perhaps we didn't get around to adding the controller
-  }
-
-  var bt = document.getElementById("bookmarks-ptf");
-  if (bt) {
-    bt.database.RemoveObserver(BookmarksToolbarRDFObserver);
-  }
-
   window.XULBrowserWindow.destroy();
   window.XULBrowserWindow = null;
   window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsIWebNavigation)
         .QueryInterface(Components.interfaces.nsIDocShellTreeItem).treeOwner
         .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
         .getInterface(Components.interfaces.nsIXULWindow)
         .XULBrowserWindow = null;
 
-  BrowserFlushBookmarks();
-
   // unregister us as a pref listener
   removePrefListener(gTabStripPrefListener);
   removePrefListener(gHomepagePrefListener);
   removePrefListener(gStatusBarPopupIconPrefListener);
   removePopupPermListener(gPopupPermListener);
 
   window.browserContentListener.close();
 }
@@ -904,67 +837,82 @@ function BrowserReloadSkipCache()
   const reloadFlags = nsIWebNavigation.LOAD_FLAGS_BYPASS_PROXY | nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE;
   return BrowserReloadWithFlags(reloadFlags);
 }
 
 function BrowserHome(aEvent)
 {
   var tab;
   var homePage = getHomePage();
-  var target = !gBrowser ? "window": !aEvent ? "current" : BookmarksUtils.getBrowserTargetFromEvent(aEvent);
+  var target = !gBrowser ? "window" : whereToOpenLink(aEvent);
 
   if (homePage.length == 1) {
     switch (target) {
     case "current":
       loadURI(homePage[0]);
       break;
     case "tab":
+    case "tabshifted":
       tab = gBrowser.addTab(homePage[0]);
-      if (!BookmarksUtils.shouldLoadTabInBackground(aEvent))
+      if (target != "tabshifted")
         gBrowser.selectedTab = tab;
       break;
     case "window":
       openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", homePage[0]);
     }
   } else {
     if (target == "window")
       openDialog(getBrowserURL(), "_blank", "chrome,all,dialog=no", homePage.join("\n"));
     else {
       var URIs = [];
       for (var i in homePage)
         URIs.push({URI: homePage[i]});
 
       tab = gBrowser.loadGroup(URIs);
-      
-      if (!BookmarksUtils.shouldLoadTabInBackground(aEvent))
+
+      if (target != "tabshifted")
         gBrowser.selectedTab = tab;
     }
   }
 }
 
-function addBookmarkAs()
-{
-  const browsers = gBrowser.browsers;
-  if (browsers.length > 1)
-    BookmarksUtils.addBookmarkForTabBrowser(gBrowser);
-  else
-    BookmarksUtils.addBookmarkForBrowser(gBrowser.webNavigation, true);
-}
+/**
+ * This also takes care of updating the command enabled-state when tabs are
+ * created or removed.
+ */
+var gBookmarkAllTabsHandler = {
+  init: function () {
+    this._command = document.getElementById("Browser:BookmarkAllTabs");
+    gBrowser.tabContainer.addEventListener("TabOpen", this, true);
+    gBrowser.tabContainer.addEventListener("TabClose", this, true);
+    this._updateCommandState();
+  },
+
+  _updateCommandState: function BATH__updateCommandState(aTabClose) {
+    var numTabs = gBrowser.browsers.length;
 
-function addGroupmarkAs()
-{
-  BookmarksUtils.addBookmarkForTabBrowser(gBrowser, true);
-}
+    // The TabClose event is fired before the tab is removed from the DOM
+    if (aTabClose)
+      numTabs--;
+
+    if (numTabs > 1)
+      this._command.removeAttribute("disabled");
+    else
+      this._command.setAttribute("disabled", "true");
+  },
 
-function updateGroupmarkCommand()
-{
-  const disabled = (!gBrowser || gBrowser.browsers.length == 1);
-  document.getElementById("Browser:AddGroupmarkAs")
-          .setAttribute("disabled", disabled);
-}
+  doCommand: function BATH_doCommand() {
+    PlacesCommandHook.bookmarkCurrentPages();
+  },
+
+  // nsIDOMEventListener
+  handleEvent: function(aEvent) {
+    this._updateCommandState(aEvent.type == "TabClose");
+  }
+};
 
 function readRDFString(aDS,aRes,aProp)
 {
   var n = aDS.GetTarget(aRes, aProp, true);
   return n ? n.QueryInterface(Components.interfaces.nsIRDFLiteral).Value : "";
 }
 
 function ensureDefaultEnginePrefs(aRDF,aDS) 
@@ -1197,17 +1145,19 @@ function BrowserSearchInternet()
 
 //Note: BrowserNewEditorWindow() was moved to globalOverlay.xul and renamed to NewEditorWindow()
 
 function BrowserOpenWindow()
 {
   //opens a window where users can select a web location to open
   var params = { browser: window, action: null, url: "" };
   openDialog("chrome://communicator/content/openLocation.xul", "_blank", "chrome,modal,titlebar", params);
-  var url = getShortcutOrURI(params.url);
+  var postData = { };
+  var url = getShortcutOrURI(params.url, postData);
+  // XXX: need to actually deal with the postData, see bug 553459
   switch (params.action) {
     case "0": // current window
       loadURI(url, null, nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
       break;
     case "1": // new window
       openDialog(getBrowserURL(), "_blank", "all,dialog=no", url, null, null,
                  nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
       break;
@@ -1480,17 +1430,19 @@ function BrowserLoadURL(aTriggeringEvent
     if (aTriggeringEvent && 'shiftKey' in aTriggeringEvent &&
         'altKey' in aTriggeringEvent) {
       saveModifier = modifierIsShift ? aTriggeringEvent.shiftKey
                      : aTriggeringEvent.altKey;
       shiftPressed = aTriggeringEvent.shiftKey;
     }
 
     var browser = getBrowser();
-    url = getShortcutOrURI(url);
+    var postData = {};
+    url = getShortcutOrURI(url, postData);
+    // XXX: need to actually deal with the postData, see bug 553459
     // Accept both Control and Meta (=Command) as New-Window-Modifiers
     if (aTriggeringEvent &&
         (('ctrlKey' in aTriggeringEvent && aTriggeringEvent.ctrlKey) ||
          ('metaKey' in aTriggeringEvent && aTriggeringEvent.metaKey))) {
       // Check if user requests Tabs instead of windows
       var openTab = false;
       try {
         openTab = Services.prefs.getBoolPref("browser.tabs.opentabfor.urlbar");
@@ -1540,70 +1492,79 @@ function BrowserLoadURL(aTriggeringEvent
       // No modifier was pressed, load the URL normally and
       // focus the content area
       loadURI(url, null, nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP);
       content.focus();
     }
   }
 }
 
-function getShortcutOrURI(url)
+function getShortcutOrURI(aURL, aPostDataRef)
 {
-  // rjc: added support for URL shortcuts (3/30/1999)
-  try {
-    if (!gBookmarksService)
-      gBookmarksService = Components.classes["@mozilla.org/browser/bookmarks-service;1"]
-                                    .getService(Components.interfaces.nsIBookmarksService);
+  var shortcutURL = null;
+  var keyword = aURL;
+  var param = "";
+
+  var offset = aURL.indexOf(" ");
+  if (offset > 0) {
+    keyword = aURL.substr(0, offset);
+    param = aURL.substr(offset + 1);
+  }
+
+  if (!aPostDataRef)
+    aPostDataRef = {};
+
+  // XXX: In the future, ask the search service if it knows that keyword
+
+  [shortcutURL, aPostDataRef.value] =
+    PlacesUtils.getURLAndPostDataForKeyword(keyword);
 
-    var shortcutURL = gBookmarksService.resolveKeyword(url);
-    if (!shortcutURL) {
-      // rjc: add support for string substitution with shortcuts (4/4/2000)
-      //      (see bug # 29871 for details)
-      var aOffset = url.indexOf(" ");
-      if (aOffset > 0) {
-        var cmd = url.substr(0, aOffset);
-        var text = url.substr(aOffset+1);
-        shortcutURL = gBookmarksService.resolveKeyword(cmd);
-        // Bug 123006 : %s replace and URI escape, %S replace with raw value
-        if (shortcutURL && text) {
-          var encodedText = null; 
-          var charset = "";
-          const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/; 
-          var matches = shortcutURL.match(re);
-          if (matches) {
-             shortcutURL = matches[1];
-             charset = matches[2];
-          }
-          else if (/%s/.test(shortcutURL)) {
-            try {
-              charset = BMSVC.getLastCharset(shortcutURL);
-            } catch (ex) {
-            }
-          }
+  if (!shortcutURL)
+    return aURL;
+
+  var postData = "";
+  if (aPostDataRef.value)
+    postData = unescape(aPostDataRef.value);
 
-          if (charset)
-            encodedText = escape(convertFromUnicode(charset, text)); 
-          else  // default case: charset=UTF-8
-            encodedText = encodeURIComponent(text);
-
-          if (encodedText && /%[sS]/.test(shortcutURL))
-            shortcutURL = shortcutURL.replace(/%s/g, encodedText)
-                                     .replace(/%S/g, text);
-          else 
-            shortcutURL = null;
-        }
-      }
+  if (/%s/i.test(shortcutURL) || /%s/i.test(postData)) {
+    var charset = "";
+    const re = /^(.*)\&mozcharset=([a-zA-Z][_\-a-zA-Z0-9]+)\s*$/;
+    var matches = shortcutURL.match(re);
+    if (matches)
+      [, shortcutURL, charset] = matches;
+    else {
+      // Try to get the saved character-set.
+      try {
+        // makeURI throws if URI is invalid.
+        // Will return an empty string if character-set is not found.
+        charset = PlacesUtils.history.getCharsetForURI(makeURI(shortcutURL));
+      } catch (e) {}
     }
 
-    if (shortcutURL)
-      url = shortcutURL;
+    var encodedParam = "";
+    if (charset)
+      encodedParam = escape(convertFromUnicode(charset, param));
+    else // Default charset is UTF-8
+      encodedParam = encodeURIComponent(param);
+
+    shortcutURL = shortcutURL.replace(/%s/g, encodedParam).replace(/%S/g, param);
 
-  } catch (ex) {
+    if (/%s/i.test(postData)) // POST keyword
+      aPostDataRef.value = getPostDataStream(postData, param, encodedParam,
+                                             "application/x-www-form-urlencoded");
   }
-  return url;
+  else if (param) {
+    // This keyword doesn't take a parameter, but one was provided. Just return
+    // the original URL.
+    aPostDataRef.value = null;
+
+    return aURL;
+  }
+
+  return shortcutURL;
 }
 
 function readFromClipboard()
 {
   var url;
 
   try {
     // Get clipboard.
@@ -1739,27 +1700,16 @@ function hiddenWindowStartup()
   var separator = document.getElementById("sep-window-list");
   if (separator)
     separator.setAttribute("hidden", "true");
 
   // init string bundles
   gNavigatorBundle = document.getElementById("bundle_navigator");
   gNavigatorRegionBundle = document.getElementById("bundle_navigator_region");
   gBrandBundle = document.getElementById("bundle_brand");
-
-  // now load bookmarks after a delay
-  setTimeout(hiddenWindowLoadBookmarksCallback, 0);
-}
-
-function hiddenWindowLoadBookmarksCallback()
-{
-  // loads the services
-  initServices();
-  initBMService();
-  BMSVC.readBookmarks();  
 }
 
 var consoleListener = {
   observe: function (aMsgObject)
   {
     const nsIScriptError = Components.interfaces.nsIScriptError;
     var scriptError = aMsgObject.QueryInterface(nsIScriptError);
     var isWarning = scriptError.flags & nsIScriptError.warningFlag != 0;
@@ -2558,50 +2508,33 @@ function getNotificationBox(aWindow)
                 .QueryInterface(Components.interfaces.nsIDocShell)
                 .chromeEventHandler.parentNode.wrappedJSObject;
 }
 
 function BrowserToolboxCustomizeInit()
 {
   SetPageProxyState("invalid", null);
   toolboxCustomizeInit("main-menubar");
+  PlacesToolbarHelper.customizeStart();
 }
 
 function BrowserToolboxCustomizeDone(aToolboxChanged)
 {
   toolboxCustomizeDone("main-menubar", getNavToolbox(), aToolboxChanged);
 
   UpdateNavBar();
 
   // Update the urlbar
   var value = gBrowser.userTypedValue;
   if (value == null)
     URLBarSetURI();
   else
     gURLBar.value = value;
 
-  // fix up the personal toolbar folder
-  var bt = document.getElementById("bookmarks-ptf");
-  if (isElementVisible(bt)) {
-    // XXXRatty: do we still need to reinstate the BookmarksToolbarRDFObserver?
-    let btchevron = document.getElementById("bookmarks-chevron");
-    // no uniqueness is guaranteed, so we have to remove first
-    try {
-      bt.database.RemoveObserver(BookmarksToolbarRDFObserver);
-    } catch (ex) {
-      // ignore
-    }
-    bt.database.AddObserver(BookmarksToolbarRDFObserver);
-    bt.builder.rebuild();
-    btchevron.builder.rebuild();
-
-    // fake a resize; this function takes care of flowing bookmarks
-    // from the bar to the overflow item
-    BookmarksToolbar.resizeFunc(null);
-  }
+  PlacesToolbarHelper.customizeDone();
 }
 
 function BrowserToolboxCustomizeChange(event)
 {
   toolboxCustomizeChange(getNavToolbox(), event);
 }
 
 var LightWeightThemeWebInstaller = {
--- a/suite/browser/navigator.xul
+++ b/suite/browser/navigator.xul
@@ -35,23 +35,24 @@
  and other provisions required by the GPL or the LGPL. If you do not delete
  the provisions above, a recipient may use your version of this file under
  the terms of any one of the MPL, the GPL or the LGPL.
 
  ***** END LICENSE BLOCK ***** -->
 
 
 <?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://communicator/content/places/places.css" type="text/css"?>
 
 <?xul-overlay href="chrome://navigator/content/navigatorOverlay.xul"?>
 <?xul-overlay href="chrome://navigator/content/mailNavigatorOverlay.xul"?>
 <?xul-overlay href="chrome://navigator/content/linkToolbarOverlay.xul"?>
 <?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
 <?xul-overlay href="chrome://communicator/content/sidebar/sidebarOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/bookmarks/bookmarksOverlay.xul"?>
+<?xul-overlay href="chrome://communicator/content/bookmarks/placesOverlay.xul"?>
 
 
 <!DOCTYPE window [
 <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
 %brandDTD;
 <!ENTITY % navigatorDTD SYSTEM "chrome://navigator/locale/navigator.dtd" >
 %navigatorDTD;
 ]>
@@ -80,87 +81,89 @@
   <!-- Content Area -->
   <script type="application/javascript" src="chrome://navigator/content/nsBrowserStatusHandler.js"/>
   <script type="application/javascript" src="chrome://navigator/content/nsBrowserContentListener.js"/>
   <script type="application/javascript" src="chrome://communicator/content/contentAreaClick.js"/>
   <script type="application/javascript" src="chrome://communicator/content/contentAreaDD.js"/>
   <script type="application/javascript" src="chrome://communicator/content/findUtils.js"/>
   <script type="application/javascript" src="chrome://global/content/printUtils.js"/>
 
-  <!-- Shared Bookmarks Utility Library -->
-  <script type="application/javascript" src="chrome://communicator/content/bookmarks/bookmarks.js"/>
-  <script type="application/javascript" src="chrome://communicator/content/bookmarks/bookmarksMenu.js"/>
-
   <!-- Navigator -->
   <script type="application/javascript" src="chrome://navigator/content/fullScreen.js"/>
   <script type="application/javascript" src="chrome://navigator/content/browser.js"/>
   <script type="application/javascript" src="chrome://navigator/content/navigator.js"/>
   <script type="application/javascript" src="chrome://navigator/content/navigatorDD.js"/>
   <script type="application/javascript" src="chrome://navigator/content/sessionHistoryUI.js"/>
 
+  <!-- Places Bookmarks Utilities -->
+  <script type="application/javascript" src="chrome://communicator/content/places/browserPlacesViews.js"/>
+  <script type="application/javascript" src="chrome://communicator/content/bookmarks/browser-places.js"/>
+
   <!-- hook for stringbundle overlays -->
   <stringbundleset id="stringbundleset">
     <stringbundle id="bundle_navigator" src="chrome://navigator/locale/navigator.properties"/>
     <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundle_navigator_region" src="chrome://navigator-region/locale/region.properties"/>
     <stringbundle id="findBundle" src="chrome://global/locale/finddialog.properties"/>
   </stringbundleset>
 
-  <commandset id="commands">    
+  <commandset id="commands">
     <commandset id="findTypeMenuItems"/>
     <commandset id="globalEditMenuItems"/>
     <commandset id="selectEditMenuItems"/>
     <commandset id="undoEditMenuItems"/>
     <commandset id="clipboardEditMenuItems"/>
     <!-- <command id="cmd_pageSetup"/> -->
     <command id="toggleSidebar"/>
   </commandset>
 
   <commandset id="mainCommandSet"/> <!-- Firefox extension compatibility -->
 
+  <commandset id="placesCommands"/>
+
   <!-- broadcasters are appended from the overlay -->
   <broadcasterset id="navBroadcasters"/>
   <broadcasterset id="mainBroadcasterSet"/> <!-- Firefox extension compatibility -->
 
   <!-- keys are appended from the overlay -->
   <keyset id="navKeys">
     <key id="showHideSidebar"/>
   </keyset>
   <keyset id="mainKeyset"/> <!-- Firefox extension compatibility -->
 
-  <popupset id="bookmarksPopupset"/>
-  <template id="bookmarksMenuTemplate"/>
-
   <popupset id="mainPopupSet">
     <menupopup id="backMenu"
            position="after_start"
            onpopupshowing="return BrowserBackMenu(event);"
            oncommand="gotoHistoryIndex(event);"/>
     <menupopup id="forwardMenu"
            position="after_start"
            onpopupshowing="return BrowserForwardMenu(event);"
            oncommand="gotoHistoryIndex(event);"/>
     <tooltip id="aHTMLTooltip"
              onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
     <menupopup id="sidebarPopup"/>
 
-    <tooltip  id="btTooltip"/>
-
     <tooltip id="home-button-tooltip" noautohide="true">
       <vbox id="home-button-tooltip-inner" flex="1"/>
     </tooltip>
 
     <menupopup id="toolbar-context-menu"/>
 
     <menupopup id="feedsPopup" popupanchor="bottomright" popupalign="topright"
                onpopupshowing="window.XULBrowserWindow.populateFeeds(this);"
                oncommand="subscribeToFeed(event.target.statusText, event);"
                onclick="checkForMiddleClick(this, event);"/>
     <panel id="PopupAutoComplete" type="autocomplete" noautofocus="true"/>
 
+    <menupopup id="placesContext"/>
+
+    <!-- Bookmarks and history tooltip -->
+    <tooltip id="bhTooltip"/>
+
     <menupopup id="popupBlockerMenu"
                oncommand="popupBlockerMenuCommand(event.target);"
                onpopupshowing="return popupBlockerMenuShowing(event)"/>
     <!-- Items are generated, see popupBlockerMenuShowing() -->
     <menupopup id="popupNotificationMenu"/>
     <menupopup id="networkProperties"/>
   </popupset>
 
@@ -299,19 +302,18 @@
                 class="urlbar-icons"
                 onclick="handlePageProxyClick(event);">
             <image id="page-proxy-button"
                    ondraggesture="PageProxyDragGesture(event);"
                    tooltiptext="&proxyIcon.tooltip;"/>
             <image id="page-proxy-favicon" validate="never"
                    ondraggesture="PageProxyDragGesture(event);"
                    onload="this.parentNode.selectedIndex = 1;
-                           event.stopPropagation();
-                           HandleBookmarkIcon(this.src, true);"
-                   onerror="gBrowser.addToMissedIconCache(this.src); HandleBookmarkIcon(this.src, false);"
+                           event.stopPropagation();"
+                   onerror="gBrowser.addToMissedIconCache(this.src);"
                    tooltiptext="&proxyIcon.tooltip;"/>
           </deck>
           <hbox id="urlbar-icons"
                 class="urlbar-icons">
             <image id="feedsButton" hidden="true" popup="feedsPopup"/>
             <image id="ev-button" hidden="true"
                    onclick="if (event.button == 0) BrowserPageInfo(null, 'securityTab');"/>
           </hbox>
@@ -362,91 +364,105 @@
         </menupopup>
       </toolbarbutton>
 
       <toolbaritem id="throbber-box" align="center">
         <button id="navigator-throbber" oncommand="goClickThrobber('browser.throbber.url')"
                 tooltiptext="&throbber.tooltip;"/>
       </toolbaritem>
 
-      <!-- "Bookmarks" button on personal toolbar -->                           
-      <toolbarbutton type="menu" id="bookmarks-button" class="bookmark-item"
+      <!-- "Bookmarks" button on personal toolbar -->
+      <toolbarbutton type="menu" id="bookmarks-button"
+                     class="bookmark-item" container="true"
                      label="&bookmarksButton.label;"
-                     datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
-                     ref="NC:BookmarksRoot" container="true" flags="dont-test-empty"
-                     tooltip="btTooltip"
-                     oncommand="BookmarksMenu.loadBookmark(event, this.database);"
-                     onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)" 
-                     template="bookmarksMenuTemplate"
-                     onmouseover="BookmarksToolbar.autoOpenMenu(event.target);"
-                     onpopupshowing="BookmarksToolbar.onMenuOpen(event.target);"
-                     onpopuphidden="BookmarksToolbar.onMenuClose(event.target);"
-                     ondraggesture="if (event.target.id!='bookmarks-button') nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-                     ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-                     ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-                     ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-                     ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
-        <menupopup context="bookmarks-context-menu"
-                   onpopupshowing="updateGroupmarkCommand();">
+                     ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
+                     ondragover="PlacesMenuDNDHandler.onDragOver(event);"
+                     ondragleave="PlacesMenuDNDHandler.onDragLeave(event);"
+                     ondrop="PlacesMenuDNDHandler.onDrop(event);">
+        <menupopup id="BMB_bookmarksPopup"
+                   placespopup="true"
+                   context="placesContext"
+                   openInTabs="children"
+                   oncommand="BookmarksEventHandler.onCommand(event);"
+                   onclick="BookmarksEventHandler.onClick(event);"
+                   onpopupshowing="BookmarksMenuButton.onPopupShowing(event);
+                                   if (!this.parentNode._placesView)
+                                     new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
+                   tooltip="bhTooltip" popupsinherittooltip="true">
           <menuitem command="Browser:AddBookmark"/>
           <menuitem command="Browser:AddBookmarkAs"/>
-          <menuitem command="Browser:AddGroupmarkAs"/>
+          <menuitem command="Browser:BookmarkAllTabs"/>
           <menuitem command="Browser:ManageBookmark"/>
-          <menuseparator id="lastStaticSeparator"/>
+          <menuseparator/>
+          <menu class="menu-iconic" disabled="true"
+                label="&feedsMenu.label;" accesskey="&feedsMenu.accesskey;">
+            <menupopup onpopupshowing="window.XULBrowserWindow.populateFeeds(this);"
+                       oncommand="subscribeToFeed(event.target.statusText, event);"
+                       onclick="checkForMiddleClick(this, event);"/>
+          </menu>
+          <menuseparator/>
+          <menuseparator/>
+          <menu id="BMB_bookmarksToolbarFolderMenu"
+                class="menu-iconic bookmark-item"
+                label="&personalbarCmd.label;"
+                container="true">
+            <menupopup id="BMB_bookmarksToolbarFolderPopup"
+                       placespopup="true"
+                       context="placesContext"
+                       onpopupshowing="if (!this.parentNode._placesView)
+                                         new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
+          </menu>
+          <menu id="BMB_unsortedBookmarksFolderMenu"
+                class="menu-iconic bookmark-item"
+                container="true">
+            <menupopup id="BMB_unsortedBookmarksFolderPopup"
+                       placespopup="true"
+                       context="placesContext"
+                       onpopupshowing="if (!this.parentNode._placesView)
+                                         new PlacesMenu(event, 'place:folder=UNFILED_BOOKMARKS');"/>
+          </menu>
+          <menuseparator/>
         </menupopup>
       </toolbarbutton>
 
-      <toolbaritem id="personal-bookmarks"
-                   flex="1"
-                   style="min-width:0px; width:0px;"
-                   class="chromeclass-directories"
-               onmouseover="BookmarksToolbar.autoOpenMenu(event.target);"
-               onpopupshowing="BookmarksToolbar.onMenuOpen(event.target);"
-               onpopuphidden="BookmarksToolbar.onMenuClose(event.target);"
-               ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
-               ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-               ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-               ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-               ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
-
-        <toolbarbutton class="bookmark-item bookmarks-toolbar-customize" mousethrough="never"
-                       label="&bookmarksToolbarItem.label;"/>
-
-        <!-- Personal toolbar items -->
-        <hbox id="bookmarks-ptf" flex="1" style="min-width: 1px;"
-              class="bookmarks-toolbar-items"
-              context="bookmarks-context-menu"
-              template="bookmarksMenuTemplate"
-              datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
-              ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
-              rdf:type="http://home.netscape.com/NC-rdf#Folder"
-              tooltip="btTooltip"
-              oncommand="BookmarksUtils.loadBookmarkBrowser(event, this.database)"
-              onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
-              onmouseover="BookmarksToolbar.autoOpenMenu(event.target);"
-              onpopupshowing="BookmarksToolbar.onMenuOpen(event.target);"
-              onpopuphidden="BookmarksToolbar.onMenuClose(event.target);">
-        </hbox>
-        <hbox class="bookmarks-toolbar-overflow-items" mousethrough="always">
-          <hbox mousethrough="always" id="overflow-padder" flex="1"/>
-          <toolbarbutton id="bookmarks-chevron" type="menu" class="chevron"
-                         mousethrough="never" collapsed="true"
-                         datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch"
-                         template="bookmarksMenuTemplate"
-                         ref="NC:PersonalToolbarFolder" flags="dont-test-empty"
-                         tooltip="btTooltip"
-                         oncommand="BookmarksUtils.loadBookmarkBrowser(event, this.database)"
-                         onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
-                         onmouseover="BookmarksToolbar.autoOpenMenu(event.target);"
-                         onpopupshowing="BookmarksToolbar.onMenuOpen(event.target);"
-                         onpopuphidden="BookmarksToolbar.onMenuClose(event.target);">
-            <menupopup id="bookmarks-chevron-popup"
-                       context="bookmarks-context-menu"
-                       onpopupshowing="if (event.target == this) BookmarksToolbar.updateOverflowMenu(this);"/>
-          </toolbarbutton>
+      <toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksToolbarItem.label;"
+                   removable="true">
+        <hbox flex="1"
+              id="PlacesToolbar"
+              context="placesContext"
+              onclick="BookmarksEventHandler.onClick(event);"
+              oncommand="BookmarksEventHandler.onCommand(event);"
+              tooltip="bhTooltip"
+              popupsinherittooltip="true">
+          <toolbarbutton class="bookmark-item bookmarks-toolbar-customize"
+                         mousethrough="never"
+                         label="&bookmarksToolbarItem.label;"/>
+          <hbox flex="1">
+            <hbox align="center">
+              <image id="PlacesToolbarDropIndicator"
+                     mousethrough="always"
+                     collapsed="true"/>
+            </hbox>
+            <scrollbox orient="horizontal"
+                       id="PlacesToolbarItems"
+                       flex="1"/>
+            <toolbarbutton type="menu"
+                           id="PlacesChevron"
+                           class="chevron"
+                           mousethrough="never"
+                           collapsed="true"
+                           tooltiptext="&bookmarksToolbarChevron.tooltip;"
+                           onpopupshowing="this.parentNode.parentNode
+                                               ._placesView._onChevronPopupShowing(event);">
+              <menupopup id="PlacesChevronPopup"
+                         placespopup="true"
+                         tooltip="bhTooltip" popupsinherittooltip="true"
+                         context="placesContext"/>
+            </toolbarbutton>
+          </hbox>
         </hbox>
       </toolbaritem>
 
     </toolbarpalette>
 
   </toolbox>
 
   <hbox flex="1">
--- a/suite/browser/navigatorOverlay.xul
+++ b/suite/browser/navigatorOverlay.xul
@@ -109,18 +109,20 @@
     <key id="key_findTypeText"/>
     <key id="key_findTypeLinks"/>
 
     <!-- Go Menu -->
     <key keycode="VK_BACK" command="cmd_handleBackspace"/>
     <key keycode="VK_BACK" command="cmd_handleShiftBackspace" modifiers="shift"/>
 
     <!-- Bookmarks Menu -->
+    <key id="addBookmarkKb" key="&addCurPageAsCmd.commandkey;" command="Browser:AddBookmark" modifiers="accel,alt"/>
     <key id="addBookmarkAsKb" key="&addCurPageAsCmd.commandkey;" command="Browser:AddBookmarkAs" modifiers="accel"/>
     <key id="manBookmarkKb" key="&manBookmarksCmd.commandkey;" command="Browser:ManageBookmark" modifiers="accel"/>
+    <key id="bookmarkAllTabsKb" key="&addCurPageAsCmd.commandkey;" command="Browser:BookmarkAllTabs" modifiers="accel,shift"/>
 
     <!-- Tools Menu -->
     <key id="searchInternetKb" key="&searchInternet.commandKey;" modifiers="accel,shift" command="Browser:SearchInternet"/>
 
     <!-- Misc -->
     <!-- the amazing fishcam, suppress warning by ',' at the beginning of modifiers, see bug 496322 -->
     <key key="f" modifiers=",control,alt" oncommand="loadURI('http://www.fishcam.com/');"/>
     <key id="goUpKb" keycode="VK_UP" command="Browser:Up" modifiers="alt"/>
@@ -179,27 +181,32 @@
     <!-- Search Menu -->
     <command id="Browser:Find" oncommand="BrowserFind();" observes="isImage"/>
     <command id="Browser:FindAgain" oncommand="BrowserFindAgain(false);" observes="isImage"/>
     <command id="Browser:FindPrev"  oncommand="BrowserFindAgain(true);"  observes="isImage"/>
     <command id="cmd_findTypeText" observes="isImage"/>
     <command id="cmd_findTypeLinks" observes="isImage"/>
 
     <!-- Bookmarks Menu -->
-    <command id="Browser:AddBookmark" label="&addCurPageCmd.label;" accesskey="&addCurPageCmd.accesskey;" 
-             oncommand="BookmarksUtils.addBookmarkForBrowser(document.getElementById('content').webNavigation, false);"/>
-    <command id="Browser:AddBookmarkAs" label="&addCurPageAsCmd.label;"
-             accesskey="&addCurPageAsCmd.accesskey;"
-             oncommand="addBookmarkAs();"/>
-    <command id="Browser:AddGroupmarkAs" label="&addCurTabsAsCmd.label;"
-             accesskey="&addCurTabsAsCmd.accesskey;"
-             oncommand="addGroupmarkAs(); event.stopPropagation();"/>
-    <command id="Browser:ManageBookmark" label="&manBookmarksCmd.label;" accesskey="&manBookmarksCmd.accesskey;" 
-             oncommand="toBookmarksManager();"/>
-  
+    <command id="Browser:AddBookmark"
+             label="&addCurPageCmd.label;" accesskey="&addCurPageCmd.accesskey;"
+             oncommand="PlacesCommandHook.bookmarkCurrentPage(false, PlacesUtils.bookmarksMenuFolderId);"/>
+    <command id="Browser:AddBookmarkAs"
+             label="&addCurPageAsCmd.label;" accesskey="&addCurPageAsCmd.accesskey;"
+             oncommand="PlacesCommandHook.bookmarkCurrentPage(true, PlacesUtils.bookmarksMenuFolderId);"/>
+    <!-- The command is disabled for the hidden window. Otherwise its enabled
+         state is handled by gBookmarkAllTabsHandler. -->
+    <command id="Browser:BookmarkAllTabs"
+             label="&addCurTabsAsCmd.label;" accesskey="&addCurTabsAsCmd.accesskey;"
+             oncommand="gBookmarkAllTabsHandler.doCommand();"
+             disabled="true"/>
+    <command id="Browser:ManageBookmark"
+             label="&manBookmarksCmd.label;" accesskey="&manBookmarksCmd.accesskey;"
+             oncommand="PlacesCommandHook.showBookmarksManager('AllBookmarks');"/>
+
     <!-- Go Menu -->  
     <command id="Browser:Home"    oncommand="BrowserHome(event);"/>
     <command id="Browser:Back"    oncommand="BrowserBack();"    observes="canGoBack"/>
     <command id="Browser:Forward" oncommand="BrowserForward();" observes="canGoForward"/>
     <command id="Browser:Up"      oncommand="BrowserUp();"      observes="canGoUp"/>
     <commandset id="viewZoomCommands"/>
     <commandset id="tasksCommands"/>
 
@@ -224,96 +231,16 @@
          
   <!-- bookmarks context menu -->
   <popupset id="bookmarksPopupset">
     <menupopup id="bookmarks-context-menu" 
            onpopupshowing="return BookmarksMenu.createContextMenu(event);"
            onpopuphidden ="BookmarksMenu.destroyContextMenu(event);"/>
   </popupset>
 
-  <!-- bookmarks toolbar tooltip -->
-  <tooltip id="btTooltip" noautohide="true" 
-           onpopupshowing="return BookmarksToolbar.fillInBTTooltip(document.tooltipNode)">
-    <vbox id="btTooltipTextBox" flex="1">  
-      <label id="btTitleText"/>
-      <label id="btUrlText"/>
-    </vbox>
-  </tooltip>
-
-  <!-- bookmarks template -->
-  <template id="bookmarksMenuTemplate" xmlns:nc="http://home.netscape.com/NC-rdf#">
-    <!-- don't generate children of bookmark group menuitems -->
-    <rule parent="menuitem"/>
-    <rule parent="hbox" rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
-      <toolbarseparator uri="rdf:*"/>
-    </rule>
-    <rule parent="hbox" iscontainer="true" nc:FolderGroup="true">
-      <toolbarbutton class="bookmark-item bookmark-group" uri="rdf:*"
-                     group="true"
-                     label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-    </rule>
-    <rule parent="hbox" iscontainer="true">
-      <toolbarbutton type="menu" editable="true" class="bookmark-item"
-                     image="rdf:http://home.netscape.com/NC-rdf#Icon"
-                     validate="never"
-                     uri="rdf:*" label="rdf:http://home.netscape.com/NC-rdf#Name">
-        <menupopup context="bookmarks-context-menu">
-          <menuitem label="&emptyItem.label;" disabled="true" class="isempty"/>
-        </menupopup>
-      </toolbarbutton>
-    </rule>
-    <rule parent="hbox">
-      <toolbarbutton class="bookmark-item" uri="rdf:*" editable="true" 
-                     image="rdf:http://home.netscape.com/NC-rdf#Icon"
-                     validate="never"
-                     status="rdf:http://home.netscape.com/WEB-rdf#status"
-                     statustext="rdf:http://home.netscape.com/NC-rdf#URL"
-                     label="rdf:http://home.netscape.com/NC-rdf#Name"/>
-    </rule>
-    <rule nc:FolderGroup="true" iscontainer="true">
-      <menupopup>
-        <menuitem class="menuitem-iconic bookmark-group" 
-                  label="rdf:http://home.netscape.com/NC-rdf#Name"
-                  group="true"
-                  uri="rdf:*"/>
-      </menupopup>
-    </rule>
-    <rule iscontainer="true">
-      <menupopup>
-        <menu class="menu-iconic bookmark-item" uri="rdf:*" 
-              image="rdf:http://home.netscape.com/NC-rdf#Icon"
-              validate="never"
-              type="rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#type"
-              label="rdf:http://home.netscape.com/NC-rdf#Name">
-          <!-- Since this may be in a mac native menu, we can't hide the "empty"
-               menuitem with css. -->
-          <menupopup context="bookmarks-context-menu"
-                     onpopupshowing="this.firstChild.hidden = this.childNodes.length > 1; event.stopPropagation();">
-            <menuitem label="&emptyItem.label;" disabled="true" class="isempty"/>
-          </menupopup>
-        </menu>
-      </menupopup>
-    </rule>
-    <rule rdf:type="http://home.netscape.com/NC-rdf#BookmarkSeparator">
-      <menupopup> 
-        <menuseparator uri="rdf:*" />
-      </menupopup>
-    </rule>
-    <rule>
-      <menupopup>
-        <menuitem class="menuitem-iconic bookmark-item" uri="rdf:*"
-                  src="rdf:http://home.netscape.com/NC-rdf#Icon"
-                  validate="never"
-                  label="rdf:http://home.netscape.com/NC-rdf#Name" 
-                  status="rdf:http://home.netscape.com/WEB-rdf#status"
-                  statustext="rdf:http://home.netscape.com/NC-rdf#URL"/>
-      </menupopup>
-    </rule>
-  </template>
-
   <!-- Menu -->
   <menubar id="main-menubar" class="chromeclass-menubar">
     <menu id="menu_File">
       <menupopup id="menu_FilePopup" onpopupshowing="updateCloseItems();getContentAreaFrameCount();updateSavePageItems();updateFileUploadItem();">
         <menu id="menu_New">
           <menupopup id="menu_NewPopup">
             <!-- From utilityOverlay.xul -->
             <menuitem id="menu_newNavigator" command="cmd_newNavigator"/>
@@ -474,56 +401,83 @@
                   label="&historyCmd.label;"
                   accesskey="&historyCmd.accesskey;"
                   oncommand="toHistory()"
                   key="key_gotoHistory"/>
         <menuseparator id="startHistorySeparator" hidden="true"/>
         <menuseparator id="endHistorySeparator" hidden="true"/>
       </menupopup>
     </menu>
-    
-    <menu id="BookmarksMenu" label="&bookmarksMenu.label;" accesskey="&bookmarksMenu.accesskey;" 
-          datasources="rdf:bookmarks rdf:files rdf:localsearch rdf:internetsearch" 
-          ref="NC:BookmarksRoot" flags="dont-test-empty" template="bookmarksMenuTemplate"
-          tooltip="btTooltip"
-          oncommand="BookmarksMenu.loadBookmark(event, this.database)"
-          onclick="BookmarksMenu.loadBookmarkMiddleClick(event, this.database)"
-          ondraggesture="nsDragAndDrop.startDrag(event, BookmarksMenuDNDObserver)"
-          ondragdrop="nsDragAndDrop.drop(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-          ondragenter="nsDragAndDrop.dragEnter(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-          ondragexit="nsDragAndDrop.dragExit(event, BookmarksMenuDNDObserver); event.stopPropagation()"
-          ondragover="nsDragAndDrop.dragOver(event, BookmarksMenuDNDObserver); event.stopPropagation()">
-      <menupopup id="menu_BookmarksPopup"
-                 context="bookmarks-context-menu"
-                 onpopupshowing="updateGroupmarkCommand();">
-        <menuitem key="addBookmarkKb"   command="Browser:AddBookmark"/>
-        <menuitem key="addBookmarkAsKb" command="Browser:AddBookmarkAs"/>
-        <menuitem                       command="Browser:AddGroupmarkAs"/>
-        <menuitem key="manBookmarkKb"   command="Browser:ManageBookmark"/>
-        <menuseparator/>
+
+    <menu id="bookmarksMenu"
+          label="&bookmarksMenu.label;"
+          accesskey="&bookmarksMenu.accesskey;"
+          ondragenter="PlacesMenuDNDHandler.onDragEnter(event);"
+          ondragover="PlacesMenuDNDHandler.onDragOver(event);"
+          ondrop="PlacesMenuDNDHandler.onDrop(event);">
+      <menupopup id="bookmarksMenuPopup"
+                 placespopup="true"
+                 context="placesContext"
+                 openInTabs="children"
+                 oncommand="BookmarksEventHandler.onCommand(event);"
+                 onclick="BookmarksEventHandler.onClick(event);"
+                 onpopupshowing="if (!document.getElementById('bookmarksMenu')._placesView)
+                                   new PlacesMenu(event, 'place:folder=BOOKMARKS_MENU');"
+                 tooltip="bhTooltip" popupsinherittooltip="true">
+        <menuitem id="menu_bookmarkThisPage"
+                  command="Browser:AddBookmark"
+                  key="addBookmarkKb"/>
+        <menuitem id="menu_bookmarkThisPageAs"
+                  command="Browser:AddBookmarkAs"
+                  key="addBookmarkAsKb"/>
+        <menuitem id="menu_bookmarkAllTabs"
+                  command="Browser:BookmarkAllTabs"
+                  key="bookmarkAllTabsKb"/>
+        <menuitem id="menu_bookmarkManager"
+                  command="Browser:ManageBookmark"
+                  key="manBookmarkKb"/>
+        <menuseparator id="organizeBookmarksSeparator"/>
         <menu id="feedsMenu" class="menu-iconic" disabled="true"
               label="&feedsMenu.label;" accesskey="&feedsMenu.accesskey;">
           <menupopup onpopupshowing="window.XULBrowserWindow.populateFeeds(this);"
                      oncommand="subscribeToFeed(event.target.statusText, event);"
                      onclick="checkForMiddleClick(this, event);"/>
         </menu>
         <menuseparator/>
+        <menu id="bookmarksToolbarFolderMenu"
+              class="menu-iconic bookmark-item"
+              label="&personalbarCmd.label;"
+              container="true">
+          <menupopup id="bookmarksToolbarFolderPopup"
+                     placespopup="true"
+                     context="placesContext"
+                     onpopupshowing="if (!this.parentNode._placesView)
+                                       new PlacesMenu(event, 'place:folder=TOOLBAR');"/>
+        </menu>
+        <menuseparator/>
       </menupopup>
     </menu>
-      
-  <menu id="tasksMenu">
-    <menupopup id="taskPopup">
-      <menuitem id="menu_searchWeb" label="&searchInternetCmd.label;" key="searchInternetKb" accesskey="&searchInternetCmd.accesskey;" command="Browser:SearchInternet"/>
-      <menuitem id="menu_translate" label="&translateMenu.label;" accesskey="&translateMenu.accesskey;" oncommand="Translate();"/>  
-      <menuseparator id="navBeginGlobalItems"/>
-      <menuitem id="sanitizeItem"
-                accesskey="&clearPrivateDataCmd.accesskey;"
-                label="&clearPrivateDataCmd.label;"
-                key="key_sanitize" command="Tools:Sanitize"/>
-    </menupopup>
-  </menu>
 
-  <menu id="windowMenu"/>
-  
-  <menu id="menu_Help"/>
-</menubar>
+    <menu id="tasksMenu">
+      <menupopup id="taskPopup">
+        <menuitem id="menu_searchWeb"
+                  label="&searchInternetCmd.label;"
+                  accesskey="&searchInternetCmd.accesskey;"
+                  key="searchInternetKb"
+                  command="Browser:SearchInternet"/>
+        <menuitem id="menu_translate"
+                  label="&translateMenu.label;"
+                  accesskey="&translateMenu.accesskey;"
+                  oncommand="Translate();"/>
+        <menuseparator id="navBeginGlobalItems"/>
+        <menuitem id="sanitizeItem"
+                  accesskey="&clearPrivateDataCmd.accesskey;"
+                  label="&clearPrivateDataCmd.label;"
+                  key="key_sanitize" command="Tools:Sanitize"/>
+      </menupopup>
+    </menu>
+
+    <menu id="windowMenu"/>
+
+    <menu id="menu_Help"/>
+  </menubar>
 
 </overlay>
--- a/suite/browser/public/Makefile.in
+++ b/suite/browser/public/Makefile.in
@@ -41,17 +41,16 @@ srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= suitebrowser
 XPIDL_MODULE	= suitebrowser
 
 XPIDLSRCS = \
-	nsIBookmarksService.idl \
 	nsISearchService.idl \
 	$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 XPIDLSRCS += nsIUrlWidget.idl
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/suite/browser/src/Makefile.in
+++ b/suite/browser/src/Makefile.in
@@ -43,17 +43,16 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 MODULE		= suitebrowser
 LIBRARY_NAME	= suitebrowser_s
 META_COMPONENT  = suite
 
 
 CPPSRCS = \
-	nsBookmarksService.cpp \
 	nsInternetSearchService.cpp \
 	nsLocalSearchService.cpp \
 	$(NULL)
 
 ifeq ($(OS_ARCH),WINNT)
 CPPSRCS += nsUrlWidget.cpp
 endif
 
--- a/suite/build/nsSuiteModule.cpp
+++ b/suite/build/nsSuiteModule.cpp
@@ -40,17 +40,16 @@
 #include "nsSuiteDirectoryProvider.h"
 #include "nsProfileMigrator.h"
 #include "nsSeamonkeyProfileMigrator.h"
 #include "nsThunderbirdProfileMigrator.h"
 #include "nsInternetSearchService.h"
 #include "nsLocalSearchService.h"
 #include "nsNetCID.h"
 #include "nsRDFCID.h"
-#include "nsBookmarksService.h"
 #include "nsFeedSniffer.h"
 
 #if defined(XP_WIN)
 #include "nsUrlWidget.h"
 #if !defined(BUILD_STATIC_SHELL)
 #include "nsWindowsShellService.h"
 #endif
 #elif defined(XP_MACOSX) && !defined(BUILD_STATIC_SHELL)
@@ -72,17 +71,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShel
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
 #endif
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSuiteDirectoryProvider)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSeamonkeyProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsThunderbirdProfileMigrator)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(LocalSearchDataSource, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(InternetSearchDataSource, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBookmarksService, Init)
 NS_GENERIC_FACTORY_CONSTRUCTOR(nsFeedSniffer)
 
 #if defined(XP_WIN)
 NS_DEFINE_NAMED_CID(NS_IURLWIDGET_CID);
 #endif
 #if defined(NS_SUITEWININTEGRATION_CID)
 NS_DEFINE_NAMED_CID(NS_SUITEWININTEGRATION_CID);
 #elif defined(NS_SUITEMACINTEGRATION_CID)
@@ -91,17 +89,16 @@ NS_DEFINE_NAMED_CID(NS_SUITEMACINTEGRATI
 NS_DEFINE_NAMED_CID(NS_SUITEGNOMEINTEGRATION_CID);
 #endif
 NS_DEFINE_NAMED_CID(NS_SUITEDIRECTORYPROVIDER_CID);
 NS_DEFINE_NAMED_CID(NS_SUITEPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_SEAMONKEYPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_THUNDERBIRDPROFILEMIGRATOR_CID);
 NS_DEFINE_NAMED_CID(NS_RDFFINDDATASOURCE_CID);
 NS_DEFINE_NAMED_CID(NS_RDFSEARCHDATASOURCE_CID);
-NS_DEFINE_NAMED_CID(NS_BOOKMARKS_SERVICE_CID);
 NS_DEFINE_NAMED_CID(NS_FEEDSNIFFER_CID);
 
 /////////////////////////////////////////////////////////////////////////////
 
 static const mozilla::Module::CIDEntry kSuiteCIDs[] = {
 #if defined(XP_WIN)
   { &kNS_IURLWIDGET_CID, false, NULL, nsUrlWidgetConstructor },
 #endif
@@ -113,17 +110,16 @@ static const mozilla::Module::CIDEntry k
   { &kNS_SUITEGNOMEINTEGRATION_CID, false, NULL, nsGNOMEShellServiceConstructor },
 #endif
   { &kNS_SUITEDIRECTORYPROVIDER_CID, false, NULL, nsSuiteDirectoryProviderConstructor },
   { &kNS_SUITEPROFILEMIGRATOR_CID, false, NULL, nsProfileMigratorConstructor },
   { &kNS_SEAMONKEYPROFILEMIGRATOR_CID, false, NULL, nsSeamonkeyProfileMigratorConstructor },
   { &kNS_THUNDERBIRDPROFILEMIGRATOR_CID, false, NULL, nsThunderbirdProfileMigratorConstructor },
   { &kNS_RDFFINDDATASOURCE_CID, false, NULL, LocalSearchDataSourceConstructor },
   { &kNS_RDFSEARCHDATASOURCE_CID, false, NULL, InternetSearchDataSourceConstructor },
-  { &kNS_BOOKMARKS_SERVICE_CID, false, NULL, nsBookmarksServiceConstructor },
   { &kNS_FEEDSNIFFER_CID, false, NULL, nsFeedSnifferConstructor },
   { NULL }
 };
 
 static const mozilla::Module::ContractIDEntry kSuiteContracts[] = {
 #if defined(XP_WIN)
   { NS_IURLWIDGET_CONTRACTID, &kNS_IURLWIDGET_CID },
 #endif
@@ -138,19 +134,16 @@ static const mozilla::Module::ContractID
   { NS_SUITEDIRECTORYPROVIDER_CONTRACTID, &kNS_SUITEDIRECTORYPROVIDER_CID },
   { NS_PROFILEMIGRATOR_CONTRACTID, &kNS_SUITEPROFILEMIGRATOR_CID },
   { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "seamonkey", &kNS_SEAMONKEYPROFILEMIGRATOR_CID },
   { NS_SUITEPROFILEMIGRATOR_CONTRACTID_PREFIX "thunderbird", &kNS_THUNDERBIRDPROFILEMIGRATOR_CID },
   { NS_LOCALSEARCH_SERVICE_CONTRACTID, &kNS_RDFFINDDATASOURCE_CID },
   { NS_LOCALSEARCH_DATASOURCE_CONTRACTID, &kNS_RDFFINDDATASOURCE_CID },
   { NS_INTERNETSEARCH_SERVICE_CONTRACTID, &kNS_RDFSEARCHDATASOURCE_CID },
   { NS_INTERNETSEARCH_DATASOURCE_CONTRACTID, &kNS_RDFSEARCHDATASOURCE_CID },
-  { NS_BOOKMARKS_SERVICE_CONTRACTID, &kNS_BOOKMARKS_SERVICE_CID },
-  { "@mozilla.org/embeddor.implemented/bookmark-charset-resolver;1", &kNS_BOOKMARKS_SERVICE_CID },
-  { NS_BOOKMARKS_DATASOURCE_CONTRACTID, &kNS_BOOKMARKS_SERVICE_CID },
   { NS_FEEDSNIFFER_CONTRACTID, &kNS_FEEDSNIFFER_CID },
   { NULL }
 };
 
 static const mozilla::Module::CategoryEntry kSuiteCategories[] = {
   { XPCOM_DIRECTORY_PROVIDER_CATEGORY, "suite-directory-provider", NS_SUITEDIRECTORYPROVIDER_CONTRACTID },
   { NS_CONTENT_SNIFFER_CATEGORY, "Feed Sniffer", NS_FEEDSNIFFER_CONTRACTID },
   { NULL }
--- a/suite/common/bookmarks/bm-panel.js
+++ b/suite/common/bookmarks/bm-panel.js
@@ -1,68 +1,52 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  * for the specific language governing rights and limitations under the
  * License.
  *
  * The Original Code is mozilla.org code.
  *
- * The Initial Developer of the Original Code is
- * Netscape Communications Corporation.
- * Portions created by the Initial Developer are Copyright (C) 1998
+ * The Initial Developer of the Original Code is Mozilla Foundation.
+ * Portions created by the Initial Developer are Copyright (C) 2007
  * the Initial Developer. All Rights Reserved.
  *
  * Contributor(s):
- *   Ben Goodger <ben@netscape.com> (Original Author)
+ *   Dan Mills <thunder@mozilla.com> (Original Author)
  *
  * Alternatively, the contents of this file may be used under the terms of
- * either of the GNU General Public License Version 2 or later (the "GPL"),
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-
-////////////////////////////////////////////////////////////////////////////////
-// Get the two bookmarks utility libraries running, attach controllers, focus
-// tree widget, etc. 
-function Startup() 
-{
-  // correct keybinding command attributes which don't do our business yet
-  var key = document.getElementById("key_delete");
-  if (key.getAttribute("command"))
-    key.setAttribute("command", "cmd_bm_delete");
-  key = document.getElementById("key_delete2");
-  if (key.getAttribute("command"))
-    key.setAttribute("command", "cmd_bm_delete");
-
-  var bookmarksView = document.getElementById("bookmarks-view");  
-  bookmarksView.tree.view.selection.select(0);
+function init() {
+  document.getElementById("bookmarks-view").place =
+    "place:queryType=1&folder=" + window.top.PlacesUIUtils.allBookmarksFolderId;
 }
 
-function addBookmark() {
-  var contentArea = top.document.getElementById('content');                   
-  if (contentArea) {
-    const browsers = contentArea.browsers;
-    if (browsers.length > 1)
-      BookmarksUtils.addBookmarkForTabBrowser(contentArea);
-    else
-      BookmarksUtils.addBookmarkForBrowser(contentArea.webNavigation, true);    
-  }
+function searchBookmarks(aSearchString) {
+  var tree = document.getElementById('bookmarks-view');
+  if (!aSearchString)
+    tree.place = tree.place;
   else
-    BookmarksUtils.addBookmark(null, null, undefined, true);
+    tree.applyFilter(aSearchString,
+                     [PlacesUtils.bookmarksMenuFolderId,
+                      PlacesUtils.unfiledBookmarksFolderId,
+                      PlacesUtils.toolbarFolderId]);
 }
+
--- a/suite/common/bookmarks/bm-panel.xul
+++ b/suite/common/bookmarks/bm-panel.xul
@@ -1,111 +1,94 @@
-<?xml version="1.0"?> <!-- -*- Mode: SGML; indent-tabs-mode: nil; -*- --> 
-<!--
-
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
+<?xml version="1.0"?>
 
- The Initial Developer of the Original Code is
- Netscape Communications Corporation.
- Portions created by the Initial Developer are Copyright (C) 1998
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
-   Ben Goodger <ben@netscape.com> (Original Author, v2.0)
-   Pierre Chanial <chanial@noos.fr>
-
- Alternatively, the contents of this file may be used under the terms of
- either of the GNU General Public License Version 2 or later (the "GPL"),
- or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
+<!-- ***** BEGIN LICENSE BLOCK *****
+   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
+   -
+   - The contents of this file are subject to the Mozilla Public License Version
+   - 1.1 (the "License"); you may not use this file except in compliance with
+   - the License. You may obtain a copy of the License at
+   - http://www.mozilla.org/MPL/
+   -
+   - Software distributed under the License is distributed on an "AS IS" basis,
+   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+   - for the specific language governing rights and limitations under the
+   - License.
+   -
+   - The Original Code is mozilla.org code.
+   -
+   - The Initial Developer of the Original Code is
+   - Netscape Communications Corporation.
+   - Portions created by the Initial Developer are Copyright (C) 1998
+   - the Initial Developer. All Rights Reserved.
+   -
+   - Contributor(s):
+   -   Ben Goodger <ben@netscape.com> (Original Author, v2.0)
+   -   Pierre Chanial <p_ch@verizon.net>
+   -   Dan Mills <thunder@mozilla.com>
+   -
+   - Alternatively, the contents of this file may be used under the terms of
+   - either the GNU General Public License Version 2 or later (the "GPL"), or
+   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+   - in which case the provisions of the GPL or the LGPL are applicable instead
+   - of those above. If you wish to allow use of your version of this file only
+   - under the terms of either the GPL or the LGPL, and not to allow others to
+   - use your version of this file under the terms of the MPL, indicate your
+   - decision by deleting the provisions above and replace them with the notice
+   - and other provisions required by the GPL or the LGPL. If you do not delete
+   - the provisions above, a recipient may use your version of this file under
+   - the terms of any one of the MPL, the GPL or the LGPL.
+   -
+   - ***** END LICENSE BLOCK ***** -->
 
 <?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
+<?xml-stylesheet href="chrome://communicator/content/places/places.css"?>
 <?xml-stylesheet href="chrome://communicator/skin/sidebar/sidebarListView.css" type="text/css"?>
-<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarksWindow.css" type="text/css"?>
-<?xml-stylesheet href="chrome://communicator/content/bookmarks/bookmarks.css" type="text/css"?>
+<?xml-stylesheet href="chrome://communicator/skin/bookmarks/bookmarks.css"?>
 
+<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
+<?xul-overlay href="chrome://communicator/content/bookmarks/placesOverlay.xul"?>
 <?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
-<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/bookmarks/bookmarksOverlay.xul"?>
-<?xul-overlay href="chrome://communicator/content/tasksOverlay.xul"?>
 
-<!DOCTYPE page SYSTEM "chrome://communicator/locale/bookmarks/bookmarks.dtd">
+<!DOCTYPE page SYSTEM "chrome://communicator/locale/bookmarks/places.dtd">
 
 <page id="bookmarksPanel"
-        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="Startup();" elementtofocus="search-box">
-
-  <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
+      xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
+      onload="init();"
+      onunload="SidebarUtils.clearURLFromStatusBar();"
+      elementtofocus="search-box">
 
-  <!-- Bookmarks Shell -->
-  <script type="application/javascript" src="chrome://communicator/content/bookmarks/bookmarks.js"/>
-  <script type="application/javascript" src="chrome://communicator/content/bookmarks/bm-panel.js"/>
-
-  <!-- Bookmarks Panel Drag & Drop -->
-  <script type="application/javascript" src="chrome://global/content/nsDragAndDrop.js"/>
+  <script type="application/javascript"
+          src="chrome://communicator/content/places/sidebarUtils.js"/>
+  <script type="application/javascript"
+          src="chrome://communicator/content/bookmarks/bm-panel.js"/>
 
-  <!-- context menu, tooltips, etc -->
-  <popupset id="bookmarksPopupset"/>
-  
-  <!-- bookmarks string bundle -->
-  <stringbundleset id="stringbundleset"/>
-  
-  <!-- bookmarks & edit commands -->
-  <commands id="commands">
-    <commandset id="CommandUpdate_Bookmarks"
-                commandupdater="true"
-                events="click,focus"
-                oncommandupdate="document.getElementById('bookmarks-view').onCommandUpdate();">
-    </commandset>                
-    <commandset id="bookmarksItems"/>
-    <command id="cmd_undo"/>
-    <command id="cmd_redo"/>
-  </commands>
+  <commandset id="placesCommands"/>
+  <commandset id="editMenuCommands"/>
+  <popup id="placesContext"/>
+
+  <!-- Bookmarks and history tooltip -->
+  <tooltip id="bhTooltip"/>
 
-  <keyset id="bookmarks-tasksKeys"/>
-  
-  <hbox id="panel-bar" class="toolbar">
-    <toolbarbutton id="btnAddBookmark" label="&command.addBookmark.label;"
-            oncommand="addBookmark();"/>
-    <toolbarbutton id="btnManageBookmarks" label="&command.manageBookmarks.label;"
-            oncommand="toBookmarksManager();"/>
-    <spacer flex="1"/>
-    <toolbarseparator/>
-    <toolbarbutton id="btnFindBookmarks" label="&command.findBookmarks.label;"
-            oncommand="BookmarksCommand.findBookmark();"/>
+  <hbox id="sidebar-search-container" align="center">
+    <label id="sidebar-search-label"
+           value="&search.label;" accesskey="&search.accesskey;" control="search-box"/>
+    <textbox id="search-box" flex="1" type="search" class="compact"
+             aria-controls="bookmarks-view"
+             oncommand="searchBookmarks(this.value);"/>
   </hbox>
 
-  <hbox id="search-bar" class="toolbar" align="center">
-    <textbox id="search-box" flex="1" type="search" clickSelectsAll="true"
-             placeholder="&search.placeholder;"
-             oncommand="document.getElementById('bookmarks-view').searchBookmarks(this.value)"/>
-  </hbox>
-  
-  <bookmarks-tree id="bookmarks-view" type="single-column" flex="1"
-                  onfocus="this.tree.focus();"
-                  onkeypress="if (event.keyCode == 13) this.openItemKey(event);"
-                  ondraggesture="if (event.originalTarget.localName == 'treechildren') nsDragAndDrop.startDrag(event, this.DNDObserver);"
-                  onclick="this.openItemClick(event, 1);"/>
-
+  <tree id="bookmarks-view" class="sidebar-placesTree" type="places"
+        flex="1"
+        hidecolumnpicker="true"
+        context="placesContext"
+        onkeypress="SidebarUtils.handleTreeKeyPress(event);"
+        onclick="SidebarUtils.handleTreeClick(this, event, true);"
+        onmousemove="SidebarUtils.handleTreeMouseMove(event);"
+        onmouseout="SidebarUtils.clearURLFromStatusBar();">
+    <treecols>
+      <treecol id="title" flex="1" primary="true" hideheader="true"/>
+    </treecols>
+    <treechildren id="bookmarks-view-children" view="bookmarks-view"
+                  class="sidebar-placesTreechildren" flex="1" tooltip="bhTooltip"/>
+  </tree>
 </page>
new file mode 100644
--- /dev/null
+++ b/suite/common/bookmarks/browser-places.js
@@ -0,0 +1,484 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is the Places Browser Integration
+ *
+ * The Initial Developer of the Original Code is Google Inc.
+ * Portions created by the Initial Developer are Copyright (C) 2006
+ * the Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s):
+ *   Ben Goodger <beng@google.com>
+ *   Annie Sullivan <annie.sullivan@gmail.com>
+ *   Joe Hughes <joe@retrovirus.com>
+ *   Asaf Romano <mano@mozilla.com>
+ *   Ehsan Akhgari <ehsan.akhgari@gmail.com>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 2 or later (the "GPL"), or
+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ * in which case the provisions of the GPL or the LGPL are applicable instead
+ * of those above. If you wish to allow use of your version of this file only
+ * under the terms of either the GPL or the LGPL, and not to allow others to
+ * use your version of this file under the terms of the MPL, indicate your
+ * decision by deleting the provisions above and replace them with the notice
+ * and other provisions required by the GPL or the LGPL. If you do not delete
+ * the provisions above, a recipient may use your version of this file under
+ * the terms of any one of the MPL, the GPL or the LGPL.
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+var PlacesCommandHook = {
+  /**
+   * Adds a bookmark to the page loaded in the given browser.
+   *
+   * @param aBrowser
+   *        a <browser> element.
+   * @param [optional] aParent
+   *        The folder in which to create a new bookmark if the page loaded in
+   *        aBrowser isn't bookmarked yet, defaults to the unfiled root.
+   * @param [optional] aShowEditUI
+   *        whether or not to show the edit-bookmark UI for the bookmark item
+   */
+  bookmarkPage: function PCH_bookmarkPage(aBrowser, aParent, aShowEditUI) {
+    var uri = aBrowser.currentURI;
+    var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
+    if (itemId == -1) {
+      // Copied over from addBookmarkForBrowser:
+      // Bug 52536: We obtain the URL and title from the nsIWebNavigation
+      // associated with a <browser/> rather than from a DOMWindow.
+      // This is because when a full page plugin is loaded, there is
+      // no DOMWindow (?) but information about the loaded document
+      // may still be obtained from the webNavigation.
+      var webNav = aBrowser.webNavigation;
+      var url = webNav.currentURI;
+      var title;
+      var description;
+      var charset;
+      try {
+        title = webNav.document.title || url.spec;
+        description = PlacesUIUtils.getDescriptionFromDocument(webNav.document);
+        charset = webNav.document.characterSet;
+      }
+      catch (e) { }
+
+      if (aShowEditUI) {
+        // If we bookmark the page here (i.e. page was not "starred" already)
+        // but open right into the "edit" state, start batching here, so
+        // "Cancel" in that state removes the bookmark.
+        StarUI.beginBatch();
+      }
+
+      var parent = aParent != undefined ?
+                   aParent : PlacesUtils.unfiledBookmarksFolderId;
+      var descAnno = { name: PlacesUIUtils.DESCRIPTION_ANNO, value: description };
+      var txn = PlacesUIUtils.ptm.createItem(uri, parent, -1,
+                                             title, null, [descAnno]);
+      PlacesUIUtils.ptm.doTransaction(txn);
+      // Set the character-set
+      if (charset)
+        PlacesUtils.history.setCharsetForURI(uri, charset);
+      itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
+    }
+
+    // dock the panel to the star icon when possible, otherwise dock
+    // it to the content area
+    if (aBrowser.contentWindow == window.content) {
+      let ubIcons = aBrowser.ownerDocument.getElementById("urlbar-icons");
+      if (ubIcons) {
+        // Make sure the bookmark properties dialog hangs toward the middle of
+        // the location bar in RTL builds
+        let position = (getComputedStyle(gNavToolbox, "").direction == "rtl") ? 'after_start' : 'after_end';
+        if (aShowEditUI)
+          StarUI.showEditBookmarkPopup(itemId, ubIcons, position);
+        return;
+      }
+    }
+
+    StarUI.showEditBookmarkPopup(itemId, aBrowser, "overlap");
+  },
+
+  /**
+   * Adds a bookmark to the page loaded in the current tab.
+   */
+  bookmarkCurrentPage: function PCH_bookmarkCurrentPage(aShowEditUI, aParent) {
+    this.bookmarkPage(gBrowser.selectedBrowser, aParent, aShowEditUI);
+  },
+
+  /**
+   * Adds a bookmark to the page targeted by a link.
+   * @param aParent
+   *        The folder in which to create a new bookmark if aURL isn't
+   *        bookmarked.
+   * @param aURL (string)
+   *        the address of the link target
+   * @param aTitle
+   *        The link text
+   */
+  bookmarkLink: function PCH_bookmarkLink(aParent, aURL, aTitle) {
+    var linkURI = makeURI(aURL);
+    var itemId = PlacesUtils.getMostRecentBookmarkForURI(linkURI);
+    if (itemId == -1)
+      PlacesUIUtils.showMinimalAddBookmarkUI(linkURI, aTitle);
+    else {
+      PlacesUIUtils.showItemProperties(itemId,
+                                       PlacesUtils.bookmarks.TYPE_BOOKMARK);
+    }
+  },
+
+  /**
+   * This function returns a list of nsIURI objects characterizing the
+   * tabs currently open in the browser.  The URIs will appear in the
+   * list in the order in which their corresponding tabs appeared.  However,
+   * only the first instance of each URI will be returned.
+   *
+   * @returns a list of nsIURI objects representing unique locations open
+   */
+  _getUniqueTabInfo: function BATC__getUniqueTabInfo() {
+    var tabList = [];
+    var seenURIs = {};
+
+    var browsers = gBrowser.browsers;
+    for (var i = 0; i < browsers.length; ++i) {
+      let uri = browsers[i].currentURI;
+
+      // skip redundant entries
+      if (uri.spec in seenURIs)
+        continue;
+
+      // add to the set of seen URIs
+      seenURIs[uri.spec] = null;
+      tabList.push(uri);
+    }
+    return tabList;
+  },
+
+  /**
+   * Adds a folder with bookmarks to all of the currently open tabs in this
+   * window.
+   */
+  bookmarkCurrentPages: function PCH_bookmarkCurrentPages() {
+    var tabURIs = this._getUniqueTabInfo();
+    PlacesUIUtils.showMinimalAddMultiBookmarkUI(tabURIs);
+  },
+
+
+  /**
+   * Adds a Live Bookmark to a feed associated with the current page.
+   * @param     url
+   *            The nsIURI of the page the feed was attached to
+   * @title     title
+   *            The title of the feed. Optional.
+   * @subtitle  subtitle
+   *            A short description of the feed. Optional.
+   */
+  addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
+    var feedURI = makeURI(url);
+
+    var doc = gBrowser.contentDocument;
+    var title = (arguments.length > 1) ? feedTitle : doc.title;
+
+    var description;
+    if (arguments.length > 2)
+      description = feedSubtitle;
+    else
+      description = PlacesUIUtils.getDescriptionFromDocument(doc);
+
+    var toolbarIP =
+      new InsertionPoint(PlacesUtils.bookmarks.toolbarFolder, -1);
+    PlacesUIUtils.showMinimalAddLivemarkUI(feedURI, gBrowser.currentURI,
+                                           title, description, toolbarIP, true);
+  },
+
+  /**
+   * Opens the bookmarks manager.
+   * @param   aLeftPaneRoot
+   *          The query to select in the organizer window - options
+   *          are: AllBookmarks, BookmarksMenu, BookmarksToolbar,
+   *          UnfiledBookmarks and Tags.
+   */
+  showBookmarksManager: function PCH_showBookmarksManager(aLeftPaneRoot) {
+    var manager = Services.wm.getMostRecentWindow("bookmarks:manager");
+    if (!manager) {
+      // No currently open places window, so open one with the specified mode.
+      openDialog("chrome://communicator/content/bookmarks/bookmarksManager.xul",
+                 "", "chrome,toolbar=yes,dialog=no,resizable", aLeftPaneRoot);
+    }
+    else {
+      manager.PlacesOrganizer.selectLeftPaneQuery(aLeftPaneRoot);
+      manager.focus();
+    }
+  }
+};
+
+/**
+ * Functions for handling events in the Bookmarks Toolbar and menu.
+ */
+var BookmarksEventHandler = {
+  /**
+   * Handler for click event for an item in the bookmarks toolbar or menu.
+   * Menus and submenus from the folder buttons bubble up to this handler.
+   * Left-click is handled in the onCommand function.
+   * When items are middle-clicked (or clicked with modifier), open in tabs.
+   * If the click came through a menu, close the menu.
+   * @param aEvent
+   *        DOMEvent for the click
+   */
+  onClick: function BEH_onClick(aEvent) {
+    // Only handle middle-click or left-click with modifiers.
+    if (aEvent.button == 2 || (aEvent.button == 0 && !aEvent.shiftKey &&
+                               !aEvent.ctrlKey && !aEvent.metaKey))
+      return;
+
+    var target = aEvent.originalTarget;
+    // If this event bubbled up from a menu or menuitem, close the menus.
+    // Do this before opening tabs, to avoid hiding the open tabs confirm-dialog.
+    if (target.localName == "menu" || target.localName == "menuitem") {
+      for (node = target.parentNode; node; node = node.parentNode) {
+        if (node.localName == "menupopup")
+          node.hidePopup();
+        else if (node.localName != "menu")
+          break;
+      }
+    }
+
+    if (target._placesNode && PlacesUtils.nodeIsContainer(target._placesNode)) {
+      // Don't open the root folder in tabs when the empty area on the toolbar
+      // is middle-clicked or when a non-bookmark item except for Open in Tabs)
+      // in a bookmarks menupopup is middle-clicked.
+      if (target.localName == "menu" || target.localName == "toolbarbutton")
+        PlacesUIUtils.openContainerNodeInTabs(target._placesNode, aEvent);
+    }
+    else if (aEvent.button == 1) {
+      // left-clicks with modifier are already served by onCommand
+      this.onCommand(aEvent);
+    }
+  },
+
+  /**
+   * Handler for command event for an item in the bookmarks toolbar.
+   * Menus and submenus from the folder buttons bubble up to this handler.
+   * Opens the item.
+   * @param aEvent
+   *        DOMEvent for the command
+   */
+  onCommand: function BEH_onCommand(aEvent) {
+    var target = aEvent.originalTarget;
+    if (target._placesNode)
+      PlacesUIUtils.openNodeWithEvent(target._placesNode, aEvent);
+  },
+
+  fillInBHTooltip: function BEH_fillInBHTooltip(aDocument, aEvent) {
+    var node;
+    var cropped = false;
+    var targetURI;
+
+    if (aDocument.tooltipNode.localName == "treechildren") {
+      var tree = aDocument.tooltipNode.parentNode;
+      var row = {}, column = {};
+      var tbo = tree.treeBoxObject;
+      tbo.getCellAt(aEvent.clientX, aEvent.clientY, row, column, {});
+      if (row.value == -1)
+        return false;
+      node = tree.view.nodeForTreeIndex(row.value);
+      cropped = tbo.isCellCropped(row.value, column.value);
+    }
+    else {
+      // Check whether the tooltipNode is a Places node.
+      // In such a case use it, otherwise check for targetURI attribute.
+      var tooltipNode = aDocument.tooltipNode;
+      if (tooltipNode._placesNode)
+        node = tooltipNode._placesNode;
+      else {
+        // This is a static non-Places node.
+        targetURI = tooltipNode.getAttribute("targetURI");
+      }
+    }
+
+    if (!node && !targetURI)
+      return false;
+
+    // Show node.label as tooltip's title for non-Places nodes.
+    var title = node ? node.title : tooltipNode.label;
+
+    // Show URL only for Places URI-nodes or nodes with a targetURI attribute.
+    var url;
+    if (targetURI || PlacesUtils.nodeIsURI(node))
+      url = targetURI || node.uri;
+
+    // Show tooltip for containers only if their title is cropped.
+    if (!cropped && !url)
+      return false;
+
+    var tooltipTitle = aDocument.getElementById("bhtTitleText");
+    tooltipTitle.hidden = (!title || (title == url));
+    if (!tooltipTitle.hidden)
+      tooltipTitle.textContent = title;
+
+    var tooltipUrl = aDocument.getElementById("bhtUrlText");
+    tooltipUrl.hidden = !url;
+    if (!tooltipUrl.hidden)
+      tooltipUrl.value = url;
+
+    // Show tooltip.
+    return true;
+  }
+};
+
+
+// Handles special drag and drop functionality for Places menus that are not
+// part of a Places view (e.g. the bookmarks menu in the menubar).
+var PlacesMenuDNDHandler = {
+  _springLoadDelay: 350, // milliseconds
+  _loadTimer: null,
+
+  /**
+   * Called when the user enters the <menu> element during a drag.
+   * @param   event
+   *          The DragEnter event that spawned the opening.
+   */
+  onDragEnter: function PMDH_onDragEnter(event) {
+    // Opening menus in a Places popup is handled by the view itself.
+    if (!this._isStaticContainer(event.target))
+      return;
+
+    this._loadTimer = Components.classes["@mozilla.org/timer;1"]
+                                .createInstance(Components.interfaces.nsITimer);
+    this._loadTimer.initWithCallback(function() {
+      PlacesMenuDNDHandler._loadTimer = null;
+      event.target.lastChild.setAttribute("autoopened", "true");
+      event.target.lastChild.showPopup(event.target.lastChild);
+    }, this._springLoadDelay, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
+    event.preventDefault();
+    event.stopPropagation();
+  },
+
+  /**
+   * Handles dragleave on the <menu> element.
+   * @returns true if the element is a container element (menu or
+   *          menu-toolbarbutton), false otherwise.
+   */
+  onDragLeave: function PMDH_onDragLeave(event) {
+    // Closing menus in a Places popup is handled by the view itself.
+    if (!this._isStaticContainer(event.target))
+      return;
+
+    if (this._loadTimer) {
+      this._loadTimer.cancel();
+      this._loadTimer = null;
+    }
+    let closeTimer = Components.classes["@mozilla.org/timer;1"]
+                               .createInstance(Components.interfaces.nsITimer);
+    closeTimer.initWithCallback(function() {
+      let node = PlacesControllerDragHelper.currentDropTarget;
+      let inHierarchy = false;
+      while (node && !inHierarchy) {
+        inHierarchy = node == event.target;
+        node = node.parentNode;
+      }
+      if (!inHierarchy && event.target.lastChild &&
+          event.target.lastChild.hasAttribute("autoopened")) {
+        event.target.lastChild.removeAttribute("autoopened");
+        event.target.lastChild.hidePopup();
+      }
+    }, this._springLoadDelay, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
+  },
+
+  /**
+   * Determines if a XUL element represents a static container.
+   * @returns true if the element is a container element (menu or
+   *          menu-toolbarbutton), false otherwise.
+   */
+  _isStaticContainer: function PMDH__isContainer(node) {
+    let isMenu = node.localName == "menu" ||
+                 (node.localName == "toolbarbutton" &&
+                  node.getAttribute("type") == "menu");
+    let isStatic = !("_placesNode" in node) && node.lastChild &&
+                   node.lastChild.hasAttribute("placespopup") &&
+                   !node.parentNode.hasAttribute("placespopup");
+    return isMenu && isStatic;
+  },
+
+  /**
+   * Called when the user drags over the <menu> element.
+   * @param   event
+   *          The DragOver event.
+   */
+  onDragOver: function PMDH_onDragOver(event) {
+    let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
+                                PlacesUtils.bookmarks.DEFAULT_INDEX,
+                                Components.interfaces.nsITreeView.DROP_ON);
+    if (ip && PlacesControllerDragHelper.canDrop(ip, event.dataTransfer))
+      event.preventDefault();
+
+    event.stopPropagation();
+  },
+
+  /**
+   * Called when the user drops on the <menu> element.
+   * @param   event
+   *          The Drop event.
+   */
+  onDrop: function PMDH_onDrop(event) {
+    // Put the item at the end of bookmark menu.
+    let ip = new InsertionPoint(PlacesUtils.bookmarksMenuFolderId,
+                                PlacesUtils.bookmarks.DEFAULT_INDEX,
+                                Components.interfaces.nsITreeView.DROP_ON);
+    PlacesControllerDragHelper.onDrop(ip, event.dataTransfer);
+    event.stopPropagation();
+  }
+};
+
+
+// This object handles the initialization and uninitialization of the bookmarks
+// toolbar.  updateState is called when the browser window is opened and
+// after closing the toolbar customization dialog.
+let PlacesToolbarHelper = {
+  _place: "place:folder=TOOLBAR",
+  get _viewElt() {
+    return document.getElementById("PlacesToolbar");
+  },
+
+  init: function PTH_init() {
+    if (this._viewElt)
+      new PlacesToolbar(this._place);
+  },
+
+  customizeStart: function PTH_customizeStart() {
+    let viewElt = this._viewElt;
+    if (viewElt && viewElt._placesView)
+      viewElt._placesView.uninit();
+  },
+
+  customizeDone: function PTH_customizeDone() {
+    this.init();
+  }
+};
+
+
+// Handles the bookmarks menu button shown when the main menubar is hidden.
+let BookmarksMenuButton = {
+  _popupInitialized: false,
+  onPopupShowing: function BMB_onPopupShowing(event) {
+    if (!this._popupInitialized) {
+      // First popupshowing event, initialize immutable attributes.
+      this._popupInitialized = true;
+
+      // Need to set the label on Unsorted Bookmarks menu.
+      let unsortedBookmarksElt =
+        document.getElementById("BMB_unsortedBookmarksFolderMenu");
+      unsortedBookmarksElt.label =
+        PlacesUtils.getString("UnsortedBookmarksFolderTitle");
+    }
+  },
+};
copy from suite/common/history/placesOverlay.xul
copy to suite/common/bookmarks/placesOverlay.xul
--- a/suite/common/history/placesOverlay.xul
+++ b/suite/common/bookmarks/placesOverlay.xul
@@ -6,200 +6,249 @@
    - the License. You may obtain a copy of the License at
    - http://www.mozilla.org/MPL/
    -
    - Software distributed under the License is distributed on an "AS IS" basis,
    - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
    - for the specific language governing rights and limitations under the
    - License.
    -
-   - The Original Code is mozilla.org code.
+   - The Original Code is the Shared Places Commands.
    -
-   - The Initial Developer of the Original Code is
-   - Netscape Communications Corporation.
-   - Portions created by the Initial Developer are Copyright (C) 1998
+   - The Initial Developer of the Original Code is Google Inc.
+   - Portions created by the Initial Developer are Copyright (C) 2005-2006
    - the Initial Developer. All Rights Reserved.
    -
    - Contributor(s):
    -   Ben Goodger <beng@google.com>
    -   Asaf Romano <mano@mozilla.com>
-   -   Robert Kaiser <kairo@kairo.at>
+   -   Michael Kohler <michaelkohler@live.com>
    -
    - Alternatively, the contents of this file may be used under the terms of
    - either the GNU General Public License Version 2 or later (the "GPL"), or
    - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
    - in which case the provisions of the GPL or the LGPL are applicable instead
    - of those above. If you wish to allow use of your version of this file only
    - under the terms of either the GPL or the LGPL, and not to allow others to
    - use your version of this file under the terms of the MPL, indicate your
    - decision by deleting the provisions above and replace them with the notice
-   - and other provisions required by the LGPL or the GPL. If you do not delete
+   - and other provisions required by the GPL or the LGPL. If you do not delete
    - the provisions above, a recipient may use your version of this file under
    - the terms of any one of the MPL, the GPL or the LGPL.
    -
    - ***** END LICENSE BLOCK ***** -->
 
 <!DOCTYPE overlay [
-<!ENTITY % historyDTD SYSTEM "chrome://communicator/locale/history/history.dtd">
-%historyDTD;
-<!ENTITY % utilityDTD SYSTEM "chrome://communicator/locale/utilityOverlay.dtd">
-%utilityDTD;
+<!ENTITY % placesDTD SYSTEM "chrome://communicator/locale/bookmarks/places.dtd">
+%placesDTD;
+<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://global/locale/editMenuOverlay.dtd">
+%editMenuOverlayDTD;
 ]>
 
-<?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"><![CDATA[
+    Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
+    Components.utils.import("resource:///modules/PlacesUIUtils.jsm");
+  ]]></script>
   <script type="application/javascript"
-          src="chrome://communicator/content/bookmarks/bookmarks.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/history.js"/>
+          src="chrome://communicator/content/places/controller.js"/>
   <script type="application/javascript"
-          src="chrome://communicator/content/history/utils.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/controller.js"/>
-  <script type="application/javascript"
-          src="chrome://communicator/content/history/treeView.js"/>
-  <script type="application/javascript"
-          src="chrome://global/content/nsDragAndDrop.js"/>
+          src="chrome://communicator/content/places/treeView.js"/>
+
+  <!-- Bookmarks and history tooltip -->
+  <tooltip id="bhTooltip" noautohide="true"
+           onpopupshowing="return window.top.BookmarksEventHandler.fillInBHTooltip(document, event)">
+    <vbox id="bhTooltipTextBox" flex="1">
+      <label id="bhtTitleText" class="tooltip-label" />
+      <label id="bhtUrlText" crop="center" class="tooltip-label" />
+    </vbox>
+  </tooltip>
 
   <commandset id="placesCommands"
               commandupdater="true"
-              events="focus,sort"
-              oncommandupdate="updateHistoryCommands(this.firstChild);">
+              events="focus,sort,places"
+              oncommandupdate="goUpdatePlacesCommands();">
     <command id="placesCmd_open"
-             oncommand="goDoCommand('placesCmd_open');"/>
+             oncommand="goDoPlacesCommand('placesCmd_open');"/>
     <command id="placesCmd_open:window"
-             oncommand="goDoCommand('placesCmd_open:window');"/>
+             oncommand="goDoPlacesCommand('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');"/>
+             oncommand="goDoPlacesCommand('placesCmd_open:tab');"/>
+
+    <command id="placesCmd_new:bookmark"
+             oncommand="goDoPlacesCommand('placesCmd_new:bookmark');"/>
+    <command id="placesCmd_new:livemark"
+             oncommand="goDoPlacesCommand('placesCmd_new:livemark');"/>
+    <command id="placesCmd_new:folder"
+             oncommand="goDoPlacesCommand('placesCmd_new:folder');"/>
+    <command id="placesCmd_new:separator"
+             oncommand="goDoPlacesCommand('placesCmd_new:separator');"/>
+    <command id="placesCmd_show:info"
+             oncommand="goDoPlacesCommand('placesCmd_show:info');"/>
+    <command id="placesCmd_rename"
+             oncommand="goDoPlacesCommand('placesCmd_show:info');"
+             observes="placesCmd_show:info"/>
+    <command id="placesCmd_reload"
+             oncommand="goDoPlacesCommand('placesCmd_reload');"/>
+    <command id="placesCmd_reloadMicrosummary"
+             oncommand="goDoPlacesCommand('placesCmd_reloadMicrosummary');"/>
+    <command id="placesCmd_sortBy:name"
+             oncommand="goDoPlacesCommand('placesCmd_sortBy:name');"/>
+    <command id="placesCmd_moveBookmarks"
+             oncommand="goDoPlacesCommand('placesCmd_moveBookmarks');"/>
+    <command id="placesCmd_deleteDataHost"
+             oncommand="goDoPlacesCommand('placesCmd_deleteDataHost');"/>
+    <command id="placesCmd_createBookmark"
+             oncommand="goDoPlacesCommand('placesCmd_createBookmark');"/>
+
+    <!-- Special versions of cut/copy/paste/delete which check for an open context menu. -->
+    <command id="placesCmd_cut"
+             oncommand="goDoPlacesCommand('placesCmd_cut');"/>
+    <command id="placesCmd_copy"
+             oncommand="goDoPlacesCommand('placesCmd_copy');"/>
+    <command id="placesCmd_paste"
+             oncommand="goDoPlacesCommand('placesCmd_paste');"/>
+    <command id="placesCmd_delete"
+             oncommand="goDoPlacesCommand('placesCmd_delete');"/>
   </commandset>
 
   <menupopup id="placesContext"
-         onpopupshowing="this._view = PlacesUIUtils.getViewForNode(document.popupNode);
-                         return this._view.buildContextMenu(this);"
-         onpopuphiding="this._view.destroyContextMenu();">
+             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:newwindow"
               command="placesCmd_open:window"
               label="&cmd.open_window.label;"
               accesskey="&cmd.open_window.accesskey;"
+              selectiontype="single"
               selection="link"/>
     <menuitem id="placesContext_open:newtab"
               command="placesCmd_open:tab"
               label="&cmd.open_tab.label;"
               accesskey="&cmd.open_tab.accesskey;"
+              selectiontype="single"
+              selection="link"/>
+    <menuitem id="placesContext_openContainer:tabs"
+              oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
+                         view.controller.openSelectionInTabs(event);"
+              onclick="checkForMiddleClick(this, event);"
+              label="&cmd.open_all_in_tabs.label;"
+              accesskey="&cmd.open_all_in_tabs.accesskey;"
+              selectiontype="single"
+              selection="folder|host|query"/>
+    <menuitem id="placesContext_openLinks:tabs"
+              oncommand="var view = PlacesUIUtils.getViewForNode(document.popupNode);
+                         view.controller.openSelectionInTabs(event);"
+              onclick="checkForMiddleClick(this, event);"
+              label="&cmd.open_all_in_tabs.label;"
+              accesskey="&cmd.open_all_in_tabs.accesskey;"
+              selectiontype="multiple"
               selection="link"/>
     <menuseparator id="placesContext_openSeparator"/>
-    <menuitem id="addBookmarkContextItem"
-              label="&bookmarkLinkCmd.label;"
-              accesskey="&bookmarkLinkCmd.accesskey;"
-              selectiontype="single"
+    <menuitem id="placesContext_new:bookmark"
+              command="placesCmd_new:bookmark"
+              label="&cmd.new_bookmark.label;"
+              accesskey="&cmd.new_bookmark.accesskey;"
+              selection="any"
+              hideifnoinsertionpoint="true"/>
+    <menuitem id="placesContext_new:folder"
+              command="placesCmd_new:folder"
+              label="&cmd.new_folder.label;"
+              accesskey="&cmd.context_new_folder.accesskey;"
+              selection="any"
+              hideifnoinsertionpoint="true"/>
+    <menuitem id="placesContext_new:separator"
+              command="placesCmd_new:separator"
+              label="&cmd.new_separator.label;"
+              accesskey="&cmd.new_separator.accesskey;"
+              closemenu="single"
+              selection="any"
+              hideifnoinsertionpoint="true"/>
+    <menuseparator id="placesContext_newSeparator"/>
+    <menuitem id="placesContext_createBookmark"
+              command="placesCmd_createBookmark"
+              label="&cmd.bookmarkLink.label;"
+              accesskey="&cmd.bookmarkLink.accesskey;"
               selection="link"
-              oncommand="historyAddBookmarks();"/>
-    <menuitem id="addBookmarkContextItem"
-              label="&bookmarkLinksCmd.label;"
-              accesskey="&bookmarkLinksCmd.accesskey;"
-              selectiontype="multiple"
-              selection="link"
-              oncommand="historyAddBookmarks();"/>
+              forcehideselection="bookmark|tagChild"/>
+    <menuitem id="placesContext_cut"
+              command="placesCmd_cut"
+              label="&cutCmd.label;"
+              accesskey="&cutCmd.accesskey;"
+              closemenu="single"
+              selection="bookmark|folder|separator|query"
+              forcehideselection="tagChild|livemarkChild"/>
     <menuitem id="placesContext_copy"
-              command="cmd_copy"
+              command="placesCmd_copy"
               label="&copyCmd.label;"
+              closemenu="single"
               accesskey="&copyCmd.accesskey;"
               selection="any"/>
+    <menuitem id="placesContext_paste"
+              command="placesCmd_paste"
+              label="&pasteCmd.label;"
+              closemenu="single"
+              accesskey="&pasteCmd.accesskey;"
+              selection="any"
+              hideifnoinsertionpoint="true"/>
     <menuseparator id="placesContext_editSeparator"/>
     <menuitem id="placesContext_delete"
-              command="cmd_delete"
+              command="placesCmd_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"/>
+              closemenu="single"
+              selection="bookmark|tagChild|folder|query|dynamiccontainer|separator|host"/>
+    <menuitem id="placesContext_delete_history"
+              command="placesCmd_delete"
+              label="&cmd.delete.label;"
+              accesskey="&cmd.delete.accesskey;"
+              closemenu="single"
+              selection="link"
+              forcehideselection="bookmark"/>
+    <menuitem id="placesContext_deleteHost"
+              command="placesCmd_deleteDataHost"
+              label="&cmd.deleteDomainData.label;"
+              accesskey="&cmd.deleteDomainData.accesskey;"
+              closemenu="single"
+              selection="link|host"
+              selectiontype="single"
+              forcehideselection="bookmark"/>
+    <menuseparator id="placesContext_deleteSeparator"/>
+    <menuitem id="placesContext_reload"
+              command="placesCmd_reload"
+              label="&cmd.reloadLivebookmark.label;"
+              accesskey="&cmd.reloadLivebookmark.accesskey;"
+              closemenu="single"
+              selection="livemark/feedURI"/>
+    <menuitem id="placesContext_reloadMicrosummary"
+              command="placesCmd_reloadMicrosummary"
+              label="&cmd.reloadMicrosummary.label;"
+              accesskey="&cmd.reloadMicrosummary.accesskey;"
+              closemenu="single"
+              selection="microsummary"/>
+    <menuitem id="placesContext_sortBy:name"
+              command="placesCmd_sortBy:name"
+              label="&cmd.sortby_name.label;"
+              accesskey="&cmd.sortby_name.accesskey;"
+              closemenu="single"
+              selection="folder"/>
+    <menuseparator id="placesContext_sortSeparator"/>
+    <menuitem id="placesContext_show:info"
+              command="placesCmd_show:info"
+              label="&cmd.properties.label;"
+              accesskey="&cmd.properties.accesskey;"
+              selection="bookmark|folder|query"
+              forcehideselection="livemarkChild"/>
   </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>
--- a/suite/common/contentAreaContextOverlay.xul
+++ b/suite/common/contentAreaContextOverlay.xul
@@ -92,19 +92,17 @@
       <menuitem id="context-openlinkintab"
                 label="&openLinkCmdInTab.label;"
                 accesskey="&openLinkCmdInTab.accesskey;"
                 oncommand="gContextMenu.openLinkInTab(event.shiftKey);"/>
       <menuseparator id="context-sep-open"/>
       <menuitem id="context-bookmarklink"
                 label="&bookmarkLinkCmd.label;"
                 accesskey="&bookmarkLinkCmd.accesskey;"
-                oncommand="BookmarksUtils.addBookmark(gContextMenu.linkURL,
-                                                      gContextMenu.linkText(),
-                                                      undefined, false);"/>
+                oncommand="gContextMenu.bookmarkLink();"/>
       <menuitem id="context-savelink"
                 valueSaveAs="&saveLinkAsCmd.label;"
                 valueSave="&saveLinkCmd.label;"
                 accesskey="&saveLinkCmd.accesskey;"
                 oncommand="gContextMenu.saveLink();"/>
       <menuitem id="context-copyemail"
                 label="&copyEmailCmd.label;"
                 accesskey="&copyEmailCmd.accesskey;"
@@ -207,17 +205,17 @@
                 label="&stopCmd.label;"
                 accesskey="&stopCmd.accesskey;"
                 disabled="true"
                 oncommand="BrowserStop();"/>
       <menuseparator id="context-sep-stop"/>
       <menuitem id="context-bookmarkpage"
                 label="&bookmarkPageCmd.label;"
                 accesskey="&bookmarkPageCmd.accesskey;"
-                oncommand="gContextMenu.addBookmark();"/>
+                oncommand="gContextMenu.bookmarkThisPage();"/>
       <menuitem id="context-savepage"
                 valueSaveAs="&savePageAsCmd.label;"
                 valueSave="&savePageCmd.label;"
                 accesskey="&savePageCmd.accesskey;"
                 oncommand="saveDocument(window.content.document, true);"/>
       <menuseparator id="context-sep-viewbgimage"/>
       <menuitem id="context-viewbgimage"
                 label="&viewBGImageCmd.label;"
--- a/suite/common/feeds/subscribe.xhtml
+++ b/suite/common/feeds/subscribe.xhtml
@@ -39,16 +39,17 @@
      how much XUL-in-XHTML sucks, see bug 348830 -->
         <div id="feedSubscribeLine"
           ><xul:vbox
             ><xul:hbox align="center"
               ><xul:description id="subscribeUsingDescription"
               /><xul:menulist id="handlersMenuList" aria-labelledby="subscribeUsingDescription"
                 ><xul:menupopup menugenerated="true" id="handlersMenuPopup"
                   ><xul:menuitem id="messengerFeedsMenuItem" label="&feedMessenger;" class="menuitem-iconic" image="chrome://communicator/skin/icons/feedIcon16.png" selected="true"
+                  /><xul:menuitem id="liveBookmarksMenuItem" label="&feedLiveBookmarks;" class="menuitem-iconic" image="chrome://communicator/skin/icons/feedIcon16.png" selected="true"
                   /><xul:menuseparator
                 /></xul:menupopup
               ></xul:menulist
             ></xul:hbox
             ><xul:hbox
               ><xul:checkbox id="alwaysUse" checked="false"
             /></xul:hbox
             ><xul:hbox align="center"
--- a/suite/common/jar.mn
+++ b/suite/common/jar.mn
@@ -116,23 +116,24 @@ comm.jar:
    content/communicator/bookmarks/bm-panel.js                       (bookmarks/bm-panel.js)
    content/communicator/bookmarks/bm-panel.xul                      (bookmarks/bm-panel.xul)
    content/communicator/bookmarks/bm-props.js                       (bookmarks/bm-props.js)
    content/communicator/bookmarks/bm-props.xul                      (bookmarks/bm-props.xul)
    content/communicator/bookmarks/bookmarks.css                     (bookmarks/bookmarks.css)
    content/communicator/bookmarks/bookmarks.js                      (bookmarks/bookmarks.js)
    content/communicator/bookmarks/bookmarksManager.js               (bookmarks/bookmarksManager.js)
    content/communicator/bookmarks/bookmarksManager.xul              (bookmarks/bookmarksManager.xul)
-   content/communicator/bookmarks/bookmarksMenu.js                  (bookmarks/bookmarksMenu.js)
    content/communicator/bookmarks/bookmarksOverlay.xul              (bookmarks/bookmarksOverlay.xul)
    content/communicator/bookmarks/bookmarksTree.xml                 (bookmarks/bookmarksTree.xml)
    content/communicator/bookmarks/findBookmark.js                   (bookmarks/findBookmark.js)
    content/communicator/bookmarks/findBookmark.xul                  (bookmarks/findBookmark.xul)
    content/communicator/bookmarks/sortFolder.js                     (bookmarks/sortFolder.js)
    content/communicator/bookmarks/sortFolder.xul                    (bookmarks/sortFolder.xul)
+   content/communicator/bookmarks/browser-places.js                 (bookmarks/browser-places.js)
+   content/communicator/bookmarks/placesOverlay.xul                 (bookmarks/placesOverlay.xul)
    content/communicator/directory/directory.html                    (directory/directory.html)
    content/communicator/directory/directory.js                      (directory/directory.js)
    content/communicator/directory/directory.xul                     (directory/directory.xul)
    content/communicator/downloads/downloadmanager.js                (downloads/downloadmanager.js)
    content/communicator/downloads/downloadmanager.xul               (downloads/downloadmanager.xul)
    content/communicator/downloads/DownloadProgressListener.js       (downloads/DownloadProgressListener.js)
    content/communicator/downloads/progressDialog.xul                (downloads/progressDialog.xul)
    content/communicator/downloads/progressDialog.js                 (downloads/progressDialog.js)
@@ -154,16 +155,23 @@ comm.jar:
    content/communicator/permissions/cookieViewer.js                 (permissions/cookieViewer.js)
    content/communicator/permissions/cookieViewer.xul                (permissions/cookieViewer.xul)
    content/communicator/permissions/imageContextOverlay.xul         (permissions/imageContextOverlay.xul)
    content/communicator/permissions/permissionsManager.js           (permissions/permissionsManager.js)
    content/communicator/permissions/permissionsManager.xul          (permissions/permissionsManager.xul)
    content/communicator/permissions/permissionsNavigatorOverlay.xul (permissions/permissionsNavigatorOverlay.xul)
    content/communicator/permissions/permissionsOverlay.js           (permissions/permissionsOverlay.js)
    content/communicator/permissions/treeUtils.js                    (permissions/treeUtils.js)
+*  content/communicator/places/browserPlacesViews.js                (places/browserPlacesViews.js)
+   content/communicator/places/controller.js                        (places/controller.js)
+*  content/communicator/places/menu.xml                             (places/menu.xml)
+   content/communicator/places/places.css                           (places/places.css)
+   content/communicator/places/sidebarUtils.js                      (places/sidebarUtils.js)
+   content/communicator/places/tree.xml                             (places/tree.xml)
+   content/communicator/places/treeView.js                          (places/treeView.js)
    content/communicator/pref/preferences.xul                        (pref/preferences.xul)
    content/communicator/pref/preferences.js                         (pref/preferences.js)
    content/communicator/pref/prefpanels.css                         (pref/prefpanels.css)
    content/communicator/pref/prefpanels.xml                         (pref/prefpanels.xml)
    content/communicator/pref/pref-advanced.js                       (pref/pref-advanced.js)
    content/communicator/pref/pref-advanced.xul                      (pref/pref-advanced.xul)
    content/communicator/pref/pref-appearance.js                     (pref/pref-appearance.js)
    content/communicator/pref/pref-appearance.xul                    (pref/pref-appearance.xul)
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -1014,34 +1014,41 @@ nsContextMenu.prototype = {
 
   // Copy email to clipboard
   copyEmail: function() {
     var clipboard = this.getService("@mozilla.org/widget/clipboardhelper;1",
                                     Components.interfaces.nsIClipboardHelper);
     clipboard.copyString(this.getEmail());
   },
 
-  addBookmark: function() {
-    var docshell = document.getElementById( "content" ).webNavigation;
-    BookmarksUtils.addBookmark(docshell.currentURI.spec,
-                               docshell.document.title,
-                               docshell.document.characterSet,
-                               false);
+  bookmarkThisPage : function() {
+    window.top.PlacesCommandHook.bookmarkPage(this.browser,
+                                              PlacesUtils.bookmarksMenuFolderId,
+                                              true);
+  },
+
+  bookmarkLink: function CM_bookmarkLink() {
+    window.top.PlacesCommandHook.bookmarkLink(PlacesUtils.bookmarksMenuFolderId,
+                                              this.linkURL,
+                                              this.linkText());
   },
 
   addBookmarkForFrame: function() {
     var doc = this.target.ownerDocument;
-    var uri = doc.location.href;
-    var title = doc.title;
-    if (!title)
-      title = uri;
-    BookmarksUtils.addBookmark(uri,
-                               title,
-                               doc.characterSet,
-                               false);
+    var uri = doc.documentURIObject;
+
+    var itemId = PlacesUtils.getMostRecentBookmarkForURI(uri);
+    if (itemId == -1) {
+      var title = doc.title;
+      var description = PlacesUIUtils.getDescriptionFromDocument(doc);
+      PlacesUIUtils.showMinimalAddBookmarkUI(uri, title, description);
+    }
+    else
+      PlacesUIUtils.showItemProperties(itemId,
+                                       PlacesUtils.bookmarks.TYPE_BOOKMARK);
   },
 
   // Open Metadata window for node
   showMetadata: function() {
     window.openDialog("chrome://navigator/content/metadata.xul",
                       "_blank",
                       "scrollbars,resizable,chrome,dialog=no",
                       this.target);
--- a/suite/common/search/search-panel.js
+++ b/suite/common/search/search-panel.js
@@ -41,17 +41,16 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 const ISEARCH_CONTRACTID       = "@mozilla.org/rdf/datasource;1?name=internetsearch";
 const RDFSERVICE_CONTRACTID    = "@mozilla.org/rdf/rdf-service;1";
 const BMARKS_CONTRACTID        = "@mozilla.org/browser/bookmarks-service;1";
 
-const nsIBookmarksService      = Components.interfaces.nsIBookmarksService;
 const nsIRDFService            = Components.interfaces.nsIRDFService;
 const nsIRDFLiteral            = Components.interfaces.nsIRDFLiteral;
 const nsIRDFDataSource         = Components.interfaces.nsIRDFDataSource;
 const nsIRDFRemoteDataSource   = Components.interfaces.nsIRDFRemoteDataSource;
 const nsIInternetSearchService = Components.interfaces.nsIInternetSearchService;
 
 const DEBUG = false;
 
@@ -937,18 +936,17 @@ function saveSearch()
       if (endOffset > 0)
         lastSearchText = lastSearchText.substr(0, endOffset+1);
     }
   }
 
   var searchTitle = searchBundle.stringBundle.formatStringFromName(
                       "searchTitle", [lastSearchText], 1);
 
-  var bmks = Components.classes[BMARKS_CONTRACTID].getService(nsIBookmarksService);
-  bmks.addBookmarkImmediately(lastSearchURI, searchTitle, bmks.BOOKMARK_SEARCH_TYPE, null);
+  // XXXplaces: add lastSearchURI to bookmarks with searchTitle
 }
 
 var gPageNumber = 0;
 /**
  * showMoreResults
  *
  * Run a query to show the next/previous page of search results for the
  * current search term.
--- a/suite/feeds/src/FeedConverter.js
+++ b/suite/feeds/src/FeedConverter.js
@@ -428,16 +428,21 @@ FeedResultService.prototype = {
       }
       break;
 
     default:
       // "web" should have been handled elsewhere
       LOG("unexpected handler: " + handler);
       // fall through
     case "bookmarks":
+      var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
+                         .getService(Components.interfaces.nsIWindowMediator);
+      var topWindow = wm.getMostRecentWindow("navigator:browser");
+      topWindow.PlacesCommandHook.addLiveBookmark(spec, title, subtitle);
+      break;
     case "messenger":
       Components.classes["@mozilla.org/newsblog-feed-downloader;1"]
                 .getService(Components.interfaces.nsINewsBlogFeedDownloader)
                 .subscribeToFeed("feed:" + spec, null, null);
       break;
 
     }
   },
--- a/suite/feeds/src/FeedWriter.js
+++ b/suite/feeds/src/FeedWriter.js
@@ -903,16 +903,21 @@ FeedWriter.prototype = {
           // isn't the selected application
           if (this._defaultSystemReader) {
             var shouldHide = this._defaultSystemReader.path == this._selectedApp.path;
             codeStr += "defaultHandlerMenuItem.hidden = " + shouldHide + ";";
           }
           Components.utils.evalInSandbox(codeStr, this._contentSandbox);
           break;
         }
+       case "bookmarks":
+         var liveBookmarksMenuItem = this._document.getElementById("liveBookmarksMenuItem");
+         if (liveBookmarksMenuItem)
+           this._safeDoCommand(liveBookmarksMenuItem);
+         break;
       // fall through if this._selectedApp is null
       default:
         var messengerFeedsMenuItem = this._document.getElementById("messengerFeedsMenuItem");
         if (messengerFeedsMenuItem)
           this._safeDoCommand(messengerFeedsMenuItem);
         break;
     }
   },
@@ -1278,16 +1283,20 @@ FeedWriter.prototype = {
                                 this._selectedApp);
           prefs.setCharPref(getPrefReaderForType(feedType), "client");
           break;
         case "defaultHandlerMenuItem":
           prefs.setComplexValue(getPrefAppForType(feedType), Components.interfaces.nsILocalFile,
                                 this._defaultSystemReader);
           prefs.setCharPref(getPrefReaderForType(feedType), "client");
           break;
+        case "liveBookmarksMenuItem":
+          defaultHandler = "bookmarks";
+          prefs.setCharPref(getPrefReaderForType(feedType), "bookmarks");
+          break;
         case "messengerFeedsMenuItem":
           defaultHandler = "messenger";
           prefs.setCharPref(getPrefReaderForType(feedType), "messenger");
           break;
       }
       var feedService = Components.classes["@mozilla.org/browser/feeds/result-service;1"]
                                   .getService(Components.interfaces.nsIFeedResultService);
 
--- a/suite/locales/en-US/chrome/browser/navigator.dtd
+++ b/suite/locales/en-US/chrome/browser/navigator.dtd
@@ -153,16 +153,17 @@
 
 <!ENTITY proxyIcon.tooltip            "Drag and drop this icon to create a link to this page">
 
 <!-- Toolbar items --> 
 <!ENTITY  bookmarksButton.label       "Bookmarks">
 <!ENTITY  bookmarksButton.tooltip     "Bookmarks list">
 <!ENTITY  homeButton.label            "Home">
 <!ENTITY  bookmarksToolbarItem.label  "Bookmarks Toolbar Items">
+<!ENTITY bookmarksToolbarChevron.tooltip "Show more bookmarks">
 
 <!-- Statusbar -->
 <!ENTITY  statusText.label            "Done">
 
 <!ENTITY historyCmd.label           "History">  
 <!ENTITY historyCmd.accesskey       "i">
 <!ENTITY history.commandKey         "h">
 
--- a/suite/locales/en-US/chrome/browser/navigator.properties
+++ b/suite/locales/en-US/chrome/browser/navigator.properties
@@ -48,14 +48,16 @@ lwthemeInstallRequest.allowButton=Allow
 lwthemeInstallRequest.allowButton.accesskey=a
 
 lwthemePostInstallNotification.message=A new theme has been installed.
 lwthemePostInstallNotification.undoButton=Undo
 lwthemePostInstallNotification.undoButton.accesskey=n
 lwthemePostInstallNotification.manageButton=Manage Themes…
 lwthemePostInstallNotification.manageButton.accesskey=M
 
+menuOpenAllInTabs.label=Open All in Tabs
+
 # urlbarBindings.xml
 # LOCALIZATION NOTE: This is for the location bar drop-down string:
 #   "Search " + search_engine_name + " for " + user_input
 #   e.g. "Search Google for abc"
 # DO NOT change the %S order when translate, the first %S must be the search engine name.
 searchFor=Search %S for "%S"
new file mode 100644
--- /dev/null
+++ b/suite/locales/en-US/chrome/common/bookmarks/places.dtd
@@ -0,0 +1,104 @@
+<!ENTITY bookmarksManager.title         "Bookmarks Manager">
+<!ENTITY bookmarksManager.width         "700">
+<!ENTITY bookmarksManager.height        "500">
+
+<!ENTITY file.accesskey                 "F">
+<!ENTITY file.close.label               "Close">
+<!ENTITY file.close.accesskey           "C">
+<!ENTITY cmd.close.key                  "w">
+
+<!ENTITY view.columns.label             "Show Columns">
+<!ENTITY view.columns.accesskey         "C">
+<!ENTITY view.sort.label                "Sort">
+<!ENTITY view.sort.accesskey            "S">
+<!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 cmd.findInBookmarks.label      "Find in Bookmarks…">
+<!ENTITY cmd.findInBookmarks.accesskey  "F">
+<!ENTITY cmd.findCurrent.label          "Find in Current Collection…">
+<!ENTITY cmd.findCurrent.accesskey      "i">
+
+<!ENTITY cmd.exportHTML.label           "Export HTML…">
+<!ENTITY cmd.exportHTML.accesskey       "E">
+<!ENTITY cmd.importHTML.label           "Import HTML…">
+<!ENTITY cmd.importHTML.accesskey       "I">
+
+<!ENTITY cmd.backup.label               "Backup…">
+<!ENTITY cmd.backup.accesskey           "B">
+<!ENTITY cmd.restore2.label             "Restore">
+<!ENTITY cmd.restore2.accesskey         "R">
+<!ENTITY cmd.restoreFromFile.label      "Choose File…">
+<!ENTITY cmd.restoreFromFile.accesskey  "C">
+
+<!ENTITY cmd.bookmarkLink.label         "Bookmark This Page…">
+<!ENTITY cmd.bookmarkLink.accesskey     "B">
+<!ENTITY cmd.delete.label               "Delete This Page">
+<!ENTITY cmd.delete.accesskey           "D">
+<!ENTITY cmd.deleteDomainData.label     "Forget About This Site">
+<!ENTITY cmd.deleteDomainData.accesskey "F">
+
+<!ENTITY cmd.open.label                  "Open">
+<!ENTITY cmd.open.accesskey              "O">
+<!ENTITY cmd.open_window.label           "Open in a New Window">
+<!ENTITY cmd.open_window.accesskey       "N">
+<!ENTITY cmd.open_tab.label              "Open in a New Tab">
+<!ENTITY cmd.open_tab.accesskey          "w">
+<!ENTITY cmd.open_all_in_tabs.label      "Open All in Tabs">
+<!ENTITY cmd.open_all_in_tabs.accesskey  "O">
+
+<!ENTITY cmd.properties.label      "Properties">
+<!ENTITY cmd.properties.accesskey  "i">
+
+<!ENTITY cmd.sortby_name.label              "Sort By Name">
+<!ENTITY cmd.sortby_name.accesskey          "r">
+
+<!ENTITY cmd.new_bookmark.label            "New Bookmark…">
+<!ENTITY cmd.new_bookmark.accesskey        "B">
+<!ENTITY cmd.new_folder.label              "New Folder…">
+<!ENTITY cmd.new_folder.accesskey          "o">
+<!ENTITY cmd.context_new_folder.accesskey  "F">
+<!ENTITY cmd.new_separator.label           "New Separator">
+<!ENTITY cmd.new_separator.accesskey       "S">
+
+<!ENTITY cmd.reloadLivebookmark.label      "Reload Live Bookmark">
+<!ENTITY cmd.reloadLivebookmark.accesskey  "R">
+<!ENTITY cmd.reloadMicrosummary.label      "Reload Live Title">
+<!ENTITY cmd.reloadMicrosummary.accesskey  "R">
+
+<!ENTITY cmd.moveBookmarks.label                  "Move…">
+<!ENTITY cmd.moveBookmarks.accesskey              "M">
+
+<!ENTITY col.name.label          "Name">
+<!ENTITY col.tags.label          "Tags">
+<!ENTITY col.url.label           "Location">
+<!ENTITY col.lastvisit.label     "Visit Date">
+<!ENTITY col.visitcount.label    "Visit Count">
+<!ENTITY col.keyword.label       "Keyword">
+<!ENTITY col.description.label   "Description">
+<!ENTITY col.dateadded.label     "Added">
+<!ENTITY col.lastmodified.label  "Last Modified">
+
+<!ENTITY search.label                              "Search:">
+<!ENTITY search.accesskey                          "S">
+<!ENTITY search.scopeFolder.label                  "Selected Folder">
+<!ENTITY search.scopeFolder.accesskey              "r">
+<!ENTITY search.scopeBookmarks.label               "Bookmarks">
+<!ENTITY search.scopeBookmarks.accesskey           "k">
+<!ENTITY saveSearch.label                          "Save">
+<!ENTITY saveSearch.accesskey                      "S">
+
+<!ENTITY cmd.find.key  "f">
+
+<!ENTITY backButton.tooltip  "Go back">
+<!ENTITY forwardButton.tooltip  "Go forward">
+
+<!ENTITY detailsPane.more.label "More">
+<!ENTITY detailsPane.more.accesskey "e">
+<!ENTITY detailsPane.less.label "Less">
+<!ENTITY detailsPane.less.accesskey "e">
+<!ENTITY detailsPane.selectAnItemText.description "Select an item to view and edit its properties">
--- a/suite/locales/en-US/chrome/common/feeds/subscribe.dtd
+++ b/suite/locales/en-US/chrome/common/feeds/subscribe.dtd
@@ -1,3 +1,4 @@
 <!ENTITY feedPage.title "Viewing Feed">
 <!ENTITY feedSubscribeNow "Subscribe Now">
 <!ENTITY feedMessenger "News &amp; Blogs">
+<!ENTITY feedLiveBookmarks "Live Bookmarks">
--- a/suite/locales/jar.mn
+++ b/suite/locales/jar.mn
@@ -44,16 +44,17 @@
   locale/@AB_CD@/communicator/viewZoomOverlay.properties                    (%chrome/common/viewZoomOverlay.properties)
   locale/@AB_CD@/communicator/aboutSessionRestore.dtd                       (%chrome/common/aboutSessionRestore.dtd)
   locale/@AB_CD@/communicator/bookmarks/addBookmark.dtd                     (%chrome/common/bookmarks/addBookmark.dtd)
   locale/@AB_CD@/communicator/bookmarks/bm-props.dtd                        (%chrome/common/bookmarks/bm-props.dtd)
   locale/@AB_CD@/communicator/bookmarks/bookmarks.dtd                       (%chrome/common/bookmarks/bookmarks.dtd)
   locale/@AB_CD@/communicator/bookmarks/bookmarks.properties                (%chrome/common/bookmarks/bookmarks.properties)
   locale/@AB_CD@/communicator/bookmarks/findBookmark.dtd                    (%chrome/common/bookmarks/findBookmark.dtd)
   locale/@AB_CD@/communicator/bookmarks/sortFolder.dtd                      (%chrome/common/bookmarks/sortFolder.dtd)
+  locale/@AB_CD@/communicator/bookmarks/places.dtd                          (%chrome/common/bookmarks/places.dtd)
   locale/@AB_CD@/communicator/directory/directory.dtd                       (%chrome/common/directory/directory.dtd)
   locale/@AB_CD@/communicator/downloads/downloadmanager.dtd                 (%chrome/common/downloads/downloadmanager.dtd)
   locale/@AB_CD@/communicator/downloads/downloadmanager.properties          (%chrome/common/downloads/downloadmanager.properties)
   locale/@AB_CD@/communicator/downloads/progressDialog.dtd                  (%chrome/common/downloads/progressDialog.dtd)
   locale/@AB_CD@/communicator/help/cert_dialog_help.xhtml                   (%chrome/common/help/cert_dialog_help.xhtml)
   locale/@AB_CD@/communicator/help/certs_help.xhtml                         (%chrome/common/help/certs_help.xhtml)
   locale/@AB_CD@/communicator/help/certs_prefs_help.xhtml                   (%chrome/common/help/certs_prefs_help.xhtml)
   locale/@AB_CD@/communicator/help/composer_help.xhtml                      (%chrome/common/help/composer_help.xhtml)
@@ -133,16 +134,17 @@
   locale/@AB_CD@/communicator/history/places.properties                     (%chrome/common/history/places.properties)
   locale/@AB_CD@/communicator/migration/migration.dtd                       (%chrome/common/migration/migration.dtd)
   locale/@AB_CD@/communicator/migration/migration.properties                (%chrome/common/migration/migration.properties)
   locale/@AB_CD@/communicator/permissions/cookieViewer.properties           (%chrome/common/permissions/cookieViewer.properties)
   locale/@AB_CD@/communicator/permissions/cookieViewer.dtd                  (%chrome/common/permissions/cookieViewer.dtd)
   locale/@AB_CD@/communicator/permissions/permissionsManager.dtd            (%chrome/common/permissions/permissionsManager.dtd)
   locale/@AB_CD@/communicator/permissions/permissionsManager.properties     (%chrome/common/permissions/permissionsManager.properties)
   locale/@AB_CD@/communicator/permissions/permissionsNavigatorOverlay.dtd   (%chrome/common/permissions/permissionsNavigatorOverlay.dtd)
+  locale/@AB_CD@/communicator/places/places.properties                      (%chrome/common/places/places.properties)
   locale/@AB_CD@/communicator/pref/prefutilities.properties                 (%chrome/common/pref/prefutilities.properties)
   locale/@AB_CD@/communicator/pref/preferences.dtd                          (%chrome/common/pref/preferences.dtd)
   locale/@AB_CD@/communicator/pref/pref-advanced.dtd                        (%chrome/common/pref/pref-advanced.dtd)
   locale/@AB_CD@/communicator/pref/pref-appearance.dtd                      (%chrome/common/pref/pref-appearance.dtd)
   locale/@AB_CD@/communicator/pref/pref-applications.dtd                    (%chrome/common/pref/pref-applications.dtd)
   locale/@AB_CD@/communicator/pref/pref-applications.properties             (%chrome/common/pref/pref-applications.properties)
   locale/@AB_CD@/communicator/pref/pref-applicationManager.dtd              (%chrome/common/pref/pref-applicationManager.dtd)
   locale/@AB_CD@/communicator/pref/pref-applicationManager.properties       (%chrome/common/pref/pref-applicationManager.properties)
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..694760873498fadf1964139965a11a6ca93d9c13
GIT binary patch
literal 584
zc$@)90=NB%P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igM;
z5)=WR1qjyw00GEJL_t(I%Z<}LYg9oL#_|8$>?$cVph6UDD}y3isAwVE2o^!HiC9|N
z?6<HHwD1dP+CU1;3W5e?3qgex77G$gqZSscSGdVK=Q+n>Uu4lsoMv8_^P4lAnZ&r=
zT6ugIc*K9UvK+9{?WD#y_yN$lbon&5@3i&}-g>vq{d>;<XpGl7?e<v!)}Cyk2xN}C
zld~{0EIZkZoQ>lrj!v-&K)+w&E-qeKARMHGYYwSE-oPzk3U)qzo5^MhxI6A56u5%~
zuD}&YAPZzcHq`+_66R?d=n70A8v`C#t^;Jaj2Lh1eOf0ah)A3}wmgDFJzz3S!W8s&
z*16hh6BM{RFWx_8>F_nAMAj@&Oa_wS%7n-0WC~VS*ZBJDJFQda`CNUVs&<iC9Ux3b
z&ZAWK+_|}OgCaL6hZRQ-EmH0M#LWK<m}O*!2`-$x&a1aC=?}J1hLjH=n<G>p)dDs~
zoScKDg=KcXWClMfw097O^Q1KY7tr`~g^Vd9gP|NZSWIWg<q-2Go|`lZuLsNwxkfb?
zNP(+KQe!#~A62C$14A-w@`w!NjCz54;E@1$-tEl-WjS~VbO2s&zS;LTZge|oGX4$B
WZ(xE<|A1@&0000<MNUMnLSTZxYVR!o
deleted file mode 100644
index a2dd014d2878d8172bad2548042d1c7f7ab2935f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 4736044bc02184eb79f6dc5e82f00f7f4dfd3d53..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 651f825dd62fe021648741789421434aa758f695..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/suite/themes/classic/communicator/bookmarks/bookmarks.css
+++ b/suite/themes/classic/communicator/bookmarks/bookmarks.css
@@ -36,75 +36,117 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-/** 
- * Style rules for generic bookmarks items. 
- */    
+/**
+ * Style rules for generic bookmarks items.
+ */
 
-treechildren::-moz-tree-image(Name) {
+treechildren::-moz-tree-image(Name),
+treechildren::-moz-tree-image(title) {
   -moz-margin-end: 2px;
   width: 16px;
   height: 16px;
 }
 
 .bookmark-item,
-treechildren::-moz-tree-image(Name) {
+treechildren::-moz-tree-image(Name),
+treechildren::-moz-tree-image(title) {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.png");
 }
 
 .bookmark-item[container="true"],
-treechildren::-moz-tree-image(Name, container) {
+treechildren::-moz-tree-image(Name, container),
+treechildren::-moz-tree-image(title, container) {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-folder-closed.png");
 }
 
 .bookmark-item[open="true"],
-treechildren::-moz-tree-image(Name, open) {
+treechildren::-moz-tree-image(Name, open),
+treechildren::-moz-tree-image(title, open) {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-folder-open.png");
 }
 
 .bookmark-item[container="true"][open="true"][loading="true"] {
   list-style-image: url("chrome://communicator/skin/icons/loading.gif") !important;
 }
 
-.bookmark-item[status="new"],
-treechildren::-moz-tree-image(Name, new) {
-  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-updated.png");
-}
-
 .bookmark-item > .toolbarbutton-box > .toolbarbutton-icon {
   list-style-image: inherit;
   width: 16px;
   height: 16px;
 }
 
-treechildren::-moz-tree-twisty(group, hidetwisty) {
-  list-style-image: none;
-}
-
-treechildren::-moz-tree-image(Name, container, group) {
-  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-group.png");
-}
-
 /* calendar icon for history grouping items by day */
 treechildren::-moz-tree-image(Name, query, dayContainer) {
   list-style-image: url("chrome://communicator/skin/history/calendar.png");
 }
 
-treechildren::-moz-tree-image(Name, separator) {
+.bookmark-item[container][livemark],
+treechildren::-moz-tree-image(title, container, livemark) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/livemark-folder.png");
+  -moz-image-region: auto;
+}
+
+.bookmark-item[container][livemark] .bookmark-item,
+treechildren::-moz-tree-image(title, livemarkItem) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/livemark-item.png");
+}
+
+treechildren::-moz-tree-image(container, OrganizerQuery_AllBookmarks) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/allBookmarks.png");
+  -moz-image-region: auto;
+}
+
+#bookmarksToolbarFolderMenu,
+#BMB_bookmarksToolbarFolderMenu,
+treechildren::-moz-tree-image(container, OrganizerQuery_BookmarksToolbar) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmarksToolbar.png");
+  -moz-image-region: auto;
+}
+
+treechildren::-moz-tree-image(container, OrganizerQuery_BookmarksMenu) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmarksMenu.png");
+  -moz-image-region: auto;
+}
+
+#unsortedBookmarksFolderMenu,
+treechildren::-moz-tree-image(container, OrganizerQuery_UnfiledBookmarks) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/unsortedBookmarks.png");
+  -moz-image-region: auto;
+}
+
+/* query-nodes should be styled even if they're not expandable */
+.bookmark-item[container][query],
+treechildren::-moz-tree-image(title, query) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/query.png");
+  -moz-image-region: auto;
+}
+
+.bookmark-item[query][tagContainer],
+treechildren::-moz-tree-image(title, query, tagContainer),
+treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
+  list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
+  -moz-image-region: auto;
+}
+
+treechildren::-moz-tree-image(Name, separator),
+treechildren::-moz-tree-image(title, separator) {
   list-style-image: none;
   width: 0px;
   height: 0px;
 }
 
-treechildren::-moz-tree-cell-text(Name, separator) {
+treechildren::-moz-tree-cell-text(Name, separator),
+treechildren::-moz-tree-cell-text(title, separator) {
   color: ThreeDShadow;
   margin: 0px 5px;
 }
 
-treechildren::-moz-tree-cell-text(Name, separator, selected, focus) {
+treechildren::-moz-tree-cell-text(Name, separator, selected, focus),
+treechildren::-moz-tree-cell-text(title, separator, selected, focus) {
   color: HighlightText;
 }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b76d849b91f3927f3d657063dd3571c641d5c6d0
GIT binary patch
literal 371
zc$@)q0gV2MP)<h;3K|Lk000e1NJLTq000mG000mO0{{R3C@l|D0000PbVXQnQ*UN;
zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUyeo#zQMgRZ*+~o1c!mmn_*KWI$eQvUx
zqN1*<nYg^X$HK4J(!JW;+uY>w^78KU^Y8QX@bvWY^!4%e^zrrf^Y-=g_Vx7k_Vf7n
z_4xSp`T6(x`S|(z_xbwx`uX_!`uF?$`TP6&`~3R+`}zF)`uzO*{Qdm>{rvv^{r>*`
z|NsBrz{*Gf000AYQchC<f3kPJb4LIG0DMVAK~xx5ZOhvZf-n$8(UG=dy>StXXw^}H
z4*&myR?kBd!kT0rc5-MtL;3W#-ouLW8M0GiDYBxJgdie85Jshj&ChN?V17N{%%7ea
z!5ee!x|@I8J;KG97LyjiHRr}TcZv_8*19UoDqf9HXkB1(L^veNA+t$F3%-Eb4P}Ss
RFo6I7002ovPDHLkV1fr~%xC}r
--- a/suite/themes/classic/communicator/bookmarks/bookmarksToolbar.css
+++ b/suite/themes/classic/communicator/bookmarks/bookmarksToolbar.css
@@ -86,67 +86,61 @@ toolbarbutton.bookmark-item[disabled="tr
   width: 16px;
   height: 16px;
 }
 
 .bookmark-item > .toolbarbutton-menu-dropmarker {
   display: none;
 }
 
-/* ..... drag and drop styles ..... */
-
-toolbarbutton.bookmark-item[dragover-left="true"] {
-  -moz-border-left-colors: ThreeDDarkShadow;
+/* Prevent [mode="icons"] from hiding the label */
+.bookmark-item > .toolbarbutton-text {
+  display: -moz-box !important;
 }
 
-toolbarbutton.bookmark-item[dragover-right="true"] {
-  -moz-border-right-colors: ThreeDDarkShadow;
+/* ..... drag and drop styles ..... */
+
+#PlacesToolbarDropIndicator {
+  list-style-image: url("chrome://communicator/skin/bookmarks/toolbarDropMarker.png");
 }
 
-toolbarbutton.bookmark-item[dragover-top="true"] {
-  -moz-appearance: none;
-  -moz-border-top-colors: ThreeDDarkShadow;
-  -moz-border-right-colors: ThreeDDarkShadow;
-  -moz-border-bottom-colors: ThreeDDarkShadow;
-  -moz-border-left-colors: ThreeDDarkShadow;
+toolbarbutton.bookmark-item[dragover="true"][open="true"] {
+  background: Highlight !important;
+  color: HighlightText !important;
 }
 
 /* ::::: bookmark menus ::::: */
 
 menu.bookmark-item,
 menuitem.bookmark-item {
   border-top: 1px solid transparent !important;
   border-bottom: 1px solid transparent !important;
 }
 
 .bookmark-item > .menu-iconic-left > .menu-iconic-icon {
   width: 16px;
   height: 16px;
 }
 
-.bookmark-group {
-  list-style-image: url(chrome://communicator/skin/bookmarks/bookmark-group.png) !important;
-}
-
 .menuitem-iconic.bookmark-item[disabled="true"] {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-dis.png");
 }
 
 .menu-iconic.bookmark-item[disabled="true"][container="true"] {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-folder-dis.png");
 }
 
 /* ..... drag and drop styles ..... */
 
-menu.bookmark-item[dragover-top="true"],
-menuitem.bookmark-item[dragover-top="true"] {
-  border-top: 1px solid ThreeDDarkShadow !important;
-} 
-
-menu.bookmark-item[dragover-bottom="true"],
-menuitem.bookmark-item[dragover-bottom="true"] {
-  border-bottom: 1px solid ThreeDDarkShadow !important;
+/* rules for menupopup drop indicators */
+.menupopup-drop-indicator-bar {
+  position: relative;
+  /* these two margins must together compensate the indicator's height */
+  margin-top: -1px;
+  margin-bottom: -1px;
 }
 
-menu.bookmark-item[dragover="true"] {
-  background: Highlight !important;
-  color: HighlightText !important;
+.menupopup-drop-indicator {
+  list-style-image: none;
+  height: 2px;
+  -moz-margin-end: -4em;
+  background-color: Highlight;
 }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1e36e1177e846b779bf7b59037ba4732c1617746
GIT binary patch
literal 272
zc%17D@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G}
zXKrG8YEWuoN@d~6R2!fon*g5>*Z=?j1DQ82?FFJwpWXqvlX~mn>}884wpGub)V6Bf
zs+otjUp=&U6;SHdm4^`7UwbCD0X1`%1o;IsD5cfc*Uva}=FBx+uQhf+;b2b}#}J9B
zt>;hjH5hQX2F_{cOZxf0ekxPcqh;xppPiT-u6NusW1Lj3Qy?msyzbjf=7}w{uTJ1v
zq}Q>DEqcobJ*OYKZ!)5599gb5Jv2~xAM^XX-Gc<KbH+Q3w1CDlc)I$ztaD0e0syPO
Bcgz3)
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..9bf8de30d723c3f2c07dd47c8889a789fff8347c
GIT binary patch
literal 597
zc$@)M0;>IqP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igM;
z5+yNyfj`Lr00GrWL_t(I%f*v1XcJ)+$A8~<ci-JrV+O$`R#2;31q)gvXbmVh6vqsm
z>fo%1AcElJ7%UWuf)qjM5JgZCLA0PQLT%C(1g%gCwklfB+$EQ!P3}I2g4kRKo%*&1
z|Mz?U_jnJsI>g_}@K9cN3hqu6#XkXthw^%Kq>vD#x{q=3+!-oCKoHdNf-1gW1E4%R
zEzHh>xv?7{ZKCvk+=JarKfaCaT1eADStddln3e-T-{4uD0N|#u8$YmqzCgS+c>1Bi
zyphHaL;OmJ=lfKuRRAh0dgBNHLaeXB5H6W;k@L9>V%sjdPF==y<3D}ET8ll02H4<W
zbfiFi>LFrB2DPsr!)o!hJcm)fMg74gjDc%7+a08WH<QoN8WJP?D&0r6YDi1bJ}`*c
za{_wvm@{`U-j5@XUqC5|)`C`BBmv>ktJtoEQ!3zmnn24YX3uHxdSPi2%gbV9`f0A#
z0g#=5bYqIH?=K;H9g*6JF<(T5i&)t!5Z8zno*^Yf(fY0u4%F;Tgb)atM7c5Kqm!`w
z3bi*!q)g&(??6b}@!BQ;9YfSWi<r*~0n6TNj>K)ek0oYSiX5&**ufW`+#9F4w#g}D
j@7DkI2&+qC%b$_oiD9UJ2aT2w00000NkvXXu0mjfe!u~M
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a0edf570fbc2f05796d1cd038d16e816160c8075
GIT binary patch
literal 670
zc$@*A0%84$P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igM;
z5+M*)gzA$300JIKL_t(I%bk+HPZU8M#Xq|{cgK%|(*%%UBqSyV&P1cJ&_){?8$-0T
zFcwA|ZA`TCKd_*tF+nRUZNvtng+HPRLM4$PB18xrob280-tNxK*J26bj<fNbOfs2#
z-^+V%o+Bb`Ox>SWg~6f;wy<GInXv4c+NLsLS(&ixMOv~nP4VH91E2t$OnZOf?9Kj$
z4I3jOAQrI(tVYBTZ_YFO^v>Rz3t;QMG=N371Y>oxkX?c#@b-fdn_ip2yYKr)0Z3f&
z_JhTm6fCykh>ltl*tqH;n(g=FI9`TK;TYMT6R55M1W8qxB(>F=AjlvVH<!m$)(Ey2
z36|cH?JLqTbP+e#y{jtuhXoyaB0}NJ4a6F>ze@P?9rfQcBwGvQi&ybFds7=GX%S)^
zD8#Ze^Mu;M6prhWAHG6<WDHZ=#GiYH4N7SSO+mT<Vj?Bh5dQjz|8<g$*AJ*IPLu5!
zCO<NU-dUyc?PZ!pla17ZNfct~yZo5A^c{b8l0RQ2u#r#4@lkR|P7*ACpzY{6T-A0^
zL2OW1O;TRMgk=t$zlZ7`z@MGORMu!8x`f0P>MNhp?`<Y9Mm!P2;`7@qzj{Pmnx}C3
zI+bcj@Z$|$XD^P*5v|X)wor|%gVofNG$1#dM|BO5Q4Yz@3RsQT(TlFGAE<NM13}@q
zoVxX5ueM?m2Cq$|1=10RFWf~$4zw{Pu(+ScNBN)m3&$!|#l!)!?f?J)07*qoM6N<$
Ef;rzO2><{9
deleted file mode 100644
index 8fc466d015288a268cbd6cbb932641e8ee983277..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 8a161e1d45ea650deb926e89003e3e78010cfdc7..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index fea1d10be092499ccf7aee7865f82922cef143c5..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 3042ab567c39962caba271e6c20ef3f3a16c264f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2e0099afdb0f28aae6569d69cb95586d6d4e0c96
GIT binary patch
literal 579
zc$@)40=)f+P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igM;
z5*#&mXm)A<00F~EL_t(I%f*vFXj4%b#ees{`|{o!RK!X<w1a<8GPsCJrP6|-AXbWC
z+96ZiL{QYlrL&6)h2Y>I23kVwV5);fLS3YrLAoi`K@dSpOWu2Zsg1esI;fB)4{@sB
z_Q5%aa}M7J|9eFHlFv<=PC&6VC;mwwpPMv=>HA%PT?41NarqqeARq`DtOp^!zX8D8
z<(g2Pgxb;)(tsr`QjVhb{2`8KBb7_aRtRCCY!`sz7sgGOKs#B=6f>0yeh}hE5q>>l
z-S?@7ApmRN^!5lz8841ySS%F*$mH^5M$ZEfZTz4wJ<K)-ogGwP%u^}cW8&Ivgr%69
zzC*YgFgkvT*NY1PbVYbqdxMlI9M7gY`<U$2TcnR3L)k9s<`mB!6&TA-5S#c{<gN~W
zlcjPImZTL%DBHz$JX)I#q?A~eV5_;A?4Z5z-oAcbJ}qIi0VSx;mpL^wf|Q`ONf!7+
zE<d=-r;jTfI+A9gGK&CC3=NaLavg-E6*m(EOw7uM_q-|>S^fHjo}OL~4~}r)<QZDJ
ziPnZEr5Q}D`QA)8Wt@HkaCUz^Sc~-T<;K3hKf>1M<TIDvfb#Yn+`A*+_!AWEn#(f1
RFq!}W002ovPDHLkV1mJ3_?!R$
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ed3200f6c1f9b7844a78de9e572f8423b9928948
GIT binary patch
literal 583
zc$@)80=WH&P)<h;3K|Lk000e1NJLTq000R9000sQ1^@s6iGcJ-00004b3#c}2nYxW
zd<bNS00009a7bBm000fw000fw0YWI7cmMzZ8FWQhbW?9;ba!ELWdL_~cP?peYja~^
zaAhuUa%Y?FJQ@H10mMl}K~yM_g_2EA6JZpE&-+?KB{g<HW{A<9e?dztAtWTMXJE@m
z<3bQOnlJ-8Qzasa@go{FA#umn5OC{86T`v<;)X@hNNp85LrY^)TWG~OZkUS3=vm#I
z^W4Qfxq>7BV6y+Z>-)ZjU-IrO-f9PcP~iB!uicotiu&$%RLT`R8lP<}geLk@E=le9
ziPl=UIoy;@=MafTaP(NDW*H6vcp{k?<K6jbgbp79No3PGRLWH}M~*;I6-=GK4cVqD
zo#Xuue(dd`<dsm^D5AboN6S8-YAszL2~)QdLmi{cXYyQrxx(!G&rHTI($wv4k^sp7
zj1R>|n0~v)WMYh_ZubOP1KI~;17|MK)a~Abz6g5ym*jtmKOxI-VuNQ#Xc<oLUm?qI
z;-0(x=H}cr6boNpSccQnpn?j9J4RX9EOPDL2j)My!G+x<Axzyqx8;?V9z35x_1g}z
z=^Oyy)ajE*4bMPrZ|#x=ue5Y;ei}kbD5`>JTNFYFe93Gg_0+_cyZu^NhU1dd6iumJ
zzJIA{eKi9i1)e=#*sYeUVF2F2BDs;t^W*9|mtU>W)NKY?<DaCI-oq<TetWuL_z7HL
V{vBt+DB%DA002ovPDHLkV1ntt|Ahbm
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..94c125941ea0251abcb30333c154e78bbe80dc7f
GIT binary patch
literal 731
zc$@*-0wn#3P)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV00001b5ch_0Itp)
z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2igM;
z5)T5dI+FJQ00LV{L_t(I%dL}LNRwd{$A7+iw>4L8I{aA9nwvE&S6~q4l{ADP6pEQR
z!i#!ur1B~xMUd%87|~T2!B(`oi6B9-5oMTyi4?{xs7TB{$eA-;n>lB$i<r&oqM~zk
zKK|#N=lP#=;D3tG>#_bVCN0&lHdqr$ef;8h+MhHPQ<L42Yc0@3YocY}=}v`Gsa}r7
zq6(!_9gRdn0QJYE_9RaDx#Gd9dd6c@xFr{7AD(NDMk0;zc)U3pi8KOE!0GdPoWHyP
zAVPv0y;ljXEHJVdz%99G^0X4@3ao2#?XuSnv;oMH#MG7B8_ryBCajNAlCg^~i5L@0
zQyeREaJZueo1uVE@C6#(RzkDE?8^PNTirc9Gs!R5jfF-AoISi8dWL_xmn?Y>o8(&h
z!;f%FF6@_DSY3$`o}b3Ntq7ntl>@s@m(Az!44svyc-%eAVDK&(G7V}`!R>_yxFr`y
zyzPV+X2{bU0PFyQ&+D;jwCWw{8#PS6eg(jVx>km++-LaXAX<42TA7x<xdGggi|X?d
zq9~G+r?dFH9;*P<>h;+Of{Y5Ag9@7i)rL$us!rl}_c1m*ie*yGQB@@eN~;NU1&}LL
zm`o-BhX~k<icCBiy+<hY2>`RD7@1s2Tg?fW1aoN#xw)I^_um9StJPrMz7yb(2w2ht
z1x9l*M)P+<-oJZ8K|vwb-DLpG&jp#Aoo3J8^0iT}eq9Ezh$+UJWM=93@OFadPsadA
zPgjw@#k>w9$P_;oX*IsME~pT|kgvy(uTSyDSy`I@{Vn+KjQsNje*?i_%aJY{+qVD!
N002ovPDHLkV1o5|M)3du
--- a/suite/themes/classic/jar.mn
+++ b/suite/themes/classic/jar.mn
@@ -32,17 +32,16 @@ classic.jar:
   skin/classic/communicator/communicator.css                            (communicator/communicator.css)
   skin/classic/communicator/helpOverlay.css                             (communicator/helpOverlay.css)
 #ifdef XP_OS2
   skin/classic/communicator/toolbar.css                                 (os2/communicator/toolbar.css)
 #else
   skin/classic/communicator/toolbar.css                                 (communicator/toolbar.css)
 #endif
   skin/classic/communicator/bookmarks/bookmarks.css                     (communicator/bookmarks/bookmarks.css)
-  skin/classic/communicator/bookmarks/bookmark-folder-button.gif        (communicator/bookmarks/bookmark-folder-button.gif)
   skin/classic/communicator/bookmarks/bookmark-folder-closed.png        (communicator/bookmarks/bookmark-folder-closed.png)
   skin/classic/communicator/bookmarks/bookmark-folder-dis.png           (communicator/bookmarks/bookmark-folder-dis.png)
   skin/classic/communicator/bookmarks/bookmark-folder-open.png          (communicator/bookmarks/bookmark-folder-open.png)
   skin/classic/communicator/bookmarks/bookmarksToolbar.css              (communicator/bookmarks/bookmarksToolbar.css)
   skin/classic/communicator/downloads/downloadButtons.png               (communicator/downloads/downloadButtons.png)
   skin/classic/communicator/downloads/downloadmanager.css               (communicator/downloads/downloadmanager.css)
   skin/classic/communicator/sidebar/sidebar.css                         (communicator/sidebar/sidebar.css)
   skin/classic/communicator/icons/communicatoricons.png                 (communicator/icons/communicatoricons.png)
@@ -53,26 +52,28 @@ classic.jar:
   skin/classic/communicator/certError.css                               (communicator/certError.css)
   skin/classic/communicator/dialogs.css                                 (communicator/dialogs.css)
   skin/classic/communicator/communicatorBindings.xml                    (communicator/communicatorBindings.xml)
   skin/classic/communicator/preferences.css                             (communicator/preferences.css)
   skin/classic/communicator/prefpanels.css                              (communicator/prefpanels.css)
   skin/classic/communicator/smileys.css                                 (communicator/smileys.css)
   skin/classic/communicator/tasksOverlay.css                            (communicator/tasksOverlay.css)
   skin/classic/communicator/viewSourceOverlay.css                       (communicator/viewSourceOverlay.css)
-  skin/classic/communicator/bookmarks/bookmark-group.png                (communicator/bookmarks/bookmark-group.png)
+  skin/classic/communicator/bookmarks/allBookmarks.png                  (communicator/bookmarks/allBookmarks.png)
   skin/classic/communicator/bookmarks/bookmark-item-dis.png             (communicator/bookmarks/bookmark-item-dis.png)
-  skin/classic/communicator/bookmarks/bookmark-item-updated.png         (communicator/bookmarks/bookmark-item-updated.png)
   skin/classic/communicator/bookmarks/bookmark-item.png                 (communicator/bookmarks/bookmark-item.png)
+  skin/classic/communicator/bookmarks/bookmarksMenu.png                 (communicator/bookmarks/bookmarksMenu.png)
+  skin/classic/communicator/bookmarks/bookmarksToolbar.png              (communicator/bookmarks/bookmarksToolbar.png)
+  skin/classic/communicator/bookmarks/livemark-folder.png               (communicator/bookmarks/livemark-folder.png)
+  skin/classic/communicator/bookmarks/livemark-item.png                 (communicator/bookmarks/livemark-item.png)
+  skin/classic/communicator/bookmarks/query.png                         (communicator/bookmarks/query.png)
+  skin/classic/communicator/bookmarks/toolbarDropMarker.png             (communicator/bookmarks/toolbarDropMarker.png)
+  skin/classic/communicator/bookmarks/unsortedBookmarks.png             (communicator/bookmarks/unsortedBookmarks.png)
   skin/classic/communicator/bookmarks/bookmarksWindow.css               (communicator/bookmarks/bookmarksWindow.css)
   skin/classic/communicator/bookmarks/home.png                          (communicator/bookmarks/home.png)
-  skin/classic/communicator/bookmarks/location-act.gif                  (communicator/bookmarks/location-act.gif)
-  skin/classic/communicator/bookmarks/location-dis.gif                  (communicator/bookmarks/location-dis.gif)
-  skin/classic/communicator/bookmarks/location-hov.gif                  (communicator/bookmarks/location-hov.gif)
-  skin/classic/communicator/bookmarks/location.gif                      (communicator/bookmarks/location.gif)
   skin/classic/communicator/brand/throbber-anim.png                     (communicator/brand/throbber-anim.png)
   skin/classic/communicator/brand/throbber-single.png                   (communicator/brand/throbber-single.png)
   skin/classic/communicator/brand/throbber16-anim.png                   (communicator/brand/throbber16-anim.png)
   skin/classic/communicator/brand/throbber16-single.png                 (communicator/brand/throbber16-single.png)
   skin/classic/communicator/directory/directory.css                     (communicator/directory/directory.css)
   skin/classic/communicator/feed-subscribe.css                          (communicator/feed-subscribe.css)
   skin/classic/communicator/fullscreen-video.css                        (communicator/fullscreen-video.css)
   skin/classic/communicator/directory/folder-clsd.gif                   (communicator/directory/folder-clsd.gif)
--- a/suite/themes/classic/mac/communicator/bookmarks/bookmarks.css
+++ b/suite/themes/classic/mac/communicator/bookmarks/bookmarks.css
@@ -36,70 +36,111 @@
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
 
-/** 
- * Style rules for generic bookmarks items. 
- */    
+/**
+ * Style rules for generic bookmarks items.
+ */
 
-treechildren::-moz-tree-image(Name) {
+treechildren::-moz-tree-image(Name),
+treechildren::-moz-tree-image(title) {
   -moz-margin-end: 2px;
   width: 16px;
   height: 16px;
 }
 
 .bookmark-item,
-treechildren::-moz-tree-image(Name) {
+treechildren::-moz-tree-image(Name),
+treechildren::-moz-tree-image(title) {
   list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.png");
 }
 
 .bookmark-item[container="true"],
-treechildren::-moz-tree-image(Name, container) {
+treechildren::-moz-tree-image(Name, container),
+treechildren::-moz-tree-image(title, container) {
   list-style-image: url("chrome://global/skin/tree/folder.png");
 }
 
 .bookmark-item[container="true"][open="true"][loading="true"] {
   list-style-image: url("chrome://global/skin/icons/loading_16.png") !important;
 }
 
-.bookmark-item[status="new"],
-treechildren::-moz-tree-image(Name, new) {
-  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-updated.png");
-}
-
 .bookmark-item > .toolbarbutton-box > .toolbarbutton-icon {
   list-style-image: inherit;
   width: 16px;
   height: 16px;
 }
 
-treechildren::-moz-tree-twisty(group, hidetwisty) {
-  list-style-image: none;
-}
-
-treechildren::-moz-tree-image(Name, container, group) {
-  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-group.png");
-}
-
 /* calendar icon for history grouping items by day */
 treechildren::-moz-tree-image(Name, query, dayContainer) {
   list-style-image: url("chrome://communicator/skin/history/calendar.png");
 }
 
-treechildren::-moz-tree-image(Name, separator) {
+.bookmark-item[container][livemark],
+treechildren::-moz-tree-image(title, container, livemark) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/livemark-folder.png");
+  -moz-image-region: auto;
+}
+
+.bookmark-item[container][livemark] .bookmark-item,
+treechildren::-moz-tree-image(title, livemarkItem) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/livemark-item.png");
+}
+
+treechildren::-moz-tree-image(container, OrganizerQuery_AllBookmarks) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/allBookmarks.png");
+  -moz-image-region: auto;
+}
+
+#bookmarksToolbarFolderMenu,
+#BMB_bookmarksToolbarFolderMenu,
+treechildren::-moz-tree-image(container, OrganizerQuery_BookmarksToolbar) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmarksToolbar.png");
+  -moz-image-region: auto;
+}
+
+treechildren::-moz-tree-image(container, OrganizerQuery_BookmarksMenu) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmarksMenu.png");
+  -moz-image-region: auto;
+}
+
+#unsortedBookmarksFolderMenu,
+treechildren::-moz-tree-image(container, OrganizerQuery_UnfiledBookmarks) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/unsortedBookmarks.png");
+  -moz-image-region: auto;
+}
+
+/* query-nodes should be styled even if they're not expandable */
+.bookmark-item[container][query],
+treechildren::-moz-tree-image(title, query) {
+  list-style-image: url("chrome://communicator/skin/bookmarks/query.png");
+  -moz-image-region: auto;
+}
+
+.bookmark-item[query][tagContainer],
+treechildren::-moz-tree-image(title, query, tagContainer),
+treechildren::-moz-tree-image(query, OrganizerQuery_Tags) {
+  list-style-image: url("chrome://mozapps/skin/places/tagContainerIcon.png");
+  -moz-image-region: auto;
+}
+
+treechildren::-moz-tree-image(Name, separator),
+treechildren::-moz-tree-image(title, separator) {
   list-style-image: none;
   width: 0px;
   height: 0px;
 }
 
-treechildren::-moz-tree-cell-text(Name, separator) {
+treechildren::-moz-tree-cell-text(Name, separator),
+treechildren::-moz-tree-cell-text(title, separator) {
   color: ThreeDShadow;
   margin: 0px 5px;
 }
 
-treechildren::-moz-tree-cell-text(Name, separator, selected, focus) {
+treechildren::-moz-tree-cell-text(Name, separator, selected, focus),
+treechildren::-moz-tree-cell-text(title, separator, selected, focus) {
   color: HighlightText;
 }
--- a/suite/themes/classic/mac/navigator/navigator.css
+++ b/suite/themes/classic/mac/navigator/navigator.css
@@ -303,34 +303,26 @@ toolbar[mode="text"] > #window-controls 
 }
 
 #page-proxy-deck {
   cursor: -moz-grab;
   margin: 0 3px 1px 3px;
 }
 
 #page-proxy-button {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location.gif"); 
-} 
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.png"); 
+}
 
 #page-proxy-favicon {
   list-style-image: none;
-} 
-
-#page-proxy-button[pageproxystate="valid"]:hover  {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-hov.gif");
-}
-  
-#page-proxy-button[pageproxystate="valid"]:hover:active {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-act.gif");
 }
 
 #page-proxy-button[pageproxystate="invalid"] {
   cursor: default;
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-dis.gif");
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-dis.png");
 }
 
 /* ::::: autocomplete ::::: */
 
 .autocomplete-textbox-container {
   font: -moz-info;
   -moz-box-align: center;
 }
--- a/suite/themes/classic/navigator/navigator.css
+++ b/suite/themes/classic/navigator/navigator.css
@@ -332,34 +332,26 @@ toolbar[mode="text"] > #window-controls 
 }
 
 #page-proxy-deck {
   cursor: -moz-grab;
   margin: 2px 3px;
 }
 
 #page-proxy-button {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location.gif"); 
-} 
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item.png"); 
+}
 
 #page-proxy-favicon {
   list-style-image: none;
-} 
-
-#page-proxy-button[pageproxystate="valid"]:hover  {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-hov.gif");
-}
-  
-#page-proxy-button[pageproxystate="valid"]:hover:active {
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-act.gif");
 }
 
 #page-proxy-button[pageproxystate="invalid"] {
   cursor: default;
-  list-style-image: url("chrome://communicator/skin/bookmarks/location-dis.gif");
+  list-style-image: url("chrome://communicator/skin/bookmarks/bookmark-item-dis.png");
 }
 
 /* ::::: autocomplete ::::: */
 
 .autocomplete-history-dropmarker {
   border-right-width: 1px;
   border-bottom-width: 1px;
   -moz-border-right-colors: ThreeDShadow;