| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @constructor | 8 * @constructor |
| 9 * @extends {WebInspector.SplitView} | 9 * @extends {WebInspector.SplitView} |
| 10 */ | 10 */ |
| 11 WebInspector.TimelineLayersView = function() | 11 WebInspector.TimelineLayersView = function() |
| 12 { | 12 { |
| 13 WebInspector.SplitView.call(this, true, false, "timelineLayersView"); | 13 WebInspector.SplitView.call(this, true, false, "timelineLayersView"); |
| 14 this._rightSplitView = new WebInspector.SplitView(true, true, "timelineLayer
sViewDetails"); |
| 15 this._rightSplitView.show(this.mainElement()); |
| 14 | 16 |
| 15 this._paintTiles = []; | 17 this._paintTiles = []; |
| 16 | 18 |
| 17 this.sidebarElement().classList.add("outline-disclosure", "layer-tree"); | 19 this.sidebarElement().classList.add("outline-disclosure", "layer-tree"); |
| 18 var sidebarTreeElement = this.sidebarElement().createChild("ol"); | 20 var sidebarTreeElement = this.sidebarElement().createChild("ol"); |
| 19 var treeOutline = new TreeOutline(sidebarTreeElement); | 21 var treeOutline = new TreeOutline(sidebarTreeElement); |
| 20 this._layerTreeOutline = new WebInspector.LayerTreeOutline(treeOutline); | 22 this._layerTreeOutline = new WebInspector.LayerTreeOutline(treeOutline); |
| 21 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events
.LayerSelected, this._onObjectSelected, this); | 23 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events
.LayerSelected, this._onObjectSelected, this); |
| 22 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events
.LayerHovered, this._onObjectHovered, this); | 24 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events
.LayerHovered, this._onObjectHovered, this); |
| 23 | 25 |
| 24 this._layers3DView = new WebInspector.Layers3DView(); | 26 this._layers3DView = new WebInspector.Layers3DView(); |
| 25 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectS
elected, this._onObjectSelected, this); | 27 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectS
elected, this._onObjectSelected, this); |
| 26 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectH
overed, this._onObjectHovered, this); | 28 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.ObjectH
overed, this._onObjectHovered, this); |
| 27 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.JumpToP
aintEventRequested, this._jumpToPaintEvent, this); | 29 this._layers3DView.addEventListener(WebInspector.Layers3DView.Events.JumpToP
aintEventRequested, this._jumpToPaintEvent, this); |
| 28 this._layers3DView.show(this.mainElement()); | 30 this._layers3DView.show(this._rightSplitView.mainElement()); |
| 31 |
| 32 this._layerDetailsView = new WebInspector.LayerDetailsView(); |
| 33 this._layerDetailsView.show(this._rightSplitView.sidebarElement()); |
| 29 } | 34 } |
| 30 | 35 |
| 31 WebInspector.TimelineLayersView.prototype = { | 36 WebInspector.TimelineLayersView.prototype = { |
| 32 /** | 37 /** |
| 33 * @param {!WebInspector.DeferredLayerTree} deferredLayerTree | 38 * @param {!WebInspector.DeferredLayerTree} deferredLayerTree |
| 34 * @param {?Array.<!WebInspector.LayerPaintEvent>} paints | 39 * @param {?Array.<!WebInspector.LayerPaintEvent>} paints |
| 35 */ | 40 */ |
| 36 showLayerTree: function(deferredLayerTree, paints) | 41 showLayerTree: function(deferredLayerTree, paints) |
| 37 { | 42 { |
| 38 this._disposeTiles(); | 43 this._disposeTiles(); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 */ | 149 */ |
| 145 _selectObject: function(activeObject) | 150 _selectObject: function(activeObject) |
| 146 { | 151 { |
| 147 var layer = activeObject && activeObject.layer; | 152 var layer = activeObject && activeObject.layer; |
| 148 if (this._currentlySelectedLayer === activeObject) | 153 if (this._currentlySelectedLayer === activeObject) |
| 149 return; | 154 return; |
| 150 this._currentlySelectedLayer = activeObject; | 155 this._currentlySelectedLayer = activeObject; |
| 151 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null); | 156 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null); |
| 152 this._layerTreeOutline.selectLayer(layer); | 157 this._layerTreeOutline.selectLayer(layer); |
| 153 this._layers3DView.selectObject(activeObject); | 158 this._layers3DView.selectObject(activeObject); |
| 159 this._layerDetailsView.setObject(activeObject); |
| 154 }, | 160 }, |
| 155 | 161 |
| 156 /** | 162 /** |
| 157 * @param {?WebInspector.Layers3DView.ActiveObject} activeObject | 163 * @param {?WebInspector.Layers3DView.ActiveObject} activeObject |
| 158 */ | 164 */ |
| 159 _hoverObject: function(activeObject) | 165 _hoverObject: function(activeObject) |
| 160 { | 166 { |
| 161 var layer = activeObject && activeObject.layer; | 167 var layer = activeObject && activeObject.layer; |
| 162 if (this._currentlyHoveredLayer === activeObject) | 168 if (this._currentlyHoveredLayer === activeObject) |
| 163 return; | 169 return; |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 207 |
| 202 _disposeTiles: function() | 208 _disposeTiles: function() |
| 203 { | 209 { |
| 204 for (var i = 0; i < this._paintTiles.length; ++i) | 210 for (var i = 0; i < this._paintTiles.length; ++i) |
| 205 this._paintTiles[i].snapshot.dispose(); | 211 this._paintTiles[i].snapshot.dispose(); |
| 206 this._paintTiles = []; | 212 this._paintTiles = []; |
| 207 }, | 213 }, |
| 208 | 214 |
| 209 __proto__: WebInspector.SplitView.prototype | 215 __proto__: WebInspector.SplitView.prototype |
| 210 } | 216 } |
| OLD | NEW |