OLD | NEW |
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 {Protocol.Agents} | 9 * @extends {Protocol.Agents} |
10 * @param {!InspectorBackendClass.Connection} connection | 10 * @param {!InspectorBackendClass.Connection} connection |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 this._observers = []; | 224 this._observers = []; |
225 } | 225 } |
226 | 226 |
227 WebInspector.TargetManager.prototype = { | 227 WebInspector.TargetManager.prototype = { |
228 | 228 |
229 /** | 229 /** |
230 * @param {!WebInspector.TargetManager.Observer} targetObserver | 230 * @param {!WebInspector.TargetManager.Observer} targetObserver |
231 */ | 231 */ |
232 observeTargets: function(targetObserver) | 232 observeTargets: function(targetObserver) |
233 { | 233 { |
234 WebInspector.targetManager.targets().forEach(targetObserver.targetAdded.
bind(targetObserver)); | 234 this.targets().forEach(targetObserver.targetAdded.bind(targetObserver)); |
235 this._observers.push(targetObserver); | 235 this._observers.push(targetObserver); |
236 }, | 236 }, |
237 | 237 |
238 /** | 238 /** |
| 239 * @param {!WebInspector.TargetManager.Observer} targetObserver |
| 240 */ |
| 241 unobserveTargets: function(targetObserver) |
| 242 { |
| 243 this._observers.remove(targetObserver); |
| 244 }, |
| 245 |
| 246 /** |
239 * @param {!InspectorBackendClass.Connection} connection | 247 * @param {!InspectorBackendClass.Connection} connection |
240 * @param {function(!WebInspector.Target)=} callback | 248 * @param {function(!WebInspector.Target)=} callback |
241 */ | 249 */ |
242 createTarget: function(connection, callback) | 250 createTarget: function(connection, callback) |
243 { | 251 { |
244 var target = new WebInspector.Target(connection, callbackWrapper.bind(th
is)); | 252 var target = new WebInspector.Target(connection, callbackWrapper.bind(th
is)); |
245 | 253 |
246 /** | 254 /** |
247 * @this {WebInspector.TargetManager} | 255 * @this {WebInspector.TargetManager} |
248 * @param newTarget | 256 * @param newTarget |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 /** | 300 /** |
293 * @param {!WebInspector.Target} target | 301 * @param {!WebInspector.Target} target |
294 */ | 302 */ |
295 targetRemoved: function(target) { }, | 303 targetRemoved: function(target) { }, |
296 } | 304 } |
297 | 305 |
298 /** | 306 /** |
299 * @type {!WebInspector.TargetManager} | 307 * @type {!WebInspector.TargetManager} |
300 */ | 308 */ |
301 WebInspector.targetManager; | 309 WebInspector.targetManager; |
OLD | NEW |