X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fdevtools%2Ffront_end%2FPanel.js;h=c7bd1e910ba077dbb4a839ed14881fa5eaae9859;hb=ff3e2503a20db9193d323c1d19c38c68004dec4a;hp=079d006e35e77ca9ab0d7be11a7faa8b54fd3b5c;hpb=7338fba38ba696536d1cc9d389afd716a6ab2fe6;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/devtools/front_end/Panel.js b/src/third_party/WebKit/Source/devtools/front_end/Panel.js index 079d006..c7bd1e9 100644 --- a/src/third_party/WebKit/Source/devtools/front_end/Panel.js +++ b/src/third_party/WebKit/Source/devtools/front_end/Panel.js @@ -40,8 +40,6 @@ WebInspector.Panel = function(name) this._panelName = name; this._shortcuts = /** !Object. */ ({}); - - WebInspector.settings[this._sidebarWidthSettingName()] = WebInspector.settings.createSetting(this._sidebarWidthSettingName(), undefined); } // Should by in sync with style declarations. @@ -62,7 +60,7 @@ WebInspector.Panel.prototype = { */ defaultFocusedElement: function() { - return this.sidebarTreeElement || this.element; + return this.element; }, /** @@ -88,78 +86,12 @@ WebInspector.Panel.prototype = { { }, - /** - * @param {!Element=} parentElement - * @param {string=} position - * @param {number=} defaultWidth - * @param {number=} defaultHeight - */ - createSidebarView: function(parentElement, position, defaultWidth, defaultHeight) - { - if (this.splitView) - return; - - if (!parentElement) - parentElement = this.element; - - this.splitView = new WebInspector.SidebarView(position, this._sidebarWidthSettingName(), defaultWidth, defaultHeight); - this.splitView.show(parentElement); - this.splitView.addEventListener(WebInspector.SidebarView.EventTypes.Resized, this.sidebarResized.bind(this)); - }, - - /** - * @param {!Element=} parentElement - * @param {string=} position - * @param {number=} defaultWidth - */ - createSidebarViewWithTree: function(parentElement, position, defaultWidth) - { - if (this.splitView) - return; - - this.createSidebarView(parentElement, position); - - this.sidebarTreeElement = document.createElement("ol"); - this.sidebarTreeElement.className = "sidebar-tree"; - this.splitView.sidebarElement().appendChild(this.sidebarTreeElement); - this.splitView.sidebarElement().classList.add("sidebar"); - - this.sidebarTree = new TreeOutline(this.sidebarTreeElement); - this.sidebarTree.panel = this; - }, - - _sidebarWidthSettingName: function() - { - return this._panelName + "SidebarWidth"; - }, - // Should be implemented by ancestors. - get statusBarItems() { }, /** - * @param {!WebInspector.Event} event - */ - sidebarResized: function(event) - { - }, - - statusBarResized: function() - { - }, - - /** - * @param {!Element} anchor - * @return {boolean} - */ - showAnchorLocation: function(anchor) - { - return false; - }, - - /** * @return {!Array.} */ elementsToRestoreScrollPositionsFor: function() @@ -213,6 +145,62 @@ WebInspector.Panel.prototype = { } /** + * @extends {WebInspector.Panel} + * @param {number=} defaultWidth + * @constructor + */ +WebInspector.PanelWithSidebarTree = function(name, defaultWidth) +{ + WebInspector.Panel.call(this, name); + + this._panelSplitView = new WebInspector.SplitView(true, false, this._panelName + "SidebarWidth", defaultWidth || 200); + this._panelSplitView.setSidebarElementConstraints(Preferences.minSidebarWidth); + this._panelSplitView.show(this.element); + + var sidebarElement = this._panelSplitView.sidebarElement(); + sidebarElement.classList.add("sidebar"); + var sidebarTreeElement = sidebarElement.createChild("ol", "sidebar-tree"); + this.sidebarTree = new TreeOutline(sidebarTreeElement); +} + +WebInspector.PanelWithSidebarTree.prototype = { + /** + * @return {!Element} + */ + sidebarElement: function() + { + return this._panelSplitView.sidebarElement(); + }, + + /** + * @return {!Element} element + */ + mainElement: function() + { + return this._panelSplitView.mainElement(); + }, + + /** + * @param {number=} minWidth + * @param {number=} minHeight + */ + setMainElementConstraints: function(minWidth, minHeight) + { + this._panelSplitView.setMainElementConstraints(minWidth, minHeight); + }, + + /** + * @return {!Element} + */ + defaultFocusedElement: function() + { + return this.sidebarTree.element || this.element; + }, + + __proto__: WebInspector.Panel.prototype +} + +/** * @interface */ WebInspector.PanelDescriptor = function()