Commit ef2e81f7 authored by caseq's avatar caseq Committed by Commit bot

Revert of Make the extension's sidebar pane auto-resizable. (patchset #7...

Revert of Make the extension's sidebar pane auto-resizable. (patchset #7 id:120001 of https://codereview.chromium.org/1905493002/ )

Reason for revert:
Regression: sources tab extension panels do not render correctly
BUG=622456

Original issue's description:
> Make the extension's sidebar pane auto-resizable.
>
> Setting height of the sidebar pane is a relic from the old design where panes were expandable (https://developer.chrome.com/static/images/devtools-panels.png). In the current design, where panes are tabs, it doesn't make sense.
>
> BUG=438126
>
> Committed: https://crrev.com/7ff544f5fa1d09072def5419d74f8c0e5f42365e
> Cr-Commit-Position: refs/heads/master@{#391965}

TBR=paulirish@chromium.com,pfeldman@chromium.com,paulirish@chromium.org,kdzwinel@gmail.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=438126

Review-Url: https://codereview.chromium.org/2155173003
Cr-Commit-Position: refs/heads/master@{#406149}
parent 2df4a9ef
...@@ -358,7 +358,6 @@ Kingshuk Jana <kingshuk.j@samsung.com> ...@@ -358,7 +358,6 @@ Kingshuk Jana <kingshuk.j@samsung.com>
Kirill Bobyrev <kirillbobyrev@gmail.com> Kirill Bobyrev <kirillbobyrev@gmail.com>
Kirk Shoop <kirk.shoop@microsoft.com> Kirk Shoop <kirk.shoop@microsoft.com>
Klemen Forstnerič <klemen.forstneric@gmail.com> Klemen Forstnerič <klemen.forstneric@gmail.com>
Konrad Dzwinel <kdzwinel@gmail.com>
Krishna Chaitanya <krish.botta@samsung.com> Krishna Chaitanya <krish.botta@samsung.com>
Kristof Kosztyo <kkosztyo.u-szeged@partner.samsung.com> Kristof Kosztyo <kkosztyo.u-szeged@partner.samsung.com>
Krzysztof Czech <k.czech@samsung.com> Krzysztof Czech <k.czech@samsung.com>
......
...@@ -43,6 +43,7 @@ Sidebar created ...@@ -43,6 +43,7 @@ Sidebar created
setObject : <function> setObject : <function>
setPage : <function> setPage : <function>
} }
sidebar height 150
RUNNING TEST: extension_testSourcesSidebarPageReplacedWithObject RUNNING TEST: extension_testSourcesSidebarPageReplacedWithObject
Got onShown(), frame defined Got onShown(), frame defined
Got onShown(), frame not defined Got onShown(), frame not defined
...@@ -86,5 +87,6 @@ Sidebar created ...@@ -86,5 +87,6 @@ Sidebar created
setObject : <function> setObject : <function>
setPage : <function> setPage : <function>
} }
sidebar height 150
All tests done. All tests done.
...@@ -44,9 +44,7 @@ function extension_sidebarSetPage(panelName, nextTest) ...@@ -44,9 +44,7 @@ function extension_sidebarSetPage(panelName, nextTest)
dumpObject(sidebar); dumpObject(sidebar);
function onShown(win) function onShown(win)
{ {
var sidebarHeight = win.document.documentElement.getBoundingClientRect().height; output("sidebar height " + win.document.documentElement.getBoundingClientRect().height);
if (win.innerHeight !== sidebarHeight)
output("sidebar height mismatch, expected: " + win.innerHeight + ", actual:" + sidebarHeight);
sidebar.onShown.removeListener(onShown); sidebar.onShown.removeListener(onShown);
nextTest(); nextTest();
} }
......
...@@ -83,6 +83,7 @@ function defineCommonExtensionSymbols(apiPrivate) ...@@ -83,6 +83,7 @@ function defineCommonExtensionSymbols(apiPrivate)
SetOpenResourceHandler: "setOpenResourceHandler", SetOpenResourceHandler: "setOpenResourceHandler",
SetResourceContent: "setResourceContent", SetResourceContent: "setResourceContent",
SetSidebarContent: "setSidebarContent", SetSidebarContent: "setSidebarContent",
SetSidebarHeight: "setSidebarHeight",
SetSidebarPage: "setSidebarPage", SetSidebarPage: "setSidebarPage",
ShowPanel: "showPanel", ShowPanel: "showPanel",
StopAuditCategoryRun: "stopAuditCategoryRun", StopAuditCategoryRun: "stopAuditCategoryRun",
...@@ -389,20 +390,6 @@ function defineDeprecatedProperty(object, className, oldName, newName) ...@@ -389,20 +390,6 @@ function defineDeprecatedProperty(object, className, oldName, newName)
object.__defineGetter__(oldName, getter); object.__defineGetter__(oldName, getter);
} }
function defineDeprecatedMethod(object, className, oldName)
{
var warningGiven = false;
function noop()
{
if (warningGiven)
return;
console.warn(className + "." + oldName + " is deprecated, please don't use it. It is a no-op.");
warningGiven = true;
}
object[oldName] = noop;
}
function extractCallbackArgument(args) function extractCallbackArgument(args)
{ {
var lastArgument = args[args.length - 1]; var lastArgument = args[args.length - 1];
...@@ -496,10 +483,14 @@ ExtensionPanelImpl.prototype = { ...@@ -496,10 +483,14 @@ ExtensionPanelImpl.prototype = {
function ExtensionSidebarPaneImpl(id) function ExtensionSidebarPaneImpl(id)
{ {
ExtensionViewImpl.call(this, id); ExtensionViewImpl.call(this, id);
defineDeprecatedMethod(this, "ExtensionSidebarPane", "setHeight");
} }
ExtensionSidebarPaneImpl.prototype = { ExtensionSidebarPaneImpl.prototype = {
setHeight: function(height)
{
extensionServer.sendRequest({ command: commands.SetSidebarHeight, id: this._id, height: height });
},
setExpression: function(expression, rootTitle, evaluateOptions) setExpression: function(expression, rootTitle, evaluateOptions)
{ {
var request = { var request = {
......
...@@ -192,7 +192,6 @@ WebInspector.ExtensionButton.prototype = { ...@@ -192,7 +192,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.element.classList.add("fill");
this._panelName = panelName; this._panelName = panelName;
this._server = server; this._server = server;
this._id = id; this._id = id;
...@@ -253,6 +252,17 @@ WebInspector.ExtensionSidebarPane.prototype = { ...@@ -253,6 +252,17 @@ WebInspector.ExtensionSidebarPane.prototype = {
this._extensionView = new WebInspector.ExtensionView(this._server, this._id, url, "extension fill"); this._extensionView = new WebInspector.ExtensionView(this._server, this._id, url, "extension fill");
this._extensionView.show(this.element); this._extensionView.show(this.element);
if (!this.element.style.height)
this.setHeight("150px");
},
/**
* @param {string} height
*/
setHeight: function(height)
{
this.element.style.height = height;
}, },
/** /**
......
...@@ -68,6 +68,7 @@ WebInspector.ExtensionServer = function() ...@@ -68,6 +68,7 @@ WebInspector.ExtensionServer = function()
this._registerHandler(commands.Reload, this._onReload.bind(this)); this._registerHandler(commands.Reload, this._onReload.bind(this));
this._registerHandler(commands.SetOpenResourceHandler, this._onSetOpenResourceHandler.bind(this)); this._registerHandler(commands.SetOpenResourceHandler, this._onSetOpenResourceHandler.bind(this));
this._registerHandler(commands.SetResourceContent, this._onSetResourceContent.bind(this)); this._registerHandler(commands.SetResourceContent, this._onSetResourceContent.bind(this));
this._registerHandler(commands.SetSidebarHeight, this._onSetSidebarHeight.bind(this));
this._registerHandler(commands.SetSidebarContent, this._onSetSidebarContent.bind(this)); this._registerHandler(commands.SetSidebarContent, this._onSetSidebarContent.bind(this));
this._registerHandler(commands.SetSidebarPage, this._onSetSidebarPage.bind(this)); this._registerHandler(commands.SetSidebarPage, this._onSetSidebarPage.bind(this));
this._registerHandler(commands.ShowPanel, this._onShowPanel.bind(this)); this._registerHandler(commands.ShowPanel, this._onShowPanel.bind(this));
...@@ -334,6 +335,15 @@ WebInspector.ExtensionServer.prototype = { ...@@ -334,6 +335,15 @@ WebInspector.ExtensionServer.prototype = {
return this._sidebarPanes; return this._sidebarPanes;
}, },
_onSetSidebarHeight: function(message)
{
var sidebar = this._clientObjects[message.id];
if (!sidebar)
return this._status.E_NOTFOUND(message.id);
sidebar.setHeight(message.height);
return this._status.OK();
},
_onSetSidebarContent: function(message, port) _onSetSidebarContent: function(message, port)
{ {
var sidebar = this._clientObjects[message.id]; var sidebar = this._clientObjects[message.id];
......
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