Changeset 283921 in webkit


Ignore:
Timestamp:
Oct 11, 2021 12:17:10 PM (9 months ago)
Author:
BJ Burg
Message:

Web Inspector: add TabBar context menu support for WI.WebInspectorExtensionTabContentView
https://bugs.webkit.org/show_bug.cgi?id=231181
<rdar://74698241>

Unreviewed. Land parts of the previous patch which seem to have been mis-merged and not landed.

  • UserInterface/Base/Main.js:

(WI.isNewTabWithTypeAllowed):

  • UserInterface/Controllers/WebInspectorExtensionController.js:

(WI.WebInspectorExtensionController.prototype.showExtensionTab):

  • UserInterface/Views/TabBar.js:

(WI.TabBar.prototype._handleAddClosedTabsTabBarItemMouseDown):
(WI.TabBar.prototype._handleTabContainerContextMenu):
(WI.TabBar):

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r283899 r283921  
     12021-10-11  BJ Burg  <bburg@apple.com>
     2
     3        Web Inspector: add TabBar context menu support for WI.WebInspectorExtensionTabContentView
     4        https://bugs.webkit.org/show_bug.cgi?id=231181
     5        <rdar://74698241>
     6
     7        Unreviewed. Land parts of the previous patch which seem to have been mis-merged and not landed.
     8
     9        * UserInterface/Base/Main.js:
     10        (WI.isNewTabWithTypeAllowed):
     11        * UserInterface/Controllers/WebInspectorExtensionController.js:
     12        (WI.WebInspectorExtensionController.prototype.showExtensionTab):
     13        * UserInterface/Views/TabBar.js:
     14        (WI.TabBar.prototype._handleAddClosedTabsTabBarItemMouseDown):
     15        (WI.TabBar.prototype._handleTabContainerContextMenu):
     16        (WI.TabBar):
     17
    1182021-10-11  Razvan Caliman  <rcaliman@apple.com>
    219
  • trunk/Source/WebInspectorUI/UserInterface/Base/Main.js

    r283859 r283921  
    743743WI.isNewTabWithTypeAllowed = function(tabType)
    744744{
     745    if (tabType === WI.WebInspectorExtensionTabContentView.Type)
     746        return false;
     747
    745748    let tabClass = WI._knownTabClassesByType.get(tabType);
    746749    if (!tabClass || !tabClass.isTabAllowed())
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js

    r283859 r283921  
    161161    }
    162162   
    163     showExtensionTab(extensionTabID)
     163    showExtensionTab(extensionTabID, options = {})
    164164    {
    165165        let tabContentView = this._extensionTabContentViewForExtensionTabIDMap.get(extensionTabID);
     
    171171        tabContentView.visible = true;
    172172        let success = WI.tabBrowser.showTabForContentView(tabContentView, {
     173            ...options,
    173174            initiatorHint: WI.TabBrowser.TabNavigationInitiator.FrontendAPI,
    174175        });
     
    178179            return WI.WebInspectorExtension.ErrorCode.InternalError;
    179180        }
     181
     182        tabContentView.visible = true;
    180183    }
    181184
  • trunk/Source/WebInspectorUI/UserInterface/Views/TabBar.js

    r282905 r283921  
    763763
    764764        for (let closedTabClass of closedTabClasses) {
     765            // Tab types that are not restorable (i.e., extension tab) should not be added in the generic code path.
     766            if (!closedTabClass.shouldSaveTab())
     767                continue;
     768
    765769            contextMenu.appendItem(closedTabClass.tabInfo().displayName, () => {
    766770                WI.createNewTabWithType(closedTabClass.Type, {shouldShowNewTab: true});
    767771            });
    768772        }
     773
     774        WI.sharedApp.extensionController.addContextMenuItemsForClosedExtensionTabs(contextMenu);
    769775
    770776        contextMenu.show();
     
    942948            }, checked, disabled);
    943949        }
     950
     951        WI.sharedApp.extensionController.addContextMenuItemsForAllExtensionTabs(contextMenu);
    944952    }
    945953};
Note: See TracChangeset for help on using the changeset viewer.