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

Side by Side Diff: Source/devtools/front_end/sdk/Target.js

Issue 388303002: DevTools: Get rid of WebInspector.TargetObserver (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
« no previous file with comments | « Source/devtools/front_end/profiler/ProfilesPanel.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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();
OLDNEW
« no previous file with comments | « Source/devtools/front_end/profiler/ProfilesPanel.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698