Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1086)

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 2217783002: DevTools: use view locations in the elements and sources sidebars. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: for landing Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index 5b647e4495357ba7c00b977762495ffdca27f4d1..024fda322e151c68fe48aa60b5cbe7ff493adf0a 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -101,7 +101,7 @@ WebInspector.ElementsPanel.prototype = {
_revealProperty: function(cssProperty)
{
var stylesSidebarPane = this.sidebarPanes.styles;
- this.sidebarPaneView.selectTab(WebInspector.UIString("Styles"));
+ this.sidebarPaneView.showView(stylesSidebarPane);
stylesSidebarPane.revealProperty(/** @type {!WebInspector.CSSProperty} */(cssProperty));
return Promise.resolve();
},
@@ -863,21 +863,19 @@ WebInspector.ElementsPanel.prototype = {
if (this.sidebarPaneView && horizontally === !this._splitWidget.isVertical())
return;
- if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
+ if (this.sidebarPaneView && this.sidebarPaneView.tabbedPane().shouldHideOnDetach())
return; // We can't reparent extension iframes.
- var selectedTabId = this.sidebarPaneView ? this.sidebarPaneView.selectedTabId : null;
-
var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
if (this.sidebarPaneView) {
- this.sidebarPaneView.detach();
- this._splitWidget.uninstallResizer(this.sidebarPaneView.headerElement());
+ this.sidebarPaneView.tabbedPane().detach();
+ this._splitWidget.uninstallResizer(this.sidebarPaneView.tabbedPane().headerElement());
}
this._splitWidget.setVertical(!horizontally);
this.showToolbarPane(null);
- var computedPane = new WebInspector.View(WebInspector.UIString("Computed"));
+ var computedPane = new WebInspector.SimpleView(WebInspector.UIString("Computed"));
computedPane.element.classList.add("composite");
computedPane.element.classList.add("fill");
computedPane.element.classList.add("metrics-and-computed");
@@ -915,17 +913,18 @@ WebInspector.ElementsPanel.prototype = {
showMetrics.call(this, false);
}
- this.sidebarPaneView = new WebInspector.View.TabbedPaneContainer();
- this.sidebarPaneView.element.addEventListener("contextmenu", this._sidebarContextMenuEventFired.bind(this), false);
+ this.sidebarPaneView = WebInspector.viewManager.createTabbedLocation(() => WebInspector.inspectorView.setCurrentPanel(this), "elements-sidebar");
+ var tabbedPane = this.sidebarPaneView.tabbedPane();
+ tabbedPane.element.addEventListener("contextmenu", this._sidebarContextMenuEventFired.bind(this), false);
if (this._popoverHelper)
this._popoverHelper.hidePopover();
- this._popoverHelper = new WebInspector.PopoverHelper(this.sidebarPaneView.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
+ this._popoverHelper = new WebInspector.PopoverHelper(tabbedPane.element, this._getPopoverAnchor.bind(this), this._showPopover.bind(this));
this._popoverHelper.setTimeout(0);
if (horizontally) {
- this._splitWidget.installResizer(this.sidebarPaneView.headerElement());
+ this._splitWidget.installResizer(tabbedPane.headerElement());
- var compositePane = new WebInspector.View(WebInspector.UIString("Styles"));
+ var compositePane = new WebInspector.SimpleView(WebInspector.UIString("Styles"));
compositePane.element.classList.add("flex-auto");
var splitWidget = new WebInspector.SplitWidget(true, true, "stylesPaneSplitViewState", 215);
@@ -936,16 +935,26 @@ WebInspector.ElementsPanel.prototype = {
computedPane.show(computedStylePanesWrapper.element);
this.sidebarPaneView.appendView(compositePane);
+
+ // TODO: remove
+ this.sidebarPanes.styles.setParentViewForReveal(compositePane);
+ this.sidebarPanes.computedStyle.setParentViewForReveal(compositePane);
+ this.sidebarPanes.metrics.setParentViewForReveal(compositePane);
} else {
- var stylesPane = new WebInspector.View(WebInspector.UIString("Styles"));
+ var stylesPane = new WebInspector.SimpleView(WebInspector.UIString("Styles"));
stylesPane.element.classList.add("flex-auto", "metrics-and-styles");
matchedStylesContainer.show(stylesPane.element);
computedStylePanesWrapper.show(computedPane.element);
- this.sidebarPaneView.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, tabSelected, this);
+ tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, tabSelected, this);
this.sidebarPaneView.appendView(stylesPane);
this.sidebarPaneView.appendView(computedPane);
+
+ // TODO: remove
+ this.sidebarPanes.styles.setParentViewForReveal(stylesPane);
+ this.sidebarPanes.computedStyle.setParentViewForReveal(computedPane);
+ this.sidebarPanes.metrics.setParentViewForReveal(computedPane);
}
this.sidebarPanes.styles.show(matchedStylePanesWrapper.element);
@@ -964,10 +973,7 @@ WebInspector.ElementsPanel.prototype = {
for (var i = 0; i < extensionSidebarPanes.length; ++i)
this._addExtensionSidebarPane(extensionSidebarPanes[i]);
- this._splitWidget.setSidebarWidget(this.sidebarPaneView);
-
- if (selectedTabId)
- this.sidebarPaneView.selectTab(selectedTabId);
+ this._splitWidget.setSidebarWidget(this.sidebarPaneView.tabbedPane());
},
/**

Powered by Google App Engine
This is Rietveld 408576698