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

Side by Side Diff: Source/devtools/front_end/layers/LayersPanel.js

Issue 396993003: DevTools: get rid of WebInspector.cssModel, use target models instead (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
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 26 matching lines...) Expand all
37 * @extends {WebInspector.PanelWithSidebarTree} 37 * @extends {WebInspector.PanelWithSidebarTree}
38 */ 38 */
39 WebInspector.LayersPanel = function() 39 WebInspector.LayersPanel = function()
40 { 40 {
41 WebInspector.PanelWithSidebarTree.call(this, "layers", 225); 41 WebInspector.PanelWithSidebarTree.call(this, "layers", 225);
42 this.registerRequiredCSS("layersPanel.css"); 42 this.registerRequiredCSS("layersPanel.css");
43 43
44 this.sidebarElement().classList.add("outline-disclosure"); 44 this.sidebarElement().classList.add("outline-disclosure");
45 this.sidebarTree.element.classList.remove("sidebar-tree"); 45 this.sidebarTree.element.classList.remove("sidebar-tree");
46 46
47 this._target = /** @type {!WebInspector.Target} */ (WebInspector.targetManag er.activeTarget()); 47 this._target = /** @type {!WebInspector.Target} */ (WebInspector.targetManag er.mainTarget());
48 this._model = new WebInspector.LayerTreeModel(this._target); 48 this._model = new WebInspector.LayerTreeModel(this._target);
49 this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeCha nged, this._onLayerTreeUpdated, this); 49 this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeCha nged, this._onLayerTreeUpdated, this);
50 this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted , this._onLayerPainted, this); 50 this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted , this._onLayerPainted, this);
51 this._currentlySelectedLayer = null; 51 this._currentlySelectedLayer = null;
52 this._currentlyHoveredLayer = null; 52 this._currentlyHoveredLayer = null;
53 53
54 this._layerTreeOutline = new WebInspector.LayerTreeOutline(this.sidebarTree) ; 54 this._layerTreeOutline = new WebInspector.LayerTreeOutline(this.sidebarTree) ;
55 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events .LayerSelected, this._onObjectSelected, this); 55 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events .LayerSelected, this._onObjectSelected, this);
56 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events .LayerHovered, this._onObjectHovered, this); 56 this._layerTreeOutline.addEventListener(WebInspector.LayerTreeOutline.Events .LayerHovered, this._onObjectHovered, this);
57 57
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 */ 214 */
215 reveal: function(snapshotData) 215 reveal: function(snapshotData)
216 { 216 {
217 if (!(snapshotData instanceof WebInspector.DeferredLayerTree)) 217 if (!(snapshotData instanceof WebInspector.DeferredLayerTree))
218 return; 218 return;
219 var panel = /** @type {?WebInspector.LayersPanel} */ (WebInspector.inspe ctorView.showPanel("layers")); 219 var panel = /** @type {?WebInspector.LayersPanel} */ (WebInspector.inspe ctorView.showPanel("layers"));
220 if (panel) 220 if (panel)
221 panel._showLayerTree(/** @type {!WebInspector.DeferredLayerTree} */ (snapshotData)); 221 panel._showLayerTree(/** @type {!WebInspector.DeferredLayerTree} */ (snapshotData));
222 } 222 }
223 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698