| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @param {!WebInspector.ElementsTreeOutline} treeOutline | 7 * @param {!WebInspector.ElementsTreeOutline} treeOutline |
| 8 */ | 8 */ |
| 9 WebInspector.ElementsTreeElementHighlighter = function(treeOutline) | 9 WebInspector.ElementsTreeElementHighlighter = function(treeOutline) |
| 10 { | 10 { |
| 11 this._throttler = new WebInspector.Throttler(100); | 11 this._throttler = new WebInspector.Throttler(100); |
| 12 this._treeOutline = treeOutline; | 12 this._treeOutline = treeOutline; |
| 13 this._treeOutline.addEventListener(TreeOutline.Events.ElementExpanded, this.
_clearState, this); | 13 this._treeOutline.addEventListener(TreeOutline.Events.ElementExpanded, this.
_clearState, this); |
| 14 this._treeOutline.addEventListener(TreeOutline.Events.ElementCollapsed, this
._clearState, this); | 14 this._treeOutline.addEventListener(TreeOutline.Events.ElementCollapsed, this
._clearState, this); |
| 15 this._treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.S
electedNodeChanged, this._clearState, this); | 15 this._treeOutline.addEventListener(WebInspector.ElementsTreeOutline.Events.S
electedNodeChanged, this._clearState, this); |
| 16 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec
tor.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this); | 16 WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspec
tor.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this); |
| 17 this._treeOutline.domModel().addEventListener(WebInspector.DOMModel.Events.I
nspectModeWillBeToggled, this._clearState, this); | 17 this._treeOutline.domModel().addEventListener(WebInspector.DOMModel.Events.I
nspectModeWillBeToggled, this._clearState, this); |
| 18 } | 18 }; |
| 19 | 19 |
| 20 WebInspector.ElementsTreeElementHighlighter.prototype = { | 20 WebInspector.ElementsTreeElementHighlighter.prototype = { |
| 21 /** | 21 /** |
| 22 * @param {!WebInspector.Event} event | 22 * @param {!WebInspector.Event} event |
| 23 */ | 23 */ |
| 24 _highlightNode: function(event) | 24 _highlightNode: function(event) |
| 25 { | 25 { |
| 26 if (!WebInspector.moduleSetting("highlightNodeOnHoverInOverlay").get()) | 26 if (!WebInspector.moduleSetting("highlightNodeOnHoverInOverlay").get()) |
| 27 return; | 27 return; |
| 28 | 28 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 _clearState: function() | 83 _clearState: function() |
| 84 { | 84 { |
| 85 if (this._isModifyingTreeOutline) | 85 if (this._isModifyingTreeOutline) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 delete this._currentHighlightedElement; | 88 delete this._currentHighlightedElement; |
| 89 delete this._alreadyExpandedParentElement; | 89 delete this._alreadyExpandedParentElement; |
| 90 delete this._pendingHighlightNode; | 90 delete this._pendingHighlightNode; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } | 93 }; |
| OLD | NEW |