Bug 1222490 - part 2: remove traces of tabview from XUL/XBL/JS in other parts of browser/, r=ttaubert
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 01 Dec 2015 10:48:11 +0000
changeset 309117 29c12e8bf172db76c88090912d1204acf42ddb64
parent 309116 35b7fa5ebd585c2bee84c6e504cb693d44d6b150
child 309118 19faee4224fbd93b2872cb46e9134604e7e5991f
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1222490
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1222490 - part 2: remove traces of tabview from XUL/XBL/JS in other parts of browser/, r=ttaubert
browser/base/content/browser-sets.inc
browser/base/content/browser-tabview.js
browser/base/content/browser.js
browser/base/content/browser.xul
browser/base/content/chatWindow.xul
browser/base/content/tabbrowser.xml
browser/base/jar.mn
browser/components/sessionstore/SessionMigration.jsm
browser/components/sessionstore/SessionStore.jsm
browser/modules/BrowserUITelemetry.jsm
browser/modules/WindowsPreviewPerTab.jsm
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -77,17 +77,16 @@
       <observes element="Browser:Reload" attribute="disabled"/>
     </command>
     <command id="Browser:ReloadSkipCache" oncommand="BrowserReloadSkipCache()" disabled="true">
       <observes element="Browser:Reload" attribute="disabled"/>
     </command>
     <command id="Browser:NextTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(1, true);" reserved="true"/>
     <command id="Browser:PrevTab" oncommand="gBrowser.tabContainer.advanceSelectedTab(-1, true);" reserved="true"/>
     <command id="Browser:ShowAllTabs" oncommand="allTabs.open();"/>
-    <command id="Browser:ToggleTabView" oncommand="TabView.toggle();"/>
     <command id="cmd_fullZoomReduce"  oncommand="FullZoom.reduce()"/>
     <command id="cmd_fullZoomEnlarge" oncommand="FullZoom.enlarge()"/>
     <command id="cmd_fullZoomReset"   oncommand="FullZoom.reset()"/>
     <command id="cmd_fullZoomToggle"  oncommand="ZoomManager.toggleZoom();"/>
     <command id="cmd_gestureRotateLeft" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
     <command id="cmd_gestureRotateRight" oncommand="gGestureSupport.rotate(event.sourceEvent)"/>
     <command id="cmd_gestureRotateEnd" oncommand="gGestureSupport.rotateEnd()"/>
     <command id="Browser:OpenLocation" oncommand="openLocation();"/>
@@ -173,17 +172,16 @@
                  type="checkbox"
                  oncommand="gPopupBlockerObserver.dontShowMessage();"/>
     <broadcaster id="blockedPopupsSeparator"/>
     <broadcaster id="isImage"/>
     <broadcaster id="canViewSource"/>
     <broadcaster id="isFrameImage"/>
     <broadcaster id="singleFeedMenuitemState" disabled="true"/>
     <broadcaster id="multipleFeedsMenuState" hidden="true"/>
-    <broadcaster id="tabviewGroupsNumber" groups="1"/>
     <broadcaster id="sync-setup-state"/>
     <broadcaster id="sync-syncnow-state" hidden="true"/>
     <broadcaster id="sync-reauth-state" hidden="true"/>
     <broadcaster id="workOfflineMenuitemState"/>
     <broadcaster id="socialSidebarBroadcaster" hidden="true"/>
 
     <!-- DevTools broadcasters -->
     <broadcaster id="devtoolsMenuBroadcaster_DevToolbox"
@@ -423,18 +421,16 @@
     <key                          key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key id="key_fullZoomReset"   key="&fullZoomResetCmd.commandkey;"    command="cmd_fullZoomReset"   modifiers="accel"/>
     <key                          key="&fullZoomResetCmd.commandkey2;"   command="cmd_fullZoomReset"   modifiers="accel"/>
 
     <key id="key_showAllTabs" command="Browser:ShowAllTabs" keycode="VK_TAB" modifiers="control,shift"/>
 
     <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
 
-    <key id="key_tabview" key="&tabView.commandkey;" command="Browser:ToggleTabView" modifiers="accel,shift"/>
-
     <key id="key_privatebrowsing" command="Tools:PrivateBrowsing" key="&privateBrowsingCmd.commandkey;" modifiers="accel,shift"/>
     <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
 #ifdef XP_MACOSX
     <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
     <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" modifiers="accel"/>
 #elifdef XP_UNIX
     <key id="key_quitApplication" key="&quitApplicationCmdUnix.key;" command="cmd_quitApplication" modifiers="accel"/>
 #endif
deleted file mode 100644
--- a/browser/base/content/browser-tabview.js
+++ /dev/null
@@ -1,490 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var TabView = {
-  _deck: null,
-  _iframe: null,
-  _window: null,
-  _initialized: false,
-  _browserKeyHandlerInitialized: false,
-  _closedLastVisibleTabBeforeFrameInitialized: false,
-  _isFrameLoading: false,
-  _initFrameCallbacks: [],
-  PREF_BRANCH: "browser.panorama.",
-  PREF_FIRST_RUN: "browser.panorama.experienced_first_run",
-  PREF_STARTUP_PAGE: "browser.startup.page",
-  PREF_RESTORE_ENABLED_ONCE: "browser.panorama.session_restore_enabled_once",
-  GROUPS_IDENTIFIER: "tabview-groups",
-  VISIBILITY_IDENTIFIER: "tabview-visibility",
-
-  // ----------
-  get windowTitle() {
-    delete this.windowTitle;
-    let brandBundle = document.getElementById("bundle_brand");
-    let brandShortName = brandBundle.getString("brandShortName");
-    let title = gNavigatorBundle.getFormattedString("tabview.title", [brandShortName]);
-    return this.windowTitle = title;
-  },
-
-  // ----------
-  get firstUseExperienced() {
-    let pref = this.PREF_FIRST_RUN;
-    if (Services.prefs.prefHasUserValue(pref))
-      return Services.prefs.getBoolPref(pref);
-
-    return false;
-  },
-
-  // ----------
-  set firstUseExperienced(val) {
-    Services.prefs.setBoolPref(this.PREF_FIRST_RUN, val);
-  },
-
-  // ----------
-  get sessionRestoreEnabledOnce() {
-    let pref = this.PREF_RESTORE_ENABLED_ONCE;
-    if (Services.prefs.prefHasUserValue(pref))
-      return Services.prefs.getBoolPref(pref);
-
-    return false;
-  },
-
-  // ----------
-  set sessionRestoreEnabledOnce(val) {
-    Services.prefs.setBoolPref(this.PREF_RESTORE_ENABLED_ONCE, val);
-  },
-
-  // ----------
-  init: function TabView_init() {
-    // disable the ToggleTabView command for popup windows
-    goSetCommandEnabled("Browser:ToggleTabView", window.toolbar.visible);
-    if (!window.toolbar.visible)
-      return;
-
-    if (this._initialized)
-      return;
-
-    if (this.firstUseExperienced) {
-      // ___ visibility
-
-      let data = SessionStore.getWindowValue(window, this.VISIBILITY_IDENTIFIER);
-      if (data && data == "true") {
-        this.show();
-      } else {
-        try {
-          data = SessionStore.getWindowValue(window, this.GROUPS_IDENTIFIER);
-          if (data) {
-            let parsedData = JSON.parse(data);
-            this.updateGroupNumberBroadcaster(parsedData.totalNumber || 1);
-          }
-        } catch (e) { }
-
-        let self = this;
-        // if a tab is changed from hidden to unhidden and the iframe is not
-        // initialized, load the iframe and setup the tab.
-        this._tabShowEventListener = function(event) {
-          if (!self._window)
-            self._initFrame(function() {
-              self._window.UI.onTabSelect(gBrowser.selectedTab);
-              if (self._closedLastVisibleTabBeforeFrameInitialized) {
-                self._closedLastVisibleTabBeforeFrameInitialized = false;
-                self._window.UI.showTabView(false);
-              }
-            });
-        };
-        this._tabCloseEventListener = function(event) {
-          if (!self._window && gBrowser.visibleTabs.length == 0)
-            self._closedLastVisibleTabBeforeFrameInitialized = true;
-        };
-        gBrowser.tabContainer.addEventListener(
-          "TabShow", this._tabShowEventListener, false);
-        gBrowser.tabContainer.addEventListener(
-          "TabClose", this._tabCloseEventListener, false);
-
-       if (this._tabBrowserHasHiddenTabs()) {
-         this._setBrowserKeyHandlers();
-       } else {
-         // for restoring last session and undoing recently closed window
-         this._SSWindowStateReadyListener = function (event) {
-           if (this._tabBrowserHasHiddenTabs())
-             this._setBrowserKeyHandlers();
-         }.bind(this);
-         window.addEventListener(
-           "SSWindowStateReady", this._SSWindowStateReadyListener, false);
-        }
-      }
-    }
-
-    Services.prefs.addObserver(this.PREF_BRANCH, this, false);
-
-    this._initialized = true;
-  },
-
-  // ----------
-  // Observes topic changes.
-  observe: function TabView_observe(subject, topic, data) {
-    if (data == this.PREF_FIRST_RUN && this.firstUseExperienced) {
-      this._addToolbarButton();
-      this.enableSessionRestore();
-    }
-  },
-
-  // ----------
-  // Uninitializes TabView.
-  uninit: function TabView_uninit() {
-    if (!this._initialized)
-      return;
-
-    Services.prefs.removeObserver(this.PREF_BRANCH, this);
-
-    if (this._tabShowEventListener)
-      gBrowser.tabContainer.removeEventListener(
-        "TabShow", this._tabShowEventListener, false);
-
-    if (this._tabCloseEventListener)
-      gBrowser.tabContainer.removeEventListener(
-        "TabClose", this._tabCloseEventListener, false);
-
-    if (this._SSWindowStateReadyListener)
-      window.removeEventListener(
-        "SSWindowStateReady", this._SSWindowStateReadyListener, false);
-
-    this._initialized = false;
-
-    if (this._window) {
-      this._window = null;
-    }
-
-    if (this._iframe) {
-      this._iframe.remove();
-      this._iframe = null;
-    }
-  },
-
-  // ----------
-  // Creates the frame and calls the callback once it's loaded. 
-  // If the frame already exists, calls the callback immediately. 
-  _initFrame: function TabView__initFrame(callback) {
-    let hasCallback = typeof callback == "function";
-
-    // prevent frame to be initialized for popup windows
-    if (!window.toolbar.visible)
-      return;
-
-    if (this._window) {
-      if (hasCallback)
-        callback();
-      return;
-    }
-
-    if (hasCallback)
-      this._initFrameCallbacks.push(callback);
-
-    if (this._isFrameLoading)
-      return;
-
-    this._isFrameLoading = true;
-
-    TelemetryStopwatch.start("PANORAMA_INITIALIZATION_TIME_MS");
-
-    // ___ find the deck
-    this._deck = document.getElementById("tab-view-deck");
-
-    // ___ create the frame
-    this._iframe = document.createElement("iframe");
-    this._iframe.id = "tab-view";
-    this._iframe.setAttribute("transparent", "true");
-    this._iframe.setAttribute("tooltip", "tab-view-tooltip");
-    this._iframe.flex = 1;
-
-    let self = this;
-
-    window.addEventListener("tabviewframeinitialized", function onInit() {
-      window.removeEventListener("tabviewframeinitialized", onInit, false);
-
-      TelemetryStopwatch.finish("PANORAMA_INITIALIZATION_TIME_MS");
-
-      self._isFrameLoading = false;
-      self._window = self._iframe.contentWindow;
-      self._setBrowserKeyHandlers();
-
-      if (self._tabShowEventListener) {
-        gBrowser.tabContainer.removeEventListener(
-          "TabShow", self._tabShowEventListener, false);
-        self._tabShowEventListener = null;
-      }
-      if (self._tabCloseEventListener) {
-        gBrowser.tabContainer.removeEventListener(
-          "TabClose", self._tabCloseEventListener, false);
-        self._tabCloseEventListener = null;
-      }
-      if (self._SSWindowStateReadyListener) {
-        window.removeEventListener(
-          "SSWindowStateReady", self._SSWindowStateReadyListener, false);
-        self._SSWindowStateReadyListener = null;
-      }
-
-      self._initFrameCallbacks.forEach(cb => cb());
-      self._initFrameCallbacks = [];
-    }, false);
-
-    this._iframe.setAttribute("src", "chrome://browser/content/tabview.html");
-    this._deck.appendChild(this._iframe);
-
-    // ___ create tooltip
-    let tooltip = document.createElement("tooltip");
-    tooltip.id = "tab-view-tooltip";
-    tooltip.setAttribute("onpopupshowing", "return TabView.fillInTooltip(document.tooltipNode);");
-    document.getElementById("mainPopupSet").appendChild(tooltip);
-  },
-
-  // ----------
-  getContentWindow: function TabView_getContentWindow() {
-    return this._window;
-  },
-
-  // ----------
-  isVisible: function TabView_isVisible() {
-    return (this._deck ? this._deck.selectedPanel == this._iframe : false);
-  },
-
-  // ----------
-  show: function TabView_show() {
-    if (this.isVisible())
-      return;
-
-    let self = this;
-    this._initFrame(function() {
-      self._window.UI.showTabView(true);
-    });
-  },
-
-  // ----------
-  hide: function TabView_hide() {
-    if (this.isVisible() && this._window) {
-      this._window.UI.exit();
-    }
-  },
-
-  // ----------
-  toggle: function TabView_toggle() {
-    if (this.isVisible())
-      this.hide();
-    else 
-      this.show();
-  },
-
-  // ----------
-  _tabBrowserHasHiddenTabs: function TabView_tabBrowserHasHiddenTabs() {
-    return (gBrowser.tabs.length - gBrowser.visibleTabs.length) > 0;
-  },
-
-  // ----------
-  updateContextMenu: function TabView_updateContextMenu(tab, popup) {
-    let separator = document.getElementById("context_tabViewNamedGroups");
-    let isEmpty = true;
-
-    while (popup.firstChild && popup.firstChild != separator)
-      popup.removeChild(popup.firstChild);
-
-    let self = this;
-    this._initFrame(function() {
-      let activeGroup = tab._tabViewTabItem.parent;
-      let groupItems = self._window.GroupItems.groupItems;
-
-      groupItems.forEach(function(groupItem) {
-        // if group has title, it's not hidden and there is no active group or
-        // the active group id doesn't match the group id, a group menu item
-        // would be added.
-        if (!groupItem.hidden &&
-            (groupItem.getTitle().trim() || groupItem.getChildren().length) &&
-            (!activeGroup || activeGroup.id != groupItem.id)) {
-          let menuItem = self._createGroupMenuItem(groupItem);
-          popup.insertBefore(menuItem, separator);
-          isEmpty = false;
-        }
-      });
-      separator.hidden = isEmpty;
-    });
-  },
-
-  // ----------
-  _createGroupMenuItem: function TabView__createGroupMenuItem(groupItem) {
-    let menuItem = document.createElement("menuitem");
-    let title = groupItem.getTitle();
-
-    if (!title.trim()) {
-      let topChildLabel = groupItem.getTopChild().tab.label;
-      let childNum = groupItem.getChildren().length;
-
-      if (childNum > 1) {
-        let num = childNum - 1;
-        title =
-          gNavigatorBundle.getString("tabview.moveToUnnamedGroup.label");
-        title = PluralForm.get(num, title).replace("#1", topChildLabel).replace("#2", num);
-      } else {
-        title = topChildLabel;
-      }
-    }
-
-    menuItem.setAttribute("label", title);
-    menuItem.setAttribute("tooltiptext", title);
-    menuItem.setAttribute("crop", "center");
-    menuItem.setAttribute("class", "tabview-menuitem");
-    menuItem.setAttribute(
-      "oncommand",
-      "TabView.moveTabTo(TabContextMenu.contextTab,'" + groupItem.id + "')");
-
-    return menuItem;
-  },
-
-  // ----------
-  moveTabTo: function TabView_moveTabTo(tab, groupItemId) {
-    if (this._window) {
-      this._window.GroupItems.moveTabToGroupItem(tab, groupItemId);
-    } else {
-      let self = this;
-      this._initFrame(function() {
-        self._window.GroupItems.moveTabToGroupItem(tab, groupItemId);
-      });
-    }
-  },
-
-  // ----------
-  // Adds new key commands to the browser, for invoking the Tab Candy UI
-  // and for switching between groups of tabs when outside of the Tab Candy UI.
-  _setBrowserKeyHandlers: function TabView__setBrowserKeyHandlers() {
-    if (this._browserKeyHandlerInitialized)
-      return;
-
-    this._browserKeyHandlerInitialized = true;
-
-    let self = this;
-    window.addEventListener("keypress", function(event) {
-      if (self.isVisible() || !self._tabBrowserHasHiddenTabs())
-        return;
-
-      let charCode = event.charCode;
-      // Control (+ Shift) + `
-      if (event.ctrlKey && !event.metaKey && !event.altKey &&
-          (charCode == 96 || charCode == 126)) {
-        event.stopPropagation();
-        event.preventDefault();
-
-        self._initFrame(function() {
-          let groupItems = self._window.GroupItems;
-          let tabItem = groupItems.getNextGroupItemTab(event.shiftKey);
-          if (!tabItem)
-            return;
-
-          if (gBrowser.selectedTab.pinned)
-            groupItems.updateActiveGroupItemAndTabBar(tabItem, {dontSetActiveTabInGroup: true});
-          else
-            gBrowser.selectedTab = tabItem.tab;
-        });
-      }
-    }, true);
-  },
-
-  // ----------
-  // Prepares the tab view for undo close tab.
-  prepareUndoCloseTab: function TabView_prepareUndoCloseTab(blankTabToRemove) {
-    if (this._window) {
-      this._window.UI.restoredClosedTab = true;
-
-      if (blankTabToRemove && blankTabToRemove._tabViewTabItem)
-        blankTabToRemove._tabViewTabItem.isRemovedAfterRestore = true;
-    }
-  },
-
-  // ----------
-  // Cleans up the tab view after undo close tab.
-  afterUndoCloseTab: function TabView_afterUndoCloseTab() {
-    if (this._window)
-      this._window.UI.restoredClosedTab = false;
-  },
-
-  // ----------
-  // On move to group pop showing.
-  moveToGroupPopupShowing: function TabView_moveToGroupPopupShowing(event) {
-    // Update the context menu only if Panorama was already initialized or if
-    // there are hidden tabs.
-    let numHiddenTabs = gBrowser.tabs.length - gBrowser.visibleTabs.length;
-    if (this._window || numHiddenTabs > 0)
-      this.updateContextMenu(TabContextMenu.contextTab, event.target);
-  },
-
-  // ----------
-  // Function: _addToolbarButton
-  // Adds the TabView button to the TabsToolbar.
-  _addToolbarButton: function TabView__addToolbarButton() {
-    let buttonId = "tabview-button";
-
-    if (CustomizableUI.getPlacementOfWidget(buttonId))
-      return;
-
-    let allTabsBtnPlacement = CustomizableUI.getPlacementOfWidget("alltabs-button");
-    // allTabsBtnPlacement can never be null because the button isn't removable
-    let desiredPosition = allTabsBtnPlacement.position + 1;
-    CustomizableUI.addWidgetToArea(buttonId, "TabsToolbar", desiredPosition);
-    // NB: this is for backwards compatibility, and should be removed by
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=976041
-    document.persist("TabsToolbar", "currentset");
-  },
-
-  // ----------
-  // Function: updateGroupNumberBroadcaster
-  // Updates the group number broadcaster.
-  updateGroupNumberBroadcaster: function TabView_updateGroupNumberBroadcaster(number) {
-    let groupsNumber = document.getElementById("tabviewGroupsNumber");
-    groupsNumber.setAttribute("groups", number);
-  },
-
-  // ----------
-  // Function: enableSessionRestore
-  // Enables automatic session restore when the browser is started. Does
-  // nothing if we already did that once in the past.
-  enableSessionRestore: function TabView_enableSessionRestore() {
-    if (!this._window || !this.firstUseExperienced)
-      return;
-
-    // do nothing if we already enabled session restore once
-    if (this.sessionRestoreEnabledOnce)
-      return;
-
-    this.sessionRestoreEnabledOnce = true;
-
-    // enable session restore if necessary
-    if (Services.prefs.getIntPref(this.PREF_STARTUP_PAGE) != 3) {
-      Services.prefs.setIntPref(this.PREF_STARTUP_PAGE, 3);
-
-      // show banner
-      this._window.UI.notifySessionRestoreEnabled();
-    }
-  },
-
-  // ----------
-  // Function: fillInTooltip
-  // Fills in the tooltip text.
-  fillInTooltip: function fillInTooltip(tipElement) {
-    let retVal = false;
-    let titleText = null;
-    let direction = tipElement.ownerDocument.dir;
-
-    while (!titleText && tipElement) {
-      if (tipElement.nodeType == Node.ELEMENT_NODE)
-        titleText = tipElement.getAttribute("title");
-      tipElement = tipElement.parentNode;
-    }
-    let tipNode = document.getElementById("tab-view-tooltip");
-    tipNode.style.direction = direction;
-
-    if (titleText) {
-      tipNode.setAttribute("label", titleText);
-      retVal = true;
-    }
-
-    return retVal;
-  }
-};
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1383,17 +1383,16 @@ var gBrowserInit = {
       if (window.closed) {
         return;
       }
 
       // Enable the Restore Last Session command if needed
       RestoreLastSessionObserver.init();
 
       SocialUI.init();
-      TabView.init();
 
       // Telemetry for master-password - we do this after 5 seconds as it
       // can cause IO if NSS/PSM has not already initialized.
       setTimeout(() => {
         if (window.closed) {
           return;
         }
         let secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"]
@@ -1504,17 +1503,16 @@ var gBrowserInit = {
     if (this._boundDelayedStartup) {
       this._cancelDelayedStartup();
     } else {
       if (Win7Features)
         Win7Features.onCloseWindow();
 
       gPrefService.removeObserver(ctrlTab.prefName, ctrlTab);
       ctrlTab.uninit();
-      TabView.uninit();
       SocialUI.uninit();
       gBrowserThumbnails.uninit();
       FullZoom.destroy();
 
       Services.obs.removeObserver(gSessionHistoryObserver, "browser:purge-session-history");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-disabled");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-started");
       Services.obs.removeObserver(gXPInstallObserver, "addon-install-blocked");
@@ -1559,17 +1557,17 @@ var gBrowserInit = {
   // macBrowserOverlay
   nonBrowserWindowStartup: function() {
     // Disable inappropriate commands / submenus
     var disabledItems = ['Browser:SavePage',
                          'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain',
                          'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload',
                          'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen',
                          'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
-                         'View:PageInfo', 'Browser:ToggleTabView'];
+                         'View:PageInfo'];
     var element;
 
     for (let disabledItem of disabledItems) {
       element = document.getElementById(disabledItem);
       if (element)
         element.setAttribute("disabled", "true");
     }
 
@@ -5516,29 +5514,27 @@ const nodeToTooltipMap = {
   "bookmarks-menu-button": "bookmarksMenuButton.tooltip",
 #ifdef XP_MACOSX
   "print-button": "printButton.tooltip",
 #endif
   "new-window-button": "newWindowButton.tooltip",
   "new-tab-button": "newTabButton.tooltip",
   "tabs-newtab-button": "newTabButton.tooltip",
   "fullscreen-button": "fullscreenButton.tooltip",
-  "tabview-button": "tabviewButton.tooltip",
   "downloads-button": "downloads.tooltip",
 };
 const nodeToShortcutMap = {
   "bookmarks-menu-button": "manBookmarkKb",
 #ifdef XP_MACOSX
   "print-button": "printKb",
 #endif
   "new-window-button": "key_newNavigator",
   "new-tab-button": "key_newNavigatorTab",
   "tabs-newtab-button": "key_newNavigatorTab",
   "fullscreen-button": "key_fullScreen",
-  "tabview-button": "key_tabview",
   "downloads-button": "key_openDownloads"
 };
 const gDynamicTooltipCache = new Map();
 function UpdateDynamicShortcutTooltipText(aTooltip) {
   let nodeId = aTooltip.triggerNode.id || aTooltip.triggerNode.getAttribute("anonid");
   if (!gDynamicTooltipCache.has(nodeId) && nodeId in nodeToTooltipMap) {
     let strId = nodeToTooltipMap[nodeId];
     let args = [];
@@ -6529,21 +6525,16 @@ function CanCloseWindow()
       return false;
     }
   }
   return true;
 }
 
 function WindowIsClosing()
 {
-  if (TabView.isVisible()) {
-    TabView.hide();
-    return false;
-  }
-
   if (!closeWindow(false, warnAboutClosingWindow))
     return false;
 
   // In theory we should exit here and the Window's internal Close
   // method should trigger canClose on nsBrowserAccess. However, by
   // that point it's too late to be able to show a prompt for
   // PermitUnload. So we do it here, when we still can.
   if (CanCloseWindow()) {
@@ -6753,19 +6744,17 @@ function convertFromUnicode(charset, str
 function undoCloseTab(aIndex) {
   // wallpaper patch to prevent an unnecessary blank tab (bug 343895)
   var blankTabToRemove = null;
   if (gBrowser.tabs.length == 1 && isTabEmpty(gBrowser.selectedTab))
     blankTabToRemove = gBrowser.selectedTab;
 
   var tab = null;
   if (SessionStore.getClosedTabCount(window) > (aIndex || 0)) {
-    TabView.prepareUndoCloseTab(blankTabToRemove);
     tab = SessionStore.undoCloseTab(window, aIndex || 0);
-    TabView.afterUndoCloseTab();
 
     if (blankTabToRemove)
       gBrowser.removeTab(blankTabToRemove);
   }
 
   return tab;
 }
 
@@ -7849,20 +7838,16 @@ var TabContextMenu = {
     document.getElementById("context_closeOtherTabs").hidden = this.contextTab.pinned;
 
     // Hide "Bookmark All Tabs" for a pinned tab.  Update its state if visible.
     let bookmarkAllTabs = document.getElementById("context_bookmarkAllTabs");
     bookmarkAllTabs.hidden = this.contextTab.pinned;
     if (!bookmarkAllTabs.hidden)
       PlacesCommandHook.updateBookmarkAllTabsCommand();
 
-    // Hide "Move to Group" if it's a pinned tab.
-    document.getElementById("context_tabViewMenu").hidden =
-      (this.contextTab.pinned || !TabView.firstUseExperienced);
-
     // Adjust the state of the toggle mute menu item.
     let toggleMute = document.getElementById("context_toggleMuteTab");
     if (this.contextTab.hasAttribute("muted")) {
       toggleMute.label = gNavigatorBundle.getString("unmuteTab.label");
       toggleMute.accessKey = gNavigatorBundle.getString("unmuteTab.accesskey");
     } else {
       toggleMute.label = gNavigatorBundle.getString("muteTab.label");
       toggleMute.accessKey = gNavigatorBundle.getString("muteTab.accesskey");
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -86,25 +86,16 @@
       <menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/>
       <menuseparator/>
       <menuitem id="context_pinTab" label="&pinTab.label;"
                 accesskey="&pinTab.accesskey;"
                 oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/>
       <menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true"
                 accesskey="&unpinTab.accesskey;"
                 oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
-      <menu id="context_tabViewMenu" label="&moveToGroup.label;"
-            accesskey="&moveToGroup.accesskey;">
-        <menupopup id="context_tabViewMenuPopup"
-                   onpopupshowing="if (event.target == this) TabView.moveToGroupPopupShowing(event);">
-          <menuseparator id="context_tabViewNamedGroups" hidden="true"/>
-          <menuitem id="context_tabViewNewGroup" label="&moveToNewGroup.label;"
-                    oncommand="TabView.moveTabTo(TabContextMenu.contextTab, null);"/>
-        </menupopup>
-      </menu>
       <menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
                 accesskey="&moveToNewWindow.accesskey;"
                 tbattr="tabbrowser-multiple"
                 oncommand="gBrowser.replaceTabWithWindow(TabContextMenu.contextTab);"/>
 #ifdef E10S_TESTING_ONLY
       <menuitem id="context_openNonRemoteWindow" label="Open in new non-e10s window"
                 tbattr="tabbrowser-remote"
                 hidden="true"
@@ -585,22 +576,16 @@
       <toolbarbutton id="alltabs-button"
                      class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button"
                      type="menu"
                      label="&listAllTabs.label;"
                      tooltiptext="&listAllTabs.label;"
                      removable="false">
         <menupopup id="alltabs-popup"
                    position="after_end">
-          <menuitem id="menu_tabview"
-                    class="menuitem-iconic"
-                    key="key_tabview"
-                    label="&viewTabGroups.label;"
-                    command="Browser:ToggleTabView"
-                    observes="tabviewGroupsNumber"/>
           <menuitem id="alltabs_undoCloseTab"
                     class="menuitem-iconic"
                     key="key_undoCloseTab"
                     label="&undoCloseTab.label;"
                     observes="History:UndoCloseTab"/>
           <menuseparator id="alltabs-popup-separator"/>
         </menupopup>
       </toolbarbutton>
@@ -1053,22 +1038,16 @@
                      type="checkbox"
                      label="&fullScreenCmd.label;"
                      tooltip="dynamic-shortcut-tooltip"/>
 
       <toolbarbutton id="sync-button"
                      class="toolbarbutton-1 chromeclass-toolbar-additional"
                      label="&syncToolbarButton.label;"
                      oncommand="gSyncUI.handleToolbarButton()"/>
-
-      <toolbarbutton id="tabview-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                     label="&tabGroupsButton.label;"
-                     command="Browser:ToggleTabView"
-                     tooltip="dynamic-shortcut-tooltip"
-                     observes="tabviewGroupsNumber"/>
     </toolbarpalette>
   </toolbox>
 
   <hbox id="fullscr-toggler" hidden="true"/>
 
   <deck id="content-deck" flex="1">
     <hbox flex="1" id="browser">
       <vbox id="browser-border-start" hidden="true" layer="true"/>
--- a/browser/base/content/chatWindow.xul
+++ b/browser/base/content/chatWindow.xul
@@ -51,18 +51,17 @@ var gChatWindow = {
 #else
                          'Browser:OpenLocation', 'Tools:Search',
 #endif
                          'Tools:Sanitize', 'Tools:DevToolbox',
                          'key_selectTab1', 'key_selectTab2', 'key_selectTab3',
                          'key_selectTab4', 'key_selectTab5', 'key_selectTab6',
                          'key_selectTab7', 'key_selectTab8', 'key_selectLastTab',
                          'viewHistorySidebar', 'viewBookmarksSidebar',
-                         'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs',
-                         'Browser:ToggleTabView'];
+                         'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs'];
 
     for (let disabledItem of disabledItems) {
       document.getElementById(disabledItem).setAttribute("disabled", "true");
     }
 
     window.QueryInterface(Ci.nsIDOMChromeWindow).browserDOMWindow =
       new chatBrowserAccess();
 
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -1002,24 +1002,17 @@
             return newTitle;
           ]]>
         </body>
       </method>
 
       <method name="updateTitlebar">
         <body>
           <![CDATA[
-            if ("TabView" in window && TabView.isVisible()) {
-              // ToDo: this will be removed when we gain ability to draw to the menu bar.
-              // Bug 586175
-              this.ownerDocument.title = TabView.windowTitle;
-            }
-            else {
-              this.ownerDocument.title = this.getWindowTitleForBrowser(this.mCurrentBrowser);
-            }
+            this.ownerDocument.title = this.getWindowTitleForBrowser(this.mCurrentBrowser);
           ]]>
         </body>
       </method>
 
       <method name="updateCurrentBrowser">
         <parameter name="aForceUpdate"/>
         <body>
           <![CDATA[
@@ -4369,21 +4362,19 @@
           let tabForEvent = targetIsWindow ?
                             this._getTabForContentWindow(event.target.top) :
                             this.getTabForBrowser(event.originalTarget);
 
           // Don't need to act if the tab is already selected:
           if (tabForEvent.selected)
             return;
 
-          // If this is a tabprompt, and we're not in tabview/panorama with
-          // the prompt being a beforeunload one, we won't switch tabs
-          // (unless this behaviour has been disabled entirely using the pref).
+          // If this is a tabprompt, we won't switch tabs
+          // (unless this behaviour has been disabled entirely using the pref)
           if (event.detail && event.detail.tabPrompt &&
-              !(event.detail.inPermitUnload && ("TabView" in window) && TabView.isVisible()) &&
               Services.prefs.getBoolPref("browser.tabs.dontfocusfordialogs")) {
             let docPrincipal = targetIsWindow ? event.target.document.nodePrincipal : null;
             // At least one of these should/will be non-null:
             let promptPrincipal = event.detail.promptPrincipal || docPrincipal ||
                                   tabForEvent.linkedBrowser.contentPrincipal;
             // For null principals, we bail immediately and don't show the checkbox:
             if (!promptPrincipal || promptPrincipal.isNullPrincipal) {
               tabForEvent.setAttribute("attention", "true");
@@ -6219,17 +6210,17 @@
           var tabContainer = gBrowser.tabContainer;
           // We don't want menu item decoration unless there is overflow.
           if (tabContainer.getAttribute("overflow") != "true")
             return;
 
           var tabstripBO = tabContainer.mTabstrip.scrollBoxObject;
           for (var i = 0; i < this.childNodes.length; i++) {
             let curTab = this.childNodes[i].tab;
-            if (!curTab) // "Tab Groups" menuitem and its menuseparator
+            if (!curTab) // "Undo close tab", menuseparator, or entries put here by addons.
               continue;
             let curTabBO = curTab.boxObject;
             if (curTabBO.screenX >= tabstripBO.screenX &&
                 curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width)
               this.childNodes[i].setAttribute("tabIsVisible", "true");
             else
               this.childNodes[i].removeAttribute("tabIsVisible");
           }
--- a/browser/base/jar.mn
+++ b/browser/base/jar.mn
@@ -90,17 +90,16 @@ browser.jar:
 *       content/browser/browser-gestureSupport.js     (content/browser-gestureSupport.js)
 *       content/browser/browser-places.js             (content/browser-places.js)
 *       content/browser/browser-plugins.js            (content/browser-plugins.js)
 *       content/browser/browser-safebrowsing.js       (content/browser-safebrowsing.js)
         content/browser/browser-sidebar.js            (content/browser-sidebar.js)
         content/browser/browser-social.js             (content/browser-social.js)
 *       content/browser/browser-syncui.js             (content/browser-syncui.js)
 *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
-        content/browser/browser-tabview.js            (content/browser-tabview.js)
         content/browser/browser-thumbnails.js         (content/browser-thumbnails.js)
         content/browser/browser-trackingprotection.js (content/browser-trackingprotection.js)
 *       content/browser/chatWindow.xul                (content/chatWindow.xul)
         content/browser/tab-content.js                (content/tab-content.js)
         content/browser/content.js                    (content/content.js)
         content/browser/social-content.js             (content/social-content.js)
         content/browser/defaultthemes/1.footer.jpg    (content/defaultthemes/1.footer.jpg)
         content/browser/defaultthemes/1.header.jpg    (content/defaultthemes/1.header.jpg)
--- a/browser/components/sessionstore/SessionMigration.jsm
+++ b/browser/components/sessionstore/SessionMigration.jsm
@@ -27,17 +27,16 @@ var SessionMigrationInternal = {
    * only contain:
    * - open windows
    *   - with tabs
    *     - with history entries with only title, url
    *     - with pinned state
    *     - with tab group info (hidden + group id)
    *     - with selected tab info
    *   - with selected window info
-   *   - with tabgroups info
    *
    * The complete state is then wrapped into the "about:welcomeback" page as
    * form field info to be restored when restoring the state.
    */
   convertState: function(aStateObj) {
     let state = {
       selectedWindow: aStateObj.selectedWindow,
       _closedWindows: []
@@ -48,31 +47,18 @@ var SessionMigrationInternal = {
         var tab = {};
         // Keep only titles and urls for history entries
         tab.entries = oldTab.entries.map(function(entry) {
           return {url: entry.url, title: entry.title};
         });
         tab.index = oldTab.index;
         tab.hidden = oldTab.hidden;
         tab.pinned = oldTab.pinned;
-        // The tabgroup info is in the extData, so we need to get it out.
-        if (oldTab.extData && "tabview-tab" in oldTab.extData) {
-          tab.extData = {"tabview-tab": oldTab.extData["tabview-tab"]};
-        }
         return tab;
       });
-      // There are various tabgroup-related attributes that we need to get out
-      // of the session restore data for the window, too.
-      if (oldWin.extData) {
-        for (let k of Object.keys(oldWin.extData)) {
-          if (k.startsWith("tabview-")) {
-            win.extData[k] = oldWin.extData[k];
-          }
-        }
-      }
       win.selected = oldWin.selected;
       win._closedTabs = [];
       return win;
     });
     let url = "about:welcomeback";
     let formdata = {id: {sessionData: state}, url};
     return {windows: [{tabs: [{entries: [{url}], formdata}]}]};
   },
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -1765,29 +1765,31 @@ var SessionStoreInternal = {
       TabRestoreQueue.hiddenToVisible(aTab);
 
       // let's kick off tab restoration again to ensure this tab gets restored
       // with "restore_hidden_tabs" == false (now that it has become visible)
       this.restoreNextTab();
     }
 
     // Default delay of 2 seconds gives enough time to catch multiple TabShow
-    // events due to changing groups in Panorama.
+    // events. This used to be due to changing groups in 'tab groups'. We
+    // might be able to get rid of this now?
     this.saveStateDelayed(aWindow);
   },
 
   onTabHide: function ssi_onTabHide(aWindow, aTab) {
     // If the tab hasn't been restored yet, move it into the right bucket
     if (aTab.linkedBrowser.__SS_restoreState &&
         aTab.linkedBrowser.__SS_restoreState == TAB_STATE_NEEDS_RESTORE) {
       TabRestoreQueue.visibleToHidden(aTab);
     }
 
     // Default delay of 2 seconds gives enough time to catch multiple TabHide
-    // events due to changing groups in Panorama.
+    // events. This used to be due to changing groups in 'tab groups'. We
+    // might be able to get rid of this now?
     this.saveStateDelayed(aWindow);
   },
 
   /**
    * Handler for the event that is fired when a <xul:browser> crashes.
    *
    * @param aWindow
    *        The window that the crashed browser belongs to.
@@ -2285,20 +2287,17 @@ var SessionStoreInternal = {
           let curWinState = this._windows[windowToUse.__SSi];
           curWinState._closedTabs = curWinState._closedTabs.concat(winState._closedTabs);
           curWinState._closedTabs.splice(this._max_tabs_undo, curWinState._closedTabs.length);
         }
 
         // Restore into that window - pretend it's a followup since we'll already
         // have a focused window.
         //XXXzpao This is going to merge extData together (taking what was in
-        //        winState over what is in the window already. The hack we have
-        //        in _preWindowToRestoreInto will prevent most (all?) Panorama
-        //        weirdness but we will still merge other extData.
-        //        Bug 588217 should make this go away by merging the group data.
+        //        winState over what is in the window already.
         let options = {overwriteTabs: canOverwriteTabs, isFollowUp: true};
         this.restoreWindow(windowToUse, winState, options);
       }
       else {
         this._openWindowWithState({ windows: [winState] });
       }
     }
 
@@ -2496,35 +2495,20 @@ var SessionStoreInternal = {
   _prepWindowToRestoreInto: function ssi_prepWindowToRestoreInto(aWindow) {
     if (!aWindow)
       return [false, false];
 
     // We might be able to overwrite the existing tabs instead of just adding
     // the previous session's tabs to the end. This will be set if possible.
     let canOverwriteTabs = false;
 
-    // Step 1 of processing:
-    // Inspect extData for Panorama identifiers. If found, then we want to
-    // inspect further. If there is a single group, then we can use this
-    // window. If there are multiple groups then we won't use this window.
-    let groupsData = this.getWindowValue(aWindow, "tabview-groups");
-    if (groupsData) {
-      groupsData = JSON.parse(groupsData);
-
-      // If there are multiple groups, we don't want to use this window.
-      if (groupsData.totalNumber > 1)
-        return [false, false];
-    }
-
-    // Step 2 of processing:
-    // If we're still here, then the window is usable. Look at the open tabs in
-    // comparison to home pages. If all the tabs are home pages then we'll end
-    // up overwriting all of them. Otherwise we'll just close the tabs that
-    // match home pages. Tabs with the about:blank URI will always be
-    // overwritten.
+    // Look at the open tabs in comparison to home pages. If all the tabs are
+    // home pages then we'll end up overwriting all of them. Otherwise we'll
+    // just close the tabs that match home pages. Tabs with the about:blank
+    // URI will always be overwritten.
     let homePages = ["about:blank"];
     let removableTabs = [];
     let tabbrowser = aWindow.gBrowser;
     let normalTabsLen = tabbrowser.tabs.length - tabbrowser._numPinnedTabs;
     let startupPref = this._prefBranch.getIntPref("startup.page");
     if (startupPref == 1)
       homePages = homePages.concat(aWindow.gHomeButton.getHomePage().split("|"));
 
--- a/browser/modules/BrowserUITelemetry.jsm
+++ b/browser/modules/BrowserUITelemetry.jsm
@@ -87,17 +87,16 @@ XPCOMUtils.defineLazyGetter(this, "DEFAU
 
 XPCOMUtils.defineLazyGetter(this, "PALETTE_ITEMS", function() {
   let result = [
     "open-file-button",
     "developer-button",
     "feed-button",
     "email-link-button",
     "sync-button",
-    "tabview-button",
     "web-apps-button",
   ];
 
   let panelPlacements = DEFAULT_AREA_PLACEMENTS["PanelUI-contents"];
   if (panelPlacements.indexOf("characterencoding-button") == -1) {
     result.push("characterencoding-button");
   }
 
--- a/browser/modules/WindowsPreviewPerTab.jsm
+++ b/browser/modules/WindowsPreviewPerTab.jsm
@@ -430,45 +430,38 @@ function TabWindow(win) {
   this.tabbrowser = win.gBrowser;
 
   this.previews = new Map();
 
   for (let i = 0; i < this.tabEvents.length; i++)
     this.tabbrowser.tabContainer.addEventListener(this.tabEvents[i], this, false);
   this.tabbrowser.addTabsProgressListener(this);
 
-  for (let i = 0; i < this.winEvents.length; i++)
-    this.win.addEventListener(this.winEvents[i], this, false);
-
   AeroPeek.windows.push(this);
   let tabs = this.tabbrowser.tabs;
   for (let i = 0; i < tabs.length; i++)
     this.newTab(tabs[i]);
 
   this.updateTabOrdering();
   AeroPeek.checkPreviewCount();
 }
 
 TabWindow.prototype = {
   _enabled: false,
   tabEvents: ["TabOpen", "TabClose", "TabSelect", "TabMove"],
-  winEvents: ["tabviewshown", "tabviewhidden"],
 
   destroy: function () {
     this._destroying = true;
 
     let tabs = this.tabbrowser.tabs;
 
     this.tabbrowser.removeTabsProgressListener(this);
     for (let i = 0; i < this.tabEvents.length; i++)
       this.tabbrowser.tabContainer.removeEventListener(this.tabEvents[i], this, false);
 
-    for (let i = 0; i < this.winEvents.length; i++)
-      this.win.removeEventListener(this.winEvents[i], this, false);
-
     for (let i = 0; i < tabs.length; i++)
       this.removeTab(tabs[i]);
 
     let idx = AeroPeek.windows.indexOf(this.win.gTaskbarTabGroup);
     AeroPeek.windows.splice(idx, 1);
     AeroPeek.checkPreviewCount();
   },
 
@@ -574,24 +567,16 @@ TabWindow.prototype = {
         this.updateTabOrdering();
         break;
       case "TabSelect":
         this.previewFromTab(tab).active = true;
         break;
       case "TabMove":
         this.updateTabOrdering();
         break;
-      case "tabviewshown":
-        this.enabled = false;
-        break;
-      case "tabviewhidden":
-        if (!AeroPeek._prefenabled)
-          return;
-        this.enabled = true;
-        break;
     }
   },
 
   //// Browser progress listener
   onLinkIconAvailable: function (aBrowser, aIconURL) {
     let self = this;
     getFaviconAsImage(
       aBrowser.contentWindow.document,