OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.SidebarPane} | 7 * @extends {WebInspector.SidebarPane} |
8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
9 */ | 9 */ |
10 WebInspector.ThreadsSidebarPane = function() | 10 WebInspector.ThreadsSidebarPane = function() |
(...skipping 11 matching lines...) Expand all Loading... |
22 WebInspector.targetManager.observeTargets(this); | 22 WebInspector.targetManager.observeTargets(this); |
23 } | 23 } |
24 | 24 |
25 WebInspector.ThreadsSidebarPane.prototype = { | 25 WebInspector.ThreadsSidebarPane.prototype = { |
26 | 26 |
27 /** | 27 /** |
28 * @param {!WebInspector.Target} target | 28 * @param {!WebInspector.Target} target |
29 */ | 29 */ |
30 targetAdded: function(target) | 30 targetAdded: function(target) |
31 { | 31 { |
32 var placard = new WebInspector.Placard(WebInspector.displayNameForURL(ta
rget.name()), ""); | 32 var placard = new WebInspector.Placard(target.name(), ""); |
33 placard.element.addEventListener("click", this._onPlacardClick.bind(this
, placard), false); | 33 placard.element.addEventListener("click", this._onPlacardClick.bind(this
, placard), false); |
34 var currentTarget = WebInspector.context.flavor(WebInspector.Target); | 34 var currentTarget = WebInspector.context.flavor(WebInspector.Target); |
35 if (currentTarget === target) | 35 if (currentTarget === target) |
36 this._selectPlacard(placard); | 36 this._selectPlacard(placard); |
37 | 37 |
38 this._targetsToPlacards.put(target, placard); | 38 this._targetsToPlacards.put(target, placard); |
39 this._placardsToTargets.put(placard, target); | 39 this._placardsToTargets.put(placard, target); |
40 this.bodyElement.appendChild(placard.element); | 40 this.bodyElement.appendChild(placard.element); |
41 this._updateDebuggerState(target); | 41 this._updateDebuggerState(target); |
42 }, | 42 }, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 */ | 99 */ |
100 _onPlacardClick: function(placard) | 100 _onPlacardClick: function(placard) |
101 { | 101 { |
102 WebInspector.context.setFlavor(WebInspector.Target, this._placardsToTarg
ets.get(placard)); | 102 WebInspector.context.setFlavor(WebInspector.Target, this._placardsToTarg
ets.get(placard)); |
103 placard.element.scrollIntoViewIfNeeded(); | 103 placard.element.scrollIntoViewIfNeeded(); |
104 }, | 104 }, |
105 | 105 |
106 | 106 |
107 __proto__: WebInspector.SidebarPane.prototype | 107 __proto__: WebInspector.SidebarPane.prototype |
108 } | 108 } |
OLD | NEW |