| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 this._treeOutline = new TreeOutlineInShadow(); | 43 this._treeOutline = new TreeOutlineInShadow(); |
| 44 this._treeOutline.element.classList.add("layer-tree", "overflow-auto"); | 44 this._treeOutline.element.classList.add("layer-tree", "overflow-auto"); |
| 45 this._treeOutline.element.addEventListener("mousemove", this._onMouseMove.bi
nd(this), false); | 45 this._treeOutline.element.addEventListener("mousemove", this._onMouseMove.bi
nd(this), false); |
| 46 this._treeOutline.element.addEventListener("mouseout", this._onMouseMove.bin
d(this), false); | 46 this._treeOutline.element.addEventListener("mouseout", this._onMouseMove.bin
d(this), false); |
| 47 this._treeOutline.element.addEventListener("contextmenu", this._onContextMen
u.bind(this), true); | 47 this._treeOutline.element.addEventListener("contextmenu", this._onContextMen
u.bind(this), true); |
| 48 | 48 |
| 49 this._lastHoveredNode = null; | 49 this._lastHoveredNode = null; |
| 50 this.element = this._treeOutline.element; | 50 this.element = this._treeOutline.element; |
| 51 this._layerViewHost.showInternalLayersSetting().addChangeListener(this._upda
te, this); | 51 this._layerViewHost.showInternalLayersSetting().addChangeListener(this._upda
te, this); |
| 52 } | 52 }; |
| 53 | 53 |
| 54 WebInspector.LayerTreeOutline.prototype = { | 54 WebInspector.LayerTreeOutline.prototype = { |
| 55 focus: function() | 55 focus: function() |
| 56 { | 56 { |
| 57 this._treeOutline.focus(); | 57 this._treeOutline.focus(); |
| 58 }, | 58 }, |
| 59 | 59 |
| 60 /** | 60 /** |
| 61 * @param {?WebInspector.LayerView.Selection} selection | 61 * @param {?WebInspector.LayerView.Selection} selection |
| 62 * @override | 62 * @override |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 /** | 204 /** |
| 205 * @param {?TreeElement} node | 205 * @param {?TreeElement} node |
| 206 * @return {?WebInspector.LayerView.Selection} | 206 * @return {?WebInspector.LayerView.Selection} |
| 207 */ | 207 */ |
| 208 _selectionForNode: function(node) | 208 _selectionForNode: function(node) |
| 209 { | 209 { |
| 210 return node && node._layer ? new WebInspector.LayerView.LayerSelection(n
ode._layer) : null; | 210 return node && node._layer ? new WebInspector.LayerView.LayerSelection(n
ode._layer) : null; |
| 211 }, | 211 }, |
| 212 | 212 |
| 213 __proto__: WebInspector.Object.prototype | 213 __proto__: WebInspector.Object.prototype |
| 214 } | 214 }; |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * @constructor | 217 * @constructor |
| 218 * @param {!WebInspector.LayerTreeOutline} tree | 218 * @param {!WebInspector.LayerTreeOutline} tree |
| 219 * @param {!WebInspector.Layer} layer | 219 * @param {!WebInspector.Layer} layer |
| 220 * @extends {TreeElement} | 220 * @extends {TreeElement} |
| 221 */ | 221 */ |
| 222 WebInspector.LayerTreeElement = function(tree, layer) | 222 WebInspector.LayerTreeElement = function(tree, layer) |
| 223 { | 223 { |
| 224 TreeElement.call(this); | 224 TreeElement.call(this); |
| 225 this._treeOutline = tree; | 225 this._treeOutline = tree; |
| 226 this._layer = layer; | 226 this._layer = layer; |
| 227 this._layer[WebInspector.LayerTreeElement._symbol] = this; | 227 this._layer[WebInspector.LayerTreeElement._symbol] = this; |
| 228 this._update(); | 228 this._update(); |
| 229 } | 229 }; |
| 230 | 230 |
| 231 WebInspector.LayerTreeElement._symbol = Symbol("layer"); | 231 WebInspector.LayerTreeElement._symbol = Symbol("layer"); |
| 232 | 232 |
| 233 WebInspector.LayerTreeElement.prototype = { | 233 WebInspector.LayerTreeElement.prototype = { |
| 234 _update: function() | 234 _update: function() |
| 235 { | 235 { |
| 236 var node = this._layer.nodeForSelfOrAncestor(); | 236 var node = this._layer.nodeForSelfOrAncestor(); |
| 237 var title = createDocumentFragment(); | 237 var title = createDocumentFragment(); |
| 238 title.createTextChild(node ? WebInspector.DOMPresentationUtils.simpleSel
ector(node) : "#" + this._layer.id()); | 238 title.createTextChild(node ? WebInspector.DOMPresentationUtils.simpleSel
ector(node) : "#" + this._layer.id()); |
| 239 var details = title.createChild("span", "dimmed"); | 239 var details = title.createChild("span", "dimmed"); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 253 | 253 |
| 254 /** | 254 /** |
| 255 * @param {boolean} hovered | 255 * @param {boolean} hovered |
| 256 */ | 256 */ |
| 257 setHovered: function(hovered) | 257 setHovered: function(hovered) |
| 258 { | 258 { |
| 259 this.listItemElement.classList.toggle("hovered", hovered); | 259 this.listItemElement.classList.toggle("hovered", hovered); |
| 260 }, | 260 }, |
| 261 | 261 |
| 262 __proto__: TreeElement.prototype | 262 __proto__: TreeElement.prototype |
| 263 } | 263 }; |
| OLD | NEW |