Since classes extending ResourceView may need to show additional tabs, besides "Headers" and "Content", a generified approach should be used, to be able to add and hide tabs using a tab ID (name).
Created attachment 57218 [details] [PATCH] Suggested solution
Comment on attachment 57218 [details] [PATCH] Suggested solution WebCore/inspector/front-end/ResourceView.js: + * notice, this list of conditions and the following disclaimer. Please do not mix formatting changes with actual refactorings. WebCore/inspector/front-end/ResourceView.js:125 + this._tabObjects[id] = {tab: tabElement, content: contentElement}; I think you should extract this functionality into a separate tabbed pane class that is capable of showing views (or dom elements) in it. It then would be reusable in other places of the ui such as styles sidebar. WebCore/inspector/front-end/SourceView.js:208 + this._appendTab("local", WebInspector.UIString("Local"), this.localContentElement, this.selectLocalContentTab.bind(this)); You should not call private methods - make this one public!
Created attachment 57467 [details] [PATCH] Comments addressed
Comment on attachment 57467 [details] [PATCH] Comments addressed WebCore/inspector/front-end/ResourceView.js:111 + this.tabbedPane.hideTab("content"); Now that the tabbed pane is a component, you should simply not add content tab in this case instead of adding and hiding it. WebCore/inspector/front-end/SourceView.js:54 + if (this.localSourceFrame) I think what we should do is to come up with the tab factory for resources. So that the factory was creating tabs of applicable types for each resource. As a result, you would break SourceView -> ResourceView inheritance, will prevent SourceView from being localSourceFrame-aware, will make local changes tab absolutely separate extension, get rid of nasty show / hide headers when SourceView is re-used in Scripts tab. Lots of goodness!
Landed with the contentElement creation/hiding avoided Committing to http://svn.webkit.org/repository/webkit/trunk ... M WebCore/ChangeLog M WebCore/inspector/front-end/ResourceView.js M WebCore/inspector/front-end/SourceView.js M WebCore/inspector/front-end/TextViewer.js M WebCore/inspector/front-end/inspector.html Committed r60445
http://trac.webkit.org/changeset/60445 might have broken GTK Linux 32-bit Release