| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 * @return {?WebInspector.Target} | 1124 * @return {?WebInspector.Target} |
| 1125 */ | 1125 */ |
| 1126 target: function() | 1126 target: function() |
| 1127 { | 1127 { |
| 1128 return this._target; | 1128 return this._target; |
| 1129 } | 1129 } |
| 1130 }; | 1130 }; |
| 1131 | 1131 |
| 1132 /** | 1132 /** |
| 1133 * @constructor | 1133 * @constructor |
| 1134 * @extends {WebInspector.DeferredLayerTree} | |
| 1135 * @param {?WebInspector.Target} target | |
| 1136 * @param {!Array.<!LayerTreeAgent.Layer>} layers | |
| 1137 */ | |
| 1138 WebInspector.DeferredAgentLayerTree = function(target, layers) | |
| 1139 { | |
| 1140 WebInspector.DeferredLayerTree.call(this, target); | |
| 1141 this._layers = layers; | |
| 1142 } | |
| 1143 | |
| 1144 WebInspector.DeferredAgentLayerTree.prototype = { | |
| 1145 /** | |
| 1146 * @param {function(!WebInspector.LayerTreeBase)} callback | |
| 1147 */ | |
| 1148 resolve: function(callback) | |
| 1149 { | |
| 1150 var result = new WebInspector.AgentLayerTree(this._target); | |
| 1151 result.setLayers(this._layers, callback.bind(null, result)); | |
| 1152 }, | |
| 1153 | |
| 1154 __proto__: WebInspector.DeferredLayerTree.prototype | |
| 1155 }; | |
| 1156 | |
| 1157 /** | |
| 1158 * @constructor | |
| 1159 * @implements {LayerTreeAgent.Dispatcher} | 1134 * @implements {LayerTreeAgent.Dispatcher} |
| 1160 * @param {!WebInspector.LayerTreeModel} layerTreeModel | 1135 * @param {!WebInspector.LayerTreeModel} layerTreeModel |
| 1161 */ | 1136 */ |
| 1162 WebInspector.LayerTreeDispatcher = function(layerTreeModel) | 1137 WebInspector.LayerTreeDispatcher = function(layerTreeModel) |
| 1163 { | 1138 { |
| 1164 this._layerTreeModel = layerTreeModel; | 1139 this._layerTreeModel = layerTreeModel; |
| 1165 } | 1140 } |
| 1166 | 1141 |
| 1167 WebInspector.LayerTreeDispatcher.prototype = { | 1142 WebInspector.LayerTreeDispatcher.prototype = { |
| 1168 /** | 1143 /** |
| 1169 * @param {!Array.<!LayerTreeAgent.Layer>=} layers | 1144 * @param {!Array.<!LayerTreeAgent.Layer>=} layers |
| 1170 */ | 1145 */ |
| 1171 layerTreeDidChange: function(layers) | 1146 layerTreeDidChange: function(layers) |
| 1172 { | 1147 { |
| 1173 this._layerTreeModel._layerTreeChanged(layers || null); | 1148 this._layerTreeModel._layerTreeChanged(layers || null); |
| 1174 }, | 1149 }, |
| 1175 | 1150 |
| 1176 /** | 1151 /** |
| 1177 * @param {!LayerTreeAgent.LayerId} layerId | 1152 * @param {!LayerTreeAgent.LayerId} layerId |
| 1178 * @param {!DOMAgent.Rect} clipRect | 1153 * @param {!DOMAgent.Rect} clipRect |
| 1179 */ | 1154 */ |
| 1180 layerPainted: function(layerId, clipRect) | 1155 layerPainted: function(layerId, clipRect) |
| 1181 { | 1156 { |
| 1182 this._layerTreeModel._layerPainted(layerId, clipRect); | 1157 this._layerTreeModel._layerPainted(layerId, clipRect); |
| 1183 } | 1158 } |
| 1184 } | 1159 } |
| OLD | NEW |