B2G/gecko/browser/components/tabview/tabitems.js
//                 groupItemId is available, add the tab to that group.
groupItemId is available, add the tab to that group.
groupItemId is available add the tab to that group .
function TabItem__reconnect(options) {
    Utils.assertThrow(!this._reconnected, "shouldn't already be reconnected");
    Utils.assertThrow(this.tab, "should have a xul:tab");
    let tabData = Storage.getTabData(this.tab);
    let groupItem;
    if (tabData && TabItems.storageSanity(tabData)) {
      this.showCachedData();
      if (this.parent)
        this.parent.remove(this, {immediately: true});
      if (tabData.groupID)
        groupItem = GroupItems.groupItem(tabData.groupID);
      else
        groupItem = new GroupItem([], {immediately: true, bounds: tabData.bounds});
      if (groupItem) {
        groupItem.add(this, {immediately: true});
        if (tabData.active)
          groupItem.setActiveTab(this);
        if (this.tab == gBrowser.selectedTab ||
            (!GroupItems.getActiveGroupItem() && !this.tab.hidden))
          UI.setActive(this.parent);
      }
    } else {
      if (options && options.groupItemId)
        groupItem = GroupItems.groupItem(options.groupItemId);
      if (groupItem) {
        groupItem.add(this, {immediately: true});
      } else {
        GroupItems.newTab(this, {immediately: true});
      }
    }
    this._reconnected = true;
    this.save();
    this._sendToSubscribers("reconnected");
  }
function TabItem__reconnect ( options ) { Utils . assertThrow ( ! this . _reconnected , "shouldn't already be reconnected" ) ; Utils . assertThrow ( this . tab , "should have a xul:tab" ) ; let tabData = Storage . getTabData ( this . tab ) ; let groupItem ; if ( tabData && TabItems . storageSanity ( tabData ) ) { this . showCachedData ( ) ; if ( this . parent ) this . parent . remove ( this , { immediately : true } ) ; if ( tabData . groupID ) groupItem = GroupItems . groupItem ( tabData . groupID ) ; else groupItem = new GroupItem ( [ ] , { immediately : true , bounds : tabData . bounds } ) ; if ( groupItem ) { groupItem . add ( this , { immediately : true } ) ; if ( tabData . active ) groupItem . setActiveTab ( this ) ; if ( this . tab == gBrowser . selectedTab || ( ! GroupItems . getActiveGroupItem ( ) && ! this . tab . hidden ) ) UI . setActive ( this . parent ) ; } } else { if ( options && options . groupItemId ) groupItem = GroupItems . groupItem ( options . groupItemId ) ; if ( groupItem ) { groupItem . add ( this , { immediately : true } ) ; } else { GroupItems . newTab ( this , { immediately : true } ) ; } } this . _reconnected = true ; this . save ( ) ; this . _sendToSubscribers ( "reconnected" ) ; }
groupItemId is available, add the tab to that group.
groupItemId is available add the tab to that group .
// Show the cached data while we're waiting for the tabItem to be updated. // If the tab isn't restored yet this acts as a placeholder until it is. // restore the active tab for each group between browser sessions // if it matches the selected tab or no active tab and the browser // tab is hidden, the active group item would be set. // create tab group by double click is handled in UI_init().