| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 * @extends {WebInspector.PanelWithSidebar} | 33 * @extends {WebInspector.VBox} |
| 34 * @implements {WebInspector.TargetManager.Observer} | 34 * @implements {WebInspector.TargetManager.Observer} |
| 35 */ | 35 */ |
| 36 WebInspector.LayersPanel = function() | 36 WebInspector.LayersPane = function() |
| 37 { | 37 { |
| 38 WebInspector.PanelWithSidebar.call(this, "layers", 225); | 38 WebInspector.VBox.call(this); |
| 39 |
| 40 this._panelSplitWidget = new WebInspector.SplitWidget(true, false, "layersPa
neSplitViewState", 225); |
| 41 this._panelSplitWidget.show(this.element); |
| 42 this._mainWidget = new WebInspector.VBox(); |
| 43 this._panelSplitWidget.setMainWidget(this._mainWidget); |
| 44 |
| 45 this._sidebarWidget = new WebInspector.VBox(); |
| 46 this._sidebarWidget.setMinimumSize(100, 25); |
| 47 this._panelSplitWidget.setSidebarWidget(this._sidebarWidget); |
| 48 this._sidebarWidget.element.classList.add("sidebar"); |
| 49 |
| 39 this.registerRequiredCSS("timeline/timelinePanel.css"); | 50 this.registerRequiredCSS("timeline/timelinePanel.css"); |
| 40 | 51 |
| 41 /** @type {?WebInspector.LayerTreeModel} */ | 52 /** @type {?WebInspector.LayerTreeModel} */ |
| 42 this._model = null; | 53 this._model = null; |
| 43 | 54 |
| 44 WebInspector.targetManager.observeTargets(this); | 55 WebInspector.targetManager.observeTargets(this); |
| 45 this._layerViewHost = new WebInspector.LayerViewHost(); | 56 this._layerViewHost = new WebInspector.LayerViewHost(); |
| 46 this._layerTreeOutline = new WebInspector.LayerTreeOutline(this._layerViewHo
st); | 57 this._layerTreeOutline = new WebInspector.LayerTreeOutline(this._layerViewHo
st); |
| 47 this.panelSidebarElement().appendChild(this._layerTreeOutline.element); | 58 this._sidebarWidget.element.appendChild(this._layerTreeOutline.element); |
| 48 this.setDefaultFocusedElement(this._layerTreeOutline.element); | 59 this.setDefaultFocusedElement(this._layerTreeOutline.element); |
| 49 | 60 |
| 50 this._rightSplitWidget = new WebInspector.SplitWidget(false, true, "layerDet
ailsSplitViewState"); | 61 this._rightSplitWidget = new WebInspector.SplitWidget(false, true, "layerDet
ailsSplitViewState"); |
| 51 this.splitWidget().setMainWidget(this._rightSplitWidget); | 62 this._panelSplitWidget.setMainWidget(this._rightSplitWidget); |
| 52 | 63 |
| 53 this._layers3DView = new WebInspector.Layers3DView(this._layerViewHost); | 64 this._layers3DView = new WebInspector.Layers3DView(this._layerViewHost); |
| 54 this._rightSplitWidget.setMainWidget(this._layers3DView); | 65 this._rightSplitWidget.setMainWidget(this._layers3DView); |
| 55 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.LayerSn
apshotRequested, this._onSnapshotRequested, this); | 66 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.LayerSn
apshotRequested, this._onSnapshotRequested, this); |
| 56 | 67 |
| 57 this._tabbedPane = new WebInspector.TabbedPane(); | 68 this._tabbedPane = new WebInspector.TabbedPane(); |
| 58 this._rightSplitWidget.setSidebarWidget(this._tabbedPane); | 69 this._rightSplitWidget.setSidebarWidget(this._tabbedPane); |
| 59 | 70 |
| 60 this._layerDetailsView = new WebInspector.LayerDetailsView(this._layerViewHo
st); | 71 this._layerDetailsView = new WebInspector.LayerDetailsView(this._layerViewHo
st); |
| 61 this._tabbedPane.appendTab(WebInspector.LayersPanel.DetailsViewTabs.Details,
WebInspector.UIString("Details"), this._layerDetailsView); | 72 this._tabbedPane.appendTab(WebInspector.LayersPane.DetailsViewTabs.Details,
WebInspector.UIString("Details"), this._layerDetailsView); |
| 62 | 73 |
| 63 this._paintProfilerView = new WebInspector.LayerPaintProfilerView(this._laye
rs3DView.showImageForLayer.bind(this._layers3DView)); | 74 this._paintProfilerView = new WebInspector.LayerPaintProfilerView(this._laye
rs3DView.showImageForLayer.bind(this._layers3DView)); |
| 64 this._tabbedPane.appendTab(WebInspector.LayersPanel.DetailsViewTabs.Profiler
, WebInspector.UIString("Profiler"), this._paintProfilerView); | 75 this._tabbedPane.appendTab(WebInspector.LayersPane.DetailsViewTabs.Profiler,
WebInspector.UIString("Profiler"), this._paintProfilerView); |
| 65 } | 76 } |
| 66 | 77 |
| 67 WebInspector.LayersPanel.DetailsViewTabs = { | 78 WebInspector.LayersPane.DetailsViewTabs = { |
| 68 Details: "details", | 79 Details: "details", |
| 69 Profiler: "profiler" | 80 Profiler: "profiler" |
| 70 }; | 81 }; |
| 71 | 82 |
| 72 WebInspector.LayersPanel.prototype = { | 83 WebInspector.LayersPane.prototype = { |
| 73 focus: function() | 84 focus: function() |
| 74 { | 85 { |
| 75 this._layerTreeOutline.focus(); | 86 this._layerTreeOutline.focus(); |
| 76 }, | 87 }, |
| 77 | 88 |
| 78 wasShown: function() | 89 wasShown: function() |
| 79 { | 90 { |
| 80 WebInspector.Panel.prototype.wasShown.call(this); | 91 WebInspector.Panel.prototype.wasShown.call(this); |
| 81 if (this._model) | 92 if (this._model) |
| 82 this._model.enable(); | 93 this._model.enable(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 if (this._layerViewHost.selection() && this._layerViewHost.selection().l
ayer() === event.data) | 157 if (this._layerViewHost.selection() && this._layerViewHost.selection().l
ayer() === event.data) |
| 147 this._layerDetailsView.update(); | 158 this._layerDetailsView.update(); |
| 148 }, | 159 }, |
| 149 | 160 |
| 150 /** | 161 /** |
| 151 * @param {!WebInspector.Event} event | 162 * @param {!WebInspector.Event} event |
| 152 */ | 163 */ |
| 153 _onSnapshotRequested: function(event) | 164 _onSnapshotRequested: function(event) |
| 154 { | 165 { |
| 155 var layer = /** @type {!WebInspector.Layer} */ (event.data); | 166 var layer = /** @type {!WebInspector.Layer} */ (event.data); |
| 156 this._tabbedPane.selectTab(WebInspector.LayersPanel.DetailsViewTabs.Prof
iler); | 167 this._tabbedPane.selectTab(WebInspector.LayersPane.DetailsViewTabs.Profi
ler); |
| 157 this._paintProfilerView.profileLayer(layer); | 168 this._paintProfilerView.profileLayer(layer); |
| 158 }, | 169 }, |
| 159 | 170 |
| 160 __proto__: WebInspector.PanelWithSidebar.prototype | 171 __proto__: WebInspector.VBox.prototype |
| 161 } | 172 } |
| 162 | |
| 163 /** | |
| 164 * @constructor | |
| 165 * @implements {WebInspector.Revealer} | |
| 166 */ | |
| 167 WebInspector.LayersPanel.LayerTreeRevealer = function() | |
| 168 { | |
| 169 } | |
| 170 | |
| 171 WebInspector.LayersPanel.LayerTreeRevealer.prototype = { | |
| 172 /** | |
| 173 * @override | |
| 174 * @param {!Object} snapshotData | |
| 175 * @return {!Promise} | |
| 176 */ | |
| 177 reveal: function(snapshotData) | |
| 178 { | |
| 179 if (!(snapshotData instanceof WebInspector.DeferredLayerTree)) | |
| 180 return Promise.reject(new Error("Internal error: not a WebInspector.
DeferredLayerTree")); | |
| 181 var panel = /** @type {!WebInspector.LayersPanel} */ (self.runtime.share
dInstance(WebInspector.LayersPanel)); | |
| 182 WebInspector.inspectorView.setCurrentPanel(panel); | |
| 183 panel._showLayerTree(/** @type {!WebInspector.DeferredLayerTree} */ (sna
pshotData)); | |
| 184 return Promise.resolve(); | |
| 185 } | |
| 186 } | |
| OLD | NEW |