| OLD | NEW |
| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 delete this._pendingRequestLayersCallbacks; | 102 delete this._pendingRequestLayersCallbacks; |
| 103 } | 103 } |
| 104 function onDocumentAvailable() | 104 function onDocumentAvailable() |
| 105 { | 105 { |
| 106 LayerTreeAgent.getLayers(undefined, onGetLayers.bind(this)) | 106 LayerTreeAgent.getLayers(undefined, onGetLayers.bind(this)) |
| 107 } | 107 } |
| 108 WebInspector.domAgent.requestDocument(onDocumentAvailable.bind(this)); | 108 WebInspector.domAgent.requestDocument(onDocumentAvailable.bind(this)); |
| 109 }, | 109 }, |
| 110 | 110 |
| 111 /** | 111 /** |
| 112 * @param {string} id |
| 113 * @return {WebInspector.Layer?} |
| 114 */ |
| 115 layerById: function(id) |
| 116 { |
| 117 return this._layersById[id]; |
| 118 }, |
| 119 |
| 120 /** |
| 112 * @param{Array.<LayerTreeAgent.Layer>} payload | 121 * @param{Array.<LayerTreeAgent.Layer>} payload |
| 113 */ | 122 */ |
| 114 _repopulate: function(payload) | 123 _repopulate: function(payload) |
| 115 { | 124 { |
| 116 var oldLayersById = this._layersById; | 125 var oldLayersById = this._layersById; |
| 117 this._layersById = {}; | 126 this._layersById = {}; |
| 118 for (var i = 0; i < payload.length; ++i) { | 127 for (var i = 0; i < payload.length; ++i) { |
| 119 var layer = oldLayersById[payload[i].layerId]; | 128 var layer = oldLayersById[payload[i].layerId]; |
| 120 if (layer) | 129 if (layer) |
| 121 layer._reset(payload[i]); | 130 layer._reset(payload[i]); |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 { | 269 { |
| 261 this._layerTreeModel = layerTreeModel; | 270 this._layerTreeModel = layerTreeModel; |
| 262 } | 271 } |
| 263 | 272 |
| 264 WebInspector.LayerTreeDispatcher.prototype = { | 273 WebInspector.LayerTreeDispatcher.prototype = { |
| 265 layerTreeDidChange: function() | 274 layerTreeDidChange: function() |
| 266 { | 275 { |
| 267 this._layerTreeModel._layerTreeChanged(); | 276 this._layerTreeModel._layerTreeChanged(); |
| 268 } | 277 } |
| 269 } | 278 } |
| OLD | NEW |