| 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 {string} name | 10 * @param {string} name |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 */ | 328 */ |
| 329 targetAdded: function(target) { }, | 329 targetAdded: function(target) { }, |
| 330 | 330 |
| 331 /** | 331 /** |
| 332 * @param {!WebInspector.Target} target | 332 * @param {!WebInspector.Target} target |
| 333 */ | 333 */ |
| 334 targetRemoved: function(target) { }, | 334 targetRemoved: function(target) { }, |
| 335 } | 335 } |
| 336 | 336 |
| 337 /** | 337 /** |
| 338 * @constructor | |
| 339 * @implements {WebInspector.TargetManager.Observer} | |
| 340 * @param {?WebInspector.Target} target | |
| 341 */ | |
| 342 WebInspector.TargetObserver = function(target) | |
| 343 { | |
| 344 this._target = target; | |
| 345 if (target) | |
| 346 WebInspector.targetManager.observeTargets(this); | |
| 347 } | |
| 348 | |
| 349 WebInspector.TargetObserver.prototype = { | |
| 350 /** | |
| 351 * @param {!WebInspector.Target} target | |
| 352 */ | |
| 353 targetAdded: function(target) { }, | |
| 354 | |
| 355 /** | |
| 356 * @param {!WebInspector.Target} target | |
| 357 */ | |
| 358 targetRemoved: function(target) | |
| 359 { | |
| 360 if (this._target === target) { | |
| 361 this._target = null; | |
| 362 WebInspector.targetManager.unobserveTargets(this); | |
| 363 } | |
| 364 }, | |
| 365 | |
| 366 /** | |
| 367 * @return {?WebInspector.Target} | |
| 368 */ | |
| 369 target: function() | |
| 370 { | |
| 371 return this._target; | |
| 372 } | |
| 373 } | |
| 374 | |
| 375 /** | |
| 376 * @type {!WebInspector.TargetManager} | 338 * @type {!WebInspector.TargetManager} |
| 377 */ | 339 */ |
| 378 WebInspector.targetManager = new WebInspector.TargetManager(); | 340 WebInspector.targetManager = new WebInspector.TargetManager(); |
| OLD | NEW |