| 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 26 matching lines...) Expand all Loading... |
| 69 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.ta
rget); | 69 var debuggerModel = /** @type {!WebInspector.DebuggerModel} */ (event.ta
rget); |
| 70 this._updateDebuggerState(debuggerModel.target()); | 70 this._updateDebuggerState(debuggerModel.target()); |
| 71 }, | 71 }, |
| 72 | 72 |
| 73 /** | 73 /** |
| 74 * @param {!WebInspector.Target} target | 74 * @param {!WebInspector.Target} target |
| 75 */ | 75 */ |
| 76 _updateDebuggerState: function(target) | 76 _updateDebuggerState: function(target) |
| 77 { | 77 { |
| 78 var placard = this._targetsToPlacards.get(target); | 78 var placard = this._targetsToPlacards.get(target); |
| 79 placard.subtitle = target.debuggerModel.isPaused() ? WebInspector.UIStri
ng("Paused") : WebInspector.UIString("Running"); | 79 placard.subtitle = target.debuggerModel.isPaused() ? WebInspector.UIStri
ng("paused") : WebInspector.UIString(""); |
| 80 }, | 80 }, |
| 81 | 81 |
| 82 /** | 82 /** |
| 83 * @param {!WebInspector.Placard} placard | 83 * @param {!WebInspector.Placard} placard |
| 84 */ | 84 */ |
| 85 _selectPlacard: function(placard) | 85 _selectPlacard: function(placard) |
| 86 { | 86 { |
| 87 if (placard === this._selectedPlacard) | 87 if (placard === this._selectedPlacard) |
| 88 return; | 88 return; |
| 89 | 89 |
| 90 if (this._selectedPlacard) | 90 if (this._selectedPlacard) |
| 91 this._selectedPlacard.selected = false; | 91 this._selectedPlacard.selected = false; |
| 92 | 92 |
| 93 this._selectedPlacard = placard; | 93 this._selectedPlacard = placard; |
| 94 placard.selected = true; | 94 placard.selected = true; |
| 95 }, | 95 }, |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * @param {!WebInspector.Placard} placard | 98 * @param {!WebInspector.Placard} placard |
| 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 |