Bug 1607023 - Remove dead GroupBookmark code. r=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Mon, 06 Jan 2020 19:29:43 +0100
changeset 37197 92b874862cac354aa75a862a6198934b0010d9b4
parent 37196 8fb15a65ede6fcb26558a71f8f5416640a40cff0
child 37198 c1d7e03fd0d5972326caaaec47939dbec019e03a
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg
bugs1607023
Bug 1607023 - Remove dead GroupBookmark code. r=frg
suite/app/profile/suite-prefs.js
suite/browser/navigator.js
suite/browser/tabbrowser.xml
suite/components/pref/content/pref-tabs.xul
suite/locales/en-US/chrome/common/help/cs_nav_prefs_navigator.xhtml
suite/locales/en-US/chrome/common/pref/pref-tabs.dtd
--- a/suite/app/profile/suite-prefs.js
+++ b/suite/app/profile/suite-prefs.js
@@ -233,18 +233,16 @@ pref("browser.tabs.autoHide", true);
 pref("browser.tabs.forceHide", false);
 pref("browser.tabs.closeWindowWithLastTab", true);
 pref("browser.tabs.warnOnClose", true);
 pref("browser.tabs.warnOnCloseOther", true);
 pref("browser.tabs.warnOnOpen", true);
 pref("browser.tabs.maxOpenBeforeWarn", 15);
 pref("browser.tabs.insertRelatedAfterCurrent", true);
 pref("browser.tabs.insertAllTabsAfterCurrent", false);
-// 0 = append, 1 = replace
-pref("browser.tabs.loadGroup", 1);
 
 // For future use
 pref("browser.tabs.loadBookmarksInBackground", false);
 
 // No e10s in SeaMonkey for now.
 pref("browser.tabs.remote.autostart", false);
 
 // how many browsers can be saved in the DOM (by the tabbed browser)
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -1401,45 +1401,23 @@ function BrowserHandleShiftBackspace()
       BrowserForward();
       break;
     case 1:
       goDoCommand("cmd_scrollPageDown");
       break;
   }
 }
 
-function SetGroupHistory(popupMenu, direction)
-{
-  while (popupMenu.hasChildNodes())
-    popupMenu.lastChild.remove();
-
-  var menuItem = document.createElementNS(XUL_NS, "menuitem");
-  var label = gNavigatorBundle.getString("tabs.historyItem");
-  menuItem.setAttribute("label", label);
-  menuItem.setAttribute("index", direction);
-  popupMenu.appendChild(menuItem);
-}
-
 function BrowserBackMenu(event)
 {
-  if (gBrowser.backBrowserGroup.length != 0) {
-    SetGroupHistory(event.target, "back");
-    return true;
-  }
-
   return FillHistoryMenu(event.target, "back");
 }
 
 function BrowserForwardMenu(event)
 {
-  if (gBrowser.forwardBrowserGroup.length != 0) {
-    SetGroupHistory(event.target, "forward");
-    return true;
-  }
-
   return FillHistoryMenu(event.target, "forward");
 }
 
 function BrowserStop()
 {
   try {
     const stopFlags = nsIWebNavigation.STOP_ALL;
     getWebNavigation().stop(stopFlags);
--- a/suite/browser/tabbrowser.xml
+++ b/suite/browser/tabbrowser.xml
@@ -2605,142 +2605,37 @@
             var tabPos = this.tabContainer.selectedIndex;
             if (tabPos < this.browsers.length - 1) {
               this.moveTabTo(tabPos, this.browsers.length - 1);
             }
           ]]>
         </body>
       </method>
 
-      <field name="backBrowserGroup">
-        []
-      </field>
-
-      <field name="forwardBrowserGroup">
-        []
-      </field>
-
-      <method name="replaceGroup">
-        <parameter name="aGroup"/>
-        <body>
-        <![CDATA[
-          var oldBrowserGroup = [];
-          var oldCount = this.tabs.length;
-          var newCount = aGroup.length;
-          var n = Math.max(oldCount, newCount);
-          for (var i = 0; i < n; ++i) {
-            if (i < newCount) {
-              var data = aGroup[i];
-              if ("sessionHistory" in data) {
-                this.addTab("about:blank", null);
-                var browser = this.tabContainer.lastChild.linkedBrowser;
-                // need to hold on to the listener so it won't go away
-                // addProgressListener only has a weak pointer to it
-                browser._SHListener =
-                    this.mInstallSH(browser, aGroup[i].sessionHistory);
-                browser.webProgress.addProgressListener(browser._SHListener, Ci.nsIWebProgress.NOTIFY_ALL);
-              } else {
-                var referrerURI = "referrerURI" in data ? data.referrerURI : null;
-                this.addTab(data.URI, referrerURI);
-              }
-            }
-            if (i < oldCount) {
-              var firstTab = this.tabContainer.firstChild;
-              var browserData = {
-                sessionHistory : firstTab.linkedBrowser.sessionHistory
-              }
-              oldBrowserGroup.push(browserData);
-              this.removeTab(firstTab, { disableUndo: true });
-            }
-          }
-          return oldBrowserGroup;
-        ]]>
-        </body>
-      </method>
-
-      <method name="appendGroup">
-        <parameter name="aGroup"/>
-        <body>
-        <![CDATA[
-          for (var i in aGroup) {
-            var page = aGroup[i];
-            var referrerURI = "referrerURI" in page ? page.referrerURI : null;
-            this.addTab(page.URI, referrerURI);
-          }
-        ]]>
-        </body>
-      </method>
-
-      <method name="loadGroup">
-        <parameter name="aGroup"/>
-        <body>
-        <![CDATA[
-          if (aGroup.length == 0)
-            return null;
-
-          var tab;
-          if (Services.prefs.getIntPref("browser.tabs.loadGroup") == 0) {
-            var oldCount = this.tabs.length;
-            this.appendGroup(aGroup);
-            tab = this.tabs[oldCount];
-          } else {
-            this.backBrowserGroup = this.replaceGroup(aGroup);
-            this.forwardBrowserGroup = [];
-            tab = this.tabContainer.firstChild;
-          }
-          return tab;
-        ]]>
-        </body>
-      </method>
-
-      <method name="goBackGroup">
-        <body>
-        <![CDATA[
-          this.forwardBrowserGroup = this.replaceGroup(this.backBrowserGroup);
-          this.backBrowserGroup = [];
-        ]]>
-        </body>
-      </method>
-
-      <method name="goForwardGroup">
-        <body>
-        <![CDATA[
-          this.backBrowserGroup = this.replaceGroup(this.forwardBrowserGroup);
-          this.forwardBrowserGroup = [];
-        ]]>
-        </body>
-      </method>
-
       <!-- BEGIN FORWARDED BROWSER PROPERTIES.  IF YOU ADD A PROPERTY TO THE BROWSER ELEMENT
            MAKE SURE TO ADD IT HERE AS WELL. -->
       <property name="canGoBack"
-                onget="return this.backBrowserGroup.length != 0 || this.mCurrentBrowser.canGoBack;"
+                onget="return this.mCurrentBrowser.canGoBack;"
                 readonly="true"/>
 
       <property name="canGoForward"
-                onget="return this.forwardBrowserGroup.length != 0 || this.mCurrentBrowser.canGoForward;"
+                onget="return this.mCurrentBrowser.canGoForward;"
                 readonly="true"/>
 
       <method name="goBack">
         <body>
           <![CDATA[
-            if (this.backBrowserGroup.length != 0)
-              return this.goBackGroup();
-
             return this.mCurrentBrowser.goBack();
           ]]>
         </body>
       </method>
 
       <method name="goForward">
         <body>
           <![CDATA[
-            if (this.forwardBrowserGroup.length != 0)
-              return this.goForwardGroup();
-
             return this.mCurrentBrowser.goForward();
           ]]>
         </body>
       </method>
 
       <method name="reload">
         <body>
           <![CDATA[
--- a/suite/components/pref/content/pref-tabs.xul
+++ b/suite/components/pref/content/pref-tabs.xul
@@ -24,19 +24,16 @@
                   type="bool"
                   inverted="true"/>
       <preference id="browser.tabs.warnOnClose"
                   name="browser.tabs.warnOnClose"
                   type="bool"/>
       <preference id="browser.tabs.insertRelatedAfterCurrent"
                   name="browser.tabs.insertRelatedAfterCurrent"
                   type="bool"/>
-      <preference id="browser.tabs.loadGroup"
-                  name="browser.tabs.loadGroup"
-                  type="int"/>
       <preference id="browser.tabs.opentabfor.middleclick"
                   name="browser.tabs.opentabfor.middleclick"
                   type="bool"/>
       <preference id="browser.tabs.opentabfor.urlbar"
                   name="browser.tabs.opentabfor.urlbar"
                   type="bool"/>
       <preference id="suite.manager.dataman.openAsDialog"
                   name="suite.manager.dataman.openAsDialog"
@@ -63,30 +60,16 @@
                   accesskey="&warnOnClose.accesskey;"
                   preference="browser.tabs.warnOnClose"/>
         <checkbox id="tabRelatedAfterCurrent"
                   label="&relatedAfterCurrent.label;"
                   accesskey="&relatedAfterCurrent.accesskey;"
                   preference="browser.tabs.insertRelatedAfterCurrent"/>
       </groupbox>
 
-      <groupbox id="loadGroupPreferences" align="start">
-        <caption label="&loadGroup.label;"/>
-        <radiogroup id="loadGroup"
-                    orient="horizontal"
-                    preference="browser.tabs.loadGroup">
-          <radio value="0"
-                 label="&loadGroupAppend.label;"
-                 accesskey="&loadGroupAppend.accesskey;"/>
-          <radio value="1"
-                 label="&loadGroupReplace.label;"
-                 accesskey="&loadGroupReplace.accesskey;"/>
-        </radiogroup>
-      </groupbox>
-
       <groupbox id="useTabPreferences" align="start">
         <caption label="&openTabs.label;"/>
           <checkbox id="middleClick"
                     label="&middleClick.label;"
                     accesskey="&middleClick.accesskey;"
                     preference="browser.tabs.opentabfor.middleclick"/>
           <checkbox id="urlBar"
                     label="&urlbar.label;"
--- a/suite/locales/en-US/chrome/common/help/cs_nav_prefs_navigator.xhtml
+++ b/suite/locales/en-US/chrome/common/help/cs_nav_prefs_navigator.xhtml
@@ -471,24 +471,16 @@
         Select this to make &brandShortName; warn you when you try to close a
         browser window which has multiple tabs open in it.</li>
       <li><strong>Open related tabs after current tab</strong>:
         Select this to make new tabs open next to the tab from which they have
         been opened. When unchecked, new tabs open after the last tab on the
         tab bar.</li>
     </ul>
   </li>
-  <li><strong>When opening a bookmark group</strong>:
-    <ul>
-      <li><strong>Add tabs</strong>: Select this if you want a bookmark group
-        to be opened in new tabs.</li>
-      <li><strong>Replace existing tabs</strong>: Select this if you want a
-        bookmark group to replace your existing tabs.</li>
-    </ul>
-  </li>
   <li><strong>Open tabs instead of windows for</strong>:
     <ul>
       <li><strong><span class="mac"><kbd>Cmd</kbd>+click or
         <kbd>Cmd</kbd>+<kbd>Return</kbd></span>
         <span class="noMac">Middle-click, <kbd>Ctrl</kbd>+click or
         <kbd>Ctrl</kbd>+<kbd>Enter</kbd> on links in a Web
         page</span></strong>: Select this to open Web page links in a new tab
         when clicking a link <span class="mac">and holding down the
--- a/suite/locales/en-US/chrome/common/pref/pref-tabs.dtd
+++ b/suite/locales/en-US/chrome/common/pref/pref-tabs.dtd
@@ -9,21 +9,15 @@
 <!ENTITY autoHide.accesskey2 "e">
 <!ENTITY background.label "Switch to new tabs opened from links">
 <!ENTITY background.accesskey "S">
 <!ENTITY warnOnClose.label "Warn me when closing a window with multiple tabs">
 <!ENTITY warnOnClose.accesskey "W">
 <!ENTITY relatedAfterCurrent.label "Open related tabs after current tab">
 <!ENTITY relatedAfterCurrent.accesskey "O">
 
-<!ENTITY loadGroup.label "When opening a bookmark group">
-<!ENTITY loadGroupAppend.label "Add tabs">
-<!ENTITY loadGroupAppend.accesskey "A">
-<!ENTITY loadGroupReplace.label "Replace existing tabs">
-<!ENTITY loadGroupReplace.accesskey "R">
-
 <!ENTITY openTabs.label "Open tabs instead of windows for">
 
 <!ENTITY openManagers.label "Open in a new tab instead of a stand-alone window">
 <!ENTITY openDataManager.label "Data Manager">
 <!ENTITY openDataManager.accesskey "D">
 <!ENTITY openAddOnsManager.label "Add-ons Manager">
 <!ENTITY openAddOnsManager.accesskey "n">