Commit ceecc0dc authored by pfeldman@chromium.org's avatar pfeldman@chromium.org

DevTools: rely upon shouldHideOnDetach when considering re-layout of elements and sources panels.

BUG=521202
NOTRY=true

Review URL: https://codereview.chromium.org/1299763002

git-svn-id: svn://svn.chromium.org/blink/trunk@200732 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 20ba2c9d
...@@ -944,10 +944,10 @@ WebInspector.ElementsPanel.prototype = { ...@@ -944,10 +944,10 @@ WebInspector.ElementsPanel.prototype = {
if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical()) if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical())
return; return;
var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes(); if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
if (this.sidebarPaneView && extensionSidebarPanes.length)
return; // We can't reparent extension iframes. return; // We can't reparent extension iframes.
var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
if (this.sidebarPaneView) { if (this.sidebarPaneView) {
this.sidebarPaneView.detach(); this.sidebarPaneView.detach();
this._splitWidget.uninstallResizer(this.sidebarPaneView.headerElement()); this._splitWidget.uninstallResizer(this.sidebarPaneView.headerElement());
...@@ -1061,10 +1061,8 @@ WebInspector.ElementsPanel.prototype = { ...@@ -1061,10 +1061,8 @@ WebInspector.ElementsPanel.prototype = {
*/ */
_addExtensionSidebarPane: function(pane) _addExtensionSidebarPane: function(pane)
{ {
if (pane.panelName() === this.name) { if (pane.panelName() === this.name)
this.setHideOnDetach();
this._extensionSidebarPanesContainer.addPane(pane); this._extensionSidebarPanesContainer.addPane(pane);
}
}, },
/** /**
......
...@@ -191,7 +191,6 @@ WebInspector.ExtensionButton.prototype = { ...@@ -191,7 +191,6 @@ WebInspector.ExtensionButton.prototype = {
WebInspector.ExtensionSidebarPane = function(server, panelName, title, id) WebInspector.ExtensionSidebarPane = function(server, panelName, title, id)
{ {
WebInspector.SidebarPane.call(this, title); WebInspector.SidebarPane.call(this, title);
this.setHideOnDetach();
this._panelName = panelName; this._panelName = panelName;
this._server = server; this._server = server;
this._id = id; this._id = id;
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
WebInspector.ExtensionView = function(server, id, src, className) WebInspector.ExtensionView = function(server, id, src, className)
{ {
WebInspector.Widget.call(this); WebInspector.Widget.call(this);
this.setHideOnDetach();
this.element.className = "vbox flex-auto"; // Override this.element.className = "vbox flex-auto"; // Override
this._server = server; this._server = server;
......
...@@ -1142,6 +1142,9 @@ WebInspector.SourcesPanel.prototype = { ...@@ -1142,6 +1142,9 @@ WebInspector.SourcesPanel.prototype = {
if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical()) if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical())
return; return;
if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
return; // We can't reparent extension iframes.
if (this.sidebarPaneView) if (this.sidebarPaneView)
this.sidebarPaneView.detach(); this.sidebarPaneView.detach();
...@@ -1230,10 +1233,8 @@ WebInspector.SourcesPanel.prototype = { ...@@ -1230,10 +1233,8 @@ WebInspector.SourcesPanel.prototype = {
*/ */
_addExtensionSidebarPane: function(pane) _addExtensionSidebarPane: function(pane)
{ {
if (pane.panelName() === this.name) { if (pane.panelName() === this.name)
this.setHideOnDetach();
this._extensionSidebarPanesContainer.addPane(pane); this._extensionSidebarPanesContainer.addPane(pane);
}
}, },
/** /**
......
...@@ -106,12 +106,12 @@ WebInspector.Widget.prototype = { ...@@ -106,12 +106,12 @@ WebInspector.Widget.prototype = {
/** /**
* @return {boolean} * @return {boolean}
*/ */
_shouldHideOnDetach: function() shouldHideOnDetach: function()
{ {
if (this._hideOnDetach) if (this._hideOnDetach)
return true; return true;
for (var child of this._children) { for (var child of this._children) {
if (child._shouldHideOnDetach()) if (child.shouldHideOnDetach())
return true; return true;
} }
return false; return false;
...@@ -283,7 +283,7 @@ WebInspector.Widget.prototype = { ...@@ -283,7 +283,7 @@ WebInspector.Widget.prototype = {
if (this._parentIsShowing()) if (this._parentIsShowing())
this._processWillHide(); this._processWillHide();
if (!overrideHideOnDetach && this._shouldHideOnDetach()) { if (!overrideHideOnDetach && this.shouldHideOnDetach()) {
this.element.classList.add("hidden"); this.element.classList.add("hidden");
this._visible = false; this._visible = false;
if (this._parentIsShowing()) if (this._parentIsShowing())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment