Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeElementHighlighter.js

Issue 2826833002: Revert of [DevTools] Consolidate overlay-related functionality in Overlay domain (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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(UI.TreeOutline.Events.ElementExpanded, th is._clearState, this); 14 this._treeOutline.addEventListener(UI.TreeOutline.Events.ElementExpanded, th is._clearState, this);
15 this._treeOutline.addEventListener(UI.TreeOutline.Events.ElementCollapsed, t his._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.OverlayModel, SDK.OverlayModel.Events.HighlightNodeRequested, this._ highlightNode, this); 18 SDK.DOMModel, SDK.DOMModel.Events.NodeHighlightedInOverlay, this._highli ghtNode, this);
19 this._treeOutline.domModel().overlayModel().addEventListener( 19 this._treeOutline.domModel().addEventListener(SDK.DOMModel.Events.InspectMod eWillBeToggled, this._clearState, this);
20 SDK.OverlayModel.Events.InspectModeWillBeToggled, this._clearState, this );
21 } 20 }
22 21
23 /** 22 /**
24 * @param {!Common.Event} event 23 * @param {!Common.Event} event
25 */ 24 */
26 _highlightNode(event) { 25 _highlightNode(event) {
27 if (!Common.moduleSetting('highlightNodeOnHoverInOverlay').get()) 26 if (!Common.moduleSetting('highlightNodeOnHoverInOverlay').get())
28 return; 27 return;
29 28
30 var domNode = /** @type {!SDK.DOMNode} */ (event.data); 29 var domNode = /** @type {!SDK.DOMNode} */ (event.data);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 82
84 _clearState() { 83 _clearState() {
85 if (this._isModifyingTreeOutline) 84 if (this._isModifyingTreeOutline)
86 return; 85 return;
87 86
88 delete this._currentHighlightedElement; 87 delete this._currentHighlightedElement;
89 delete this._alreadyExpandedParentElement; 88 delete this._alreadyExpandedParentElement;
90 delete this._pendingHighlightNode; 89 delete this._pendingHighlightNode;
91 } 90 }
92 }; 91 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698