[Pkg-mozext-commits] [tabmixplus] 19/26: Follow up bug 931891 - Backout the patch for bug 887515 and its dependencies from Firefox. (changesets 327cae1f5d0c, 0c0d907124f8, bd53dd74812b, ea5b7fe95496, 3ef10536a3b1, 68f3afe9cb42, f115835d4de6, 1158b66c8821)

David Prévot taffit at moszumanska.debian.org
Fri Mar 25 21:56:16 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag 0.4.2.3pre.160319a1
in repository tabmixplus.

commit 87aab07b461a2e6c04a57711fd07a9449e1d7507
Author: onemen <tabmix.onemen at gmail.com>
Date:   Sun Mar 13 17:16:55 2016 +0200

    Follow up bug 931891 - Backout the patch for bug 887515 and its dependencies from Firefox. (changesets 327cae1f5d0c, 0c0d907124f8, bd53dd74812b, ea5b7fe95496, 3ef10536a3b1, 68f3afe9cb42, f115835d4de6, 1158b66c8821)
---
 chrome/content/click/click.js          | 12 --------
 chrome/content/links/setup.js          | 10 -------
 chrome/content/minit/tablib.js         | 54 ----------------------------------
 chrome/content/session/sessionStore.js | 36 +++++------------------
 chrome/content/tabmix.js               |  2 --
 5 files changed, 7 insertions(+), 107 deletions(-)

diff --git a/chrome/content/click/click.js b/chrome/content/click/click.js
index 7c6d012..f90facd 100644
--- a/chrome/content/click/click.js
+++ b/chrome/content/click/click.js
@@ -349,13 +349,6 @@ var TabmixContext = {
     if ("cookiepieContextMenu" in window && !cookiepieContextMenu.initialized)
       cookiepieContextMenu.init();
 
-    if (Tabmix._restoreMultipleTabs) {
-      let multipletablabel = $id("context_undoCloseTab").getAttribute("multipletablabel");
-      let undoCloseTabMenu = $id("tm-content-undoCloseTab");
-      undoCloseTabMenu.setAttribute("singletablabel", undoCloseTabMenu.label);
-      undoCloseTabMenu.setAttribute("multipletablabel", multipletablabel);
-    }
-
     if (Tabmix.prefs.getBoolPref("showTabContextMenuOnTabbar"))
       this.updateTabbarContextMenu(true);
 
@@ -683,11 +676,6 @@ var TabmixContext = {
       Tabmix.showItem(undoCloseTabMenu, !contentClick &&
           !gContextMenu.isTextSelected && undoClose && !closeTabsEmpty &&
           Tabmix.prefs.getBoolPref("undoCloseTabContent"));
-      if (Tabmix._restoreMultipleTabs) {
-        let closedTabCount = TabmixSvc.ss.getNumberOfTabsClosedLast(window);
-        let visibleLabel = closedTabCount <= 1 ? "singletablabel" : "multipletablabel";
-        undoCloseTabMenu.setAttribute("label", undoCloseTabMenu.getAttribute(visibleLabel));
-      }
 
       var undoCloseListMenu = document.getElementById("tm-content-undoCloseList");
       Tabmix.showItem(undoCloseListMenu, !contentClick &&
diff --git a/chrome/content/links/setup.js b/chrome/content/links/setup.js
index 64a0696..97e9628 100644
--- a/chrome/content/links/setup.js
+++ b/chrome/content/links/setup.js
@@ -361,13 +361,3 @@ Tabmix.adjustTabstrip = function tabContainer_adjustTabstrip(skipUpdateScrollSta
     TabmixTabbar.updateBeforeAndAfter();
   }
 };
-
-/**
- bug 887515 - add ability to restore multiple tabs
- bug 914258 backout 887515 changes from Firefox 25
- bug 931891 backout 887515 changes from Firefox 26-29
-*/
-XPCOMUtils.defineLazyGetter(Tabmix, "_restoreMultipleTabs", function() {
-  return this.isVersion(290) &&
-         typeof TabmixSvc.ss.setNumberOfTabsClosedLast == "function";
-});
diff --git a/chrome/content/minit/tablib.js b/chrome/content/minit/tablib.js
index 90c8801..66ad3a5 100644
--- a/chrome/content/minit/tablib.js
+++ b/chrome/content/minit/tablib.js
@@ -344,20 +344,6 @@ var tablib = { // eslint-disable-line
       'if (!aShow || TabmixTabbar.hideMode != 2) $&'
     ).toCode();
 
-    // Follow up bug 887515 - add ability to restore multiple tabs
-    // bug 914258 backout 887515 changes from Firefox 25
-    if (Tabmix._restoreMultipleTabs) {
-      Tabmix.changeCode(gBrowser, "gBrowser.removeTabsToTheEndFrom")._replace(
-        'let tabs = this.getTabsToTheEndFrom(aTab);',
-        '$&\n' +
-        '              Tabmix.startCountingClosedTabs();'
-      )._replace(
-        '#1.setNumberOfTabsClosedLast(window, numberOfTabsToClose);'.
-         replace("#1", Tabmix.isVersion(260) ? "SessionStore" : "ss"),
-        'Tabmix.setNumberOfTabsClosedLast();'
-      ).toCode();
-    }
-
     if (Tabmix.isVersion(390) && gMultiProcessBrowser) {
       /*
        TabSwitchDone event fire late when the tab is busy, we call our
@@ -1144,12 +1130,10 @@ var tablib = { // eslint-disable-line
         // remove current tab last
         if (!this.mCurrentTab.pinned)
           tabs.unshift(tabs.splice(tabs.indexOf(this.mCurrentTab), 1)[0]);
-        Tabmix.startCountingClosedTabs();
         tabs.reverse().forEach(function TMP_removeTab(tab) {
           if (!tab.pinned)
             this.removeTab(tab, {animate: false});
         }, this);
-        Tabmix.setNumberOfTabsClosedLast();
         // _handleTabSelect will call mTabstrip.ensureElementIsVisible
       }
     };
@@ -1164,7 +1148,6 @@ var tablib = { // eslint-disable-line
 
       if (this.warnAboutClosingTabs(this.closingTabsEnum.GROUP, null, aDomain)) {
         var childNodes = this.visibleTabs;
-        Tabmix.startCountingClosedTabs();
         for (var i = childNodes.length - 1; i > -1; --i) {
           if (childNodes[i] != aTab && !childNodes[i].pinned &&
               this.getBrowserForTab(childNodes[i]).currentURI.spec.indexOf(aDomain) != -1)
@@ -1174,7 +1157,6 @@ var tablib = { // eslint-disable-line
           this.removeTab(aTab, {animate: true});
           this.ensureTabIsVisible(this.selectedTab);
         }
-        Tabmix.setNumberOfTabsClosedLast();
       }
     };
 
@@ -1202,12 +1184,10 @@ var tablib = { // eslint-disable-line
 
         let childNodes = this.visibleTabs;
         let tabPos = childNodes.indexOf(aTab);
-        Tabmix.startCountingClosedTabs();
         for (let i = childNodes.length - 1; i > tabPos; i--) {
           if (!childNodes[i].pinned)
             this.removeTab(childNodes[i]);
         }
-        Tabmix.setNumberOfTabsClosedLast();
       }
     };
 
@@ -1223,12 +1203,10 @@ var tablib = { // eslint-disable-line
 
         let childNodes = this.visibleTabs;
         let tabPos = childNodes.indexOf(aTab);
-        Tabmix.startCountingClosedTabs();
         for (let i = tabPos - 1; i >= 0; i--) {
           if (!childNodes[i].pinned)
             this.removeTab(childNodes[i]);
         }
-        Tabmix.setNumberOfTabsClosedLast();
       }
     };
 
@@ -1243,12 +1221,10 @@ var tablib = { // eslint-disable-line
         var childNodes = this.visibleTabs;
         if (TabmixTabbar.visibleRows > 1)
           Tabmix.tabsUtils.updateVerticalTabStrip(true);
-        Tabmix.startCountingClosedTabs();
         for (var i = childNodes.length - 1; i >= 0; --i) {
           if (childNodes[i] != aTab && !childNodes[i].pinned)
             this.removeTab(childNodes[i]);
         }
-        Tabmix.setNumberOfTabsClosedLast();
       }
     });
 
@@ -1714,36 +1690,6 @@ var tablib = { // eslint-disable-line
         this.tabContainer.mTabstrip.ensureElementIsVisible(aTab, aSmoothScroll);
     };
 
-    // Follow up bug 887515 - add ability to restore multiple tabs
-    // bug 914258 backout 887515 changes from Firefox 25
-    if (Tabmix._restoreMultipleTabs) {
-      Tabmix.startCountingClosedTabs = function() {
-        this.shouldCountClosedTabs = true;
-        this.numberOfTabsClosedLast = 0;
-      };
-      Tabmix.setNumberOfTabsClosedLast = function(aNum) {
-        TabmixSvc.ss.setNumberOfTabsClosedLast(window, aNum || this.numberOfTabsClosedLast);
-        this.shouldCountClosedTabs = false;
-        this.numberOfTabsClosedLast = 0;
-      };
-      Tabmix.countClosedTabs = function(aTab) {
-        if (!this.shouldCountClosedTabs ||
-            Services.prefs.getIntPref("browser.sessionstore.max_tabs_undo") === 0)
-          return;
-        var tabState = TabmixSvc.JSON.parse(TabmixSvc.ss.getTabState(aTab));
-        if (!tabState.entries || tabState.entries.length == 1 &&
-           (tabState.entries[0].url == TabmixSvc.aboutBlank ||
-            tabState.entries[0].url == TabmixSvc.aboutNewtab) &&
-            !tabState.userTypedValue)
-          return;
-        this.numberOfTabsClosedLast++;
-      };
-    } else {
-      Tabmix.startCountingClosedTabs = function() { };
-      Tabmix.setNumberOfTabsClosedLast = function() { };
-      Tabmix.countClosedTabs = function() { };
-    }
-
     /** DEPRECATED **/
     // we keep this function to saty compatible with other extensions that use it
     gBrowser.undoRemoveTab = () => TMP_ClosedTabs.undoCloseTab();
diff --git a/chrome/content/session/sessionStore.js b/chrome/content/session/sessionStore.js
index 4e726e6..fc27e80 100644
--- a/chrome/content/session/sessionStore.js
+++ b/chrome/content/session/sessionStore.js
@@ -468,7 +468,7 @@ var TMP_ClosedTabs = { // jshint ignore:line
           this.removeAllClosedTabs();
           break;
         } else if (aIndex == -2) {
-          this.SSS_restoerClosedTabs(this.count);
+          this.SSS_restoerAllClosedTabs();
           break;
         }
         // else do the default
@@ -476,9 +476,6 @@ var TMP_ClosedTabs = { // jshint ignore:line
       default:
         this.SSS_undoCloseTab(aIndex, aWhere, true);
     }
-
-    // Reset the number of tabs closed last time to the default.
-    Tabmix.setNumberOfTabsClosedLast(1);
   },
 
   removeAllClosedTabs: function() {
@@ -516,9 +513,10 @@ var TMP_ClosedTabs = { // jshint ignore:line
     return gBrowser.duplicateTabToWindow(gBrowser.mCurrentTab, null, state);
   },
 
-  SSS_restoerClosedTabs: function ct_SSS_restoerClosedTabs(closedTabCount) {
+  SSS_restoerAllClosedTabs: function ct_SSS_restoerAllClosedTabs() {
+    var closedTabCount = this.count;
     if (!PlacesUIUtils._confirmOpenInTabs(closedTabCount))
-      return null;
+      return;
 
     this.setButtonDisableState(true);
 
@@ -529,10 +527,10 @@ var TMP_ClosedTabs = { // jshint ignore:line
         blankTabs.push(gBrowser.tabs[i]);
     }
 
-    var tab, multiple = closedTabCount > 1;
+    var multiple = closedTabCount > 1;
     for (let i = 0; i < closedTabCount; i++) {
       let blankTab = blankTabs.pop() || null;
-      tab = this.SSS_undoCloseTab(0, "original", i === 0, blankTab, multiple);
+      this.SSS_undoCloseTab(0, "original", i === 0, blankTab, multiple);
     }
 
     // remove unused blank tabs
@@ -541,8 +539,6 @@ var TMP_ClosedTabs = { // jshint ignore:line
       blankTab.collapsed = true;
       gBrowser.removeTab(blankTab);
     }
-
-    return tab;
   },
 
   SSS_undoCloseTab: function(aIndex, aWhere, aSelectRestoredTab, aBlankTabToReuse, skipAnimation) {
@@ -603,29 +599,11 @@ var TMP_ClosedTabs = { // jshint ignore:line
       window.focus();
       gBrowser.TMP_selectNewForegroundTab(newTab, false, null, false);
     }
-
     return newTab;
   },
 
   undoCloseTab: function ct_undoCloseTab(aIndex, aWhere) {
-    let numberOfTabsToUndoClose = 1;
-    let index = Number(aIndex);
-    if (isNaN(index)) {
-      index = 0;
-      if (Tabmix._restoreMultipleTabs)
-        numberOfTabsToUndoClose = TabmixSvc.ss.getNumberOfTabsClosedLast(window);
-    } else if (index < 0 || index >= this.count)
-      return null;
-
-    let tab = null;
-    if (numberOfTabsToUndoClose > 1)
-      tab = this.SSS_restoerClosedTabs(numberOfTabsToUndoClose);
-    else
-      tab = this.SSS_undoCloseTab(index, aWhere || "original", true);
-
-    // Reset the number of tabs closed last time to the default.
-    Tabmix.setNumberOfTabsClosedLast(1);
-    return tab;
+    return this.SSS_undoCloseTab(aIndex || 0, aWhere || "original", true);
   }
 
 };
diff --git a/chrome/content/tabmix.js b/chrome/content/tabmix.js
index e0eb546..6d30226 100644
--- a/chrome/content/tabmix.js
+++ b/chrome/content/tabmix.js
@@ -840,8 +840,6 @@ var TMP_eventListener = {
     if (updateNow)
       this.onTabClose_updateTabBar(tab);
 
-    Tabmix.countClosedTabs(tab);
-
     if (Tabmix.selectedTab == tab) {
       Tabmix.selectedTab = null;
       Tabmix.userTypedValue = "";

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git



More information about the Pkg-mozext-commits mailing list