relanding with a function returning early to test impact on Linux Txul
authormconnor@steelgryphon.com
Wed, 19 Mar 2008 19:51:45 -0700
changeset 13355 a3d2b706e8089d338af8b09fc05057cecbab75df
parent 13354 4f24289cb5a5325a3d2db80e112405adb78a6bf6
child 13356 a4701bc3fc6efd9dcf9d676cb0c5688e1b185fc9
push idunknown
push userunknown
push dateunknown
milestone1.9b5pre
relanding with a function returning early to test impact on Linux Txul
browser/base/content/browser.js
browser/base/content/browser.xul
browser/components/nsBrowserGlue.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -4605,16 +4605,17 @@ var gHomeButton = {
       url = configBundle.GetStringFromName(this.prefDomain);
     }
 
     return url;
   },
 
   updatePersonalToolbarStyle: function (homeButton)
   {
+return; // xxxmpc temp hack for perf testing
     if (!homeButton)
       homeButton = document.getElementById("home-button");
     if (homeButton)
       homeButton.className = homeButton.parentNode.id == "PersonalToolbar"
                                || homeButton.parentNode.parentNode.id == "PersonalToolbar" ?
                              homeButton.className.replace("toolbarbutton-1", "bookmark-item") :
                              homeButton.className.replace("bookmark-item", "toolbarbutton-1");
   }
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -286,17 +286,17 @@
                      command="Browser:Reload"
                      tooltiptext="&reloadButton.tooltip;"/>
 
       <toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      label="&stopCmd.label;"
                      command="Browser:Stop"
                      tooltiptext="&stopButton.tooltip;"/>
 
-      <toolbarbutton id="home-button" class="bookmark-item chromeclass-toolbar-additional"
+      <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
                      persist="class"
                      label="&homeButton.label;"
                      ondragover="nsDragAndDrop.dragOver(event, homeButtonObserver);"
                      ondragdrop="nsDragAndDrop.drop(event, homeButtonObserver);"
                      ondragexit="nsDragAndDrop.dragExit(event, homeButtonObserver);"
                      onclick="BrowserGoHome(event);"/>
 
       <toolbaritem id="urlbar-container" align="center" flex="400" persist="width"
@@ -446,19 +446,19 @@
 
     </toolbarpalette>
 
     <toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
              toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
              fullscreentoolbar="true" mode="icons" iconsize="large"
              customizable="true"
 #ifdef XP_MACOSX
-             defaultset="unified-back-forward-button,reload-button,stop-button,urlbar-container,search-container,throbber-box"
+             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,throbber-box"
 #else
-             defaultset="unified-back-forward-button,reload-button,stop-button,urlbar-container,search-container,fullscreenflex,window-controls"
+             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls"
 #endif
              context="toolbar-context-menu">
 #ifndef XP_MACOSX
       <hbox id="fullscreenflex" flex="1" hidden="true" fullscreencontrol="true"/>
       <hbox id="window-controls" hidden="true" fullscreencontrol="true">
         <toolbarbutton id="minimize-button" class="toolbarbutton-1"
                        tooltiptext="&fullScreenMinimize.tooltip;"
                        oncommand="window.minimize();"/>
@@ -475,17 +475,17 @@
     </toolbar>
 
     <toolbarset id="customToolbars" context="toolbar-context-menu"/>
 
     <toolbar id="PersonalToolbar"
              mode="icons" iconsize="small" defaulticonsize="small"
              class="chromeclass-directories"
              context="toolbar-context-menu"
-             defaultset="home-button,personal-bookmarks"
+             defaultset="personal-bookmarks"
              toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
              customizable="true"/>
   </toolbox>
 
   <hbox flex="1" id="browser">
     <vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
       <sidebarheader align="center">
         <label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -498,59 +498,22 @@ BrowserGlue.prototype = {
       // this code should always migrate pre-FF3 profiles to the current UI state
 
       // grab the localstore.rdf and make changes needed for new UI
       this._rdf = Cc["@mozilla.org/rdf/rdf-service;1"].getService(Ci.nsIRDFService);
       this._dataSource = this._rdf.GetDataSource("rdf:local-store");
       this._dirty = false;
 
       var currentSet = this._rdf.GetResource("currentset");
-      var collapsed = this._rdf.GetResource("collapsed");
-      var target;
-      var moveHome;
-      var homePattern = /(?:^|,)home-button(?:$|,)/;
-
-      // get an nsIRDFResource for the PersonalToolbar item
-      var personalBar = this._rdf.GetResource("chrome://browser/content/browser.xul#PersonalToolbar");
-      var personalBarCollapsed = this._getPersist(personalBar, collapsed) == "true";
 
       // get an nsIRDFResource for the nav-bar item
       var navBar = this._rdf.GetResource("chrome://browser/content/browser.xul#nav-bar");
-      target = this._getPersist(navBar, currentSet);
-      if (target) {
-        let originalTarget = target;
-
-        // move Home if we find it in the nav-bar and the personal toolbar isn't collapsed
-        if (!personalBarCollapsed)
-          target = target.replace(homePattern, ",");
-        moveHome = (target != originalTarget);
-
-        // add the new combined back and forward button
-        if (!/(?:^|,)unified-back-forward-button(?:$|,)/.test(target))
-          target = "unified-back-forward-button," + target;
-
-        if (target != originalTarget)
-          this._setPersist(navBar, currentSet, target);
-      } else {
-        // nav-bar doesn't have a currentset, so the defaultset will be used,
-        // which means Home will be moved
-        moveHome = true;
-      }
-
-      if (moveHome) {
-        // If the personal toolbar has a currentset, add Home. The defaultset will be
-        // used otherwise.
-        target = this._getPersist(personalBar, currentSet);
-        if (target && !homePattern.test(target))
-          this._setPersist(personalBar, currentSet, "home-button," + target);
-
-        // uncollapse the personal toolbar
-        if (personalBarCollapsed)
-          this._setPersist(personalBar, collapsed, "false");
-      }
+      var target = this._getPersist(navBar, currentSet);
+      if (target && !/(?:^|,)unified-back-forward-button(?:$|,)/.test(target))
+        this._setPersist(navBar, currentSet, "unified-back-forward-button," + target);
 
       // force the RDF to be saved
       if (this._dirty)
         this._dataSource.QueryInterface(Ci.nsIRDFRemoteDataSource).Flush();
 
       // free up the RDF service
       this._rdf = null;
       this._dataSource = null;