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 = {
if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical())
return;
var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
if (this.sidebarPaneView && extensionSidebarPanes.length)
if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
return; // We can't reparent extension iframes.
var extensionSidebarPanes = WebInspector.extensionServer.sidebarPanes();
if (this.sidebarPaneView) {
this.sidebarPaneView.detach();
this._splitWidget.uninstallResizer(this.sidebarPaneView.headerElement());
......@@ -1061,10 +1061,8 @@ WebInspector.ElementsPanel.prototype = {
*/
_addExtensionSidebarPane: function(pane)
{
if (pane.panelName() === this.name) {
this.setHideOnDetach();
if (pane.panelName() === this.name)
this._extensionSidebarPanesContainer.addPane(pane);
}
},
/**
......
......@@ -191,7 +191,6 @@ WebInspector.ExtensionButton.prototype = {
WebInspector.ExtensionSidebarPane = function(server, panelName, title, id)
{
WebInspector.SidebarPane.call(this, title);
this.setHideOnDetach();
this._panelName = panelName;
this._server = server;
this._id = id;
......
......@@ -39,6 +39,7 @@
WebInspector.ExtensionView = function(server, id, src, className)
{
WebInspector.Widget.call(this);
this.setHideOnDetach();
this.element.className = "vbox flex-auto"; // Override
this._server = server;
......
......@@ -1142,6 +1142,9 @@ WebInspector.SourcesPanel.prototype = {
if (this.sidebarPaneView && vertically === !this._splitWidget.isVertical())
return;
if (this.sidebarPaneView && this.sidebarPaneView.shouldHideOnDetach())
return; // We can't reparent extension iframes.
if (this.sidebarPaneView)
this.sidebarPaneView.detach();
......@@ -1230,10 +1233,8 @@ WebInspector.SourcesPanel.prototype = {
*/
_addExtensionSidebarPane: function(pane)
{
if (pane.panelName() === this.name) {
this.setHideOnDetach();
if (pane.panelName() === this.name)
this._extensionSidebarPanesContainer.addPane(pane);
}
},
/**
......
......@@ -106,12 +106,12 @@ WebInspector.Widget.prototype = {
/**
* @return {boolean}
*/
_shouldHideOnDetach: function()
shouldHideOnDetach: function()
{
if (this._hideOnDetach)
return true;
for (var child of this._children) {
if (child._shouldHideOnDetach())
if (child.shouldHideOnDetach())
return true;
}
return false;
......@@ -283,7 +283,7 @@ WebInspector.Widget.prototype = {
if (this._parentIsShowing())
this._processWillHide();
if (!overrideHideOnDetach && this._shouldHideOnDetach()) {
if (!overrideHideOnDetach && this.shouldHideOnDetach()) {
this.element.classList.add("hidden");
this._visible = false;
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