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 * @unrestricted | 5 * @unrestricted |
6 */ | 6 */ |
7 Elements.ElementsTreeElementHighlighter = class { | 7 Elements.ElementsTreeElementHighlighter = class { |
8 /** | 8 /** |
9 * @param {!Elements.ElementsTreeOutline} treeOutline | 9 * @param {!Elements.ElementsTreeOutline} treeOutline |
10 */ | 10 */ |
11 constructor(treeOutline) { | 11 constructor(treeOutline) { |
12 this._throttler = new Common.Throttler(100); | 12 this._throttler = new Common.Throttler(100); |
13 this._treeOutline = treeOutline; | 13 this._treeOutline = treeOutline; |
14 this._treeOutline.addEventListener(TreeOutline.Events.ElementExpanded, this.
_clearState, this); | 14 this._treeOutline.addEventListener(UI.TreeOutline.Events.ElementExpanded, th
is._clearState, this); |
15 this._treeOutline.addEventListener(TreeOutline.Events.ElementCollapsed, this
._clearState, this); | 15 this._treeOutline.addEventListener(UI.TreeOutline.Events.ElementCollapsed, t
his._clearState, this); |
16 this._treeOutline.addEventListener(Elements.ElementsTreeOutline.Events.Selec
tedNodeChanged, this._clearState, this); | 16 this._treeOutline.addEventListener(Elements.ElementsTreeOutline.Events.Selec
tedNodeChanged, this._clearState, this); |
17 SDK.targetManager.addModelListener( | 17 SDK.targetManager.addModelListener( |
18 SDK.DOMModel, SDK.DOMModel.Events.NodeHighlightedInOverlay, this._highli
ghtNode, this); | 18 SDK.DOMModel, SDK.DOMModel.Events.NodeHighlightedInOverlay, this._highli
ghtNode, this); |
19 this._treeOutline.domModel().addEventListener(SDK.DOMModel.Events.InspectMod
eWillBeToggled, this._clearState, this); | 19 this._treeOutline.domModel().addEventListener(SDK.DOMModel.Events.InspectMod
eWillBeToggled, this._clearState, this); |
20 } | 20 } |
21 | 21 |
22 /** | 22 /** |
23 * @param {!Common.Event} event | 23 * @param {!Common.Event} event |
24 */ | 24 */ |
25 _highlightNode(event) { | 25 _highlightNode(event) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 _clearState() { | 83 _clearState() { |
84 if (this._isModifyingTreeOutline) | 84 if (this._isModifyingTreeOutline) |
85 return; | 85 return; |
86 | 86 |
87 delete this._currentHighlightedElement; | 87 delete this._currentHighlightedElement; |
88 delete this._alreadyExpandedParentElement; | 88 delete this._alreadyExpandedParentElement; |
89 delete this._pendingHighlightNode; | 89 delete this._pendingHighlightNode; |
90 } | 90 } |
91 }; | 91 }; |
OLD | NEW |