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

Side by Side Diff: Source/devtools/front_end/timeline/TimelineLayersView.js

Issue 711423002: DevTools: better visual feedback for hovered objects is Layers3DView (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 */
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 */ 139 */
140 function onLayersAndTilesReady() 140 function onLayersAndTilesReady()
141 { 141 {
142 this._layerTreeOutline.update(layerTree); 142 this._layerTreeOutline.update(layerTree);
143 this._layers3DView.setLayerTree(layerTree); 143 this._layers3DView.setLayerTree(layerTree);
144 this._layers3DView.setTiles(this._paintTiles); 144 this._layers3DView.setTiles(this._paintTiles);
145 } 145 }
146 }, 146 },
147 147
148 /** 148 /**
149 * @param {?WebInspector.Layers3DView.ActiveObject} activeObject 149 * @param {?WebInspector.Layers3DView.Selection} selection
150 */ 150 */
151 _selectObject: function(activeObject) 151 _selectObject: function(selection)
152 { 152 {
153 var layer = activeObject && activeObject.layer; 153 var layer = selection && selection.layer;
154 if (this._currentlySelectedLayer === activeObject) 154 if (this._currentlySelectedLayer === selection)
155 return; 155 return;
156 this._currentlySelectedLayer = activeObject; 156 this._currentlySelectedLayer = selection;
157 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null); 157 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null);
158 this._layerTreeOutline.selectLayer(layer); 158 this._layerTreeOutline.selectLayer(layer);
159 this._layers3DView.selectObject(activeObject); 159 this._layers3DView.selectObject(selection);
160 this._layerDetailsView.setObject(activeObject); 160 this._layerDetailsView.setObject(selection);
161 }, 161 },
162 162
163 /** 163 /**
164 * @param {?WebInspector.Layers3DView.ActiveObject} activeObject 164 * @param {?WebInspector.Layers3DView.Selection} selection
165 */ 165 */
166 _hoverObject: function(activeObject) 166 _hoverObject: function(selection)
167 { 167 {
168 var layer = activeObject && activeObject.layer; 168 var layer = selection && selection.layer;
169 if (this._currentlyHoveredLayer === activeObject) 169 if (this._currentlyHoveredLayer === selection)
170 return; 170 return;
171 this._currentlyHoveredLayer = activeObject; 171 this._currentlyHoveredLayer = selection;
172 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null); 172 this._toggleNodeHighlight(layer ? layer.nodeForSelfOrAncestor() : null);
173 this._layerTreeOutline.hoverLayer(layer); 173 this._layerTreeOutline.hoverLayer(layer);
174 this._layers3DView.hoverObject(activeObject); 174 this._layers3DView.hoverObject(selection);
175 }, 175 },
176 176
177 /** 177 /**
178 * @param {?WebInspector.DOMNode} node 178 * @param {?WebInspector.DOMNode} node
179 */ 179 */
180 _toggleNodeHighlight: function(node) 180 _toggleNodeHighlight: function(node)
181 { 181 {
182 if (node) { 182 if (node) {
183 node.highlightForTwoSeconds(); 183 node.highlightForTwoSeconds();
184 return; 184 return;
185 } 185 }
186 if (this._target) 186 if (this._target)
187 this._target.domModel.hideDOMNodeHighlight(); 187 this._target.domModel.hideDOMNodeHighlight();
188 188
189 }, 189 },
190 190
191 /** 191 /**
192 * @param {!WebInspector.Event} event 192 * @param {!WebInspector.Event} event
193 */ 193 */
194 _onObjectSelected: function(event) 194 _onObjectSelected: function(event)
195 { 195 {
196 var activeObject = /** @type {!WebInspector.Layers3DView.ActiveObject} * / (event.data); 196 var selection = /** @type {!WebInspector.Layers3DView.Selection} */ (eve nt.data);
197 this._selectObject(activeObject); 197 this._selectObject(selection);
198 }, 198 },
199 199
200 /** 200 /**
201 * @param {!WebInspector.Event} event 201 * @param {!WebInspector.Event} event
202 */ 202 */
203 _onObjectHovered: function(event) 203 _onObjectHovered: function(event)
204 { 204 {
205 var activeObject = /** @type {!WebInspector.Layers3DView.ActiveObject} * / (event.data); 205 var selection = /** @type {!WebInspector.Layers3DView.Selection} */ (eve nt.data);
206 this._hoverObject(activeObject); 206 this._hoverObject(selection);
207 }, 207 },
208 208
209 _disposeTiles: function() 209 _disposeTiles: function()
210 { 210 {
211 for (var i = 0; i < this._paintTiles.length; ++i) 211 for (var i = 0; i < this._paintTiles.length; ++i)
212 this._paintTiles[i].snapshot.dispose(); 212 this._paintTiles[i].snapshot.dispose();
213 this._paintTiles = []; 213 this._paintTiles = [];
214 }, 214 },
215 215
216 __proto__: WebInspector.SplitView.prototype 216 __proto__: WebInspector.SplitView.prototype
217 } 217 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698