| 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.View} |
| 8 * @implements {WebInspector.TargetManager.Observer} | 8 * @implements {WebInspector.TargetManager.Observer} |
| 9 */ | 9 */ |
| 10 WebInspector.ThreadsSidebarPane = function() | 10 WebInspector.ThreadsSidebarPane = function() |
| 11 { | 11 { |
| 12 WebInspector.SidebarPane.call(this, WebInspector.UIString("Threads")); | 12 WebInspector.View.call(this, WebInspector.UIString("Threads")); |
| 13 this.setVisible(false); | 13 this.requestSetVisible(false); |
| 14 | 14 |
| 15 /** @type {!Map.<!WebInspector.DebuggerModel, !WebInspector.UIList.Item>} */ | 15 /** @type {!Map.<!WebInspector.DebuggerModel, !WebInspector.UIList.Item>} */ |
| 16 this._debuggerModelToListItems = new Map(); | 16 this._debuggerModelToListItems = new Map(); |
| 17 /** @type {!Map.<!WebInspector.UIList.Item, !WebInspector.Target>} */ | 17 /** @type {!Map.<!WebInspector.UIList.Item, !WebInspector.Target>} */ |
| 18 this._listItemsToTargets = new Map(); | 18 this._listItemsToTargets = new Map(); |
| 19 /** @type {?WebInspector.UIList.Item} */ | 19 /** @type {?WebInspector.UIList.Item} */ |
| 20 this._selectedListItem = null; | 20 this._selectedListItem = null; |
| 21 this.threadList = new WebInspector.UIList(); | 21 this.threadList = new WebInspector.UIList(); |
| 22 this.threadList.show(this.element); | 22 this.threadList.show(this.element); |
| 23 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI
nspector.DebuggerModel.Events.DebuggerPaused, this._onDebuggerStateChanged, this
); | 23 WebInspector.targetManager.addModelListener(WebInspector.DebuggerModel, WebI
nspector.DebuggerModel.Events.DebuggerPaused, this._onDebuggerStateChanged, this
); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 51 this._debuggerModelToListItems.set(debuggerModel, listItem); | 51 this._debuggerModelToListItems.set(debuggerModel, listItem); |
| 52 this._listItemsToTargets.set(listItem, target); | 52 this._listItemsToTargets.set(listItem, target); |
| 53 this.threadList.addItem(listItem); | 53 this.threadList.addItem(listItem); |
| 54 this._updateDebuggerState(debuggerModel); | 54 this._updateDebuggerState(debuggerModel); |
| 55 this._updateVisibility(); | 55 this._updateVisibility(); |
| 56 }, | 56 }, |
| 57 | 57 |
| 58 _updateVisibility: function() | 58 _updateVisibility: function() |
| 59 { | 59 { |
| 60 this._wasVisibleAtLeastOnce = this._wasVisibleAtLeastOnce || this._debug
gerModelToListItems.size > 1; | 60 this._wasVisibleAtLeastOnce = this._wasVisibleAtLeastOnce || this._debug
gerModelToListItems.size > 1; |
| 61 this.setVisible(this._wasVisibleAtLeastOnce); | 61 this.requestSetVisible(this._wasVisibleAtLeastOnce); |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 /** | 64 /** |
| 65 * @override | 65 * @override |
| 66 * @param {!WebInspector.Target} target | 66 * @param {!WebInspector.Target} target |
| 67 */ | 67 */ |
| 68 targetRemoved: function(target) | 68 targetRemoved: function(target) |
| 69 { | 69 { |
| 70 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target) | 70 var debuggerModel = WebInspector.DebuggerModel.fromTarget(target) |
| 71 if (!debuggerModel) | 71 if (!debuggerModel) |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 /** | 141 /** |
| 142 * @param {!WebInspector.UIList.Item} listItem | 142 * @param {!WebInspector.UIList.Item} listItem |
| 143 */ | 143 */ |
| 144 _onListItemClick: function(listItem) | 144 _onListItemClick: function(listItem) |
| 145 { | 145 { |
| 146 WebInspector.context.setFlavor(WebInspector.Target, this._listItemsToTar
gets.get(listItem)); | 146 WebInspector.context.setFlavor(WebInspector.Target, this._listItemsToTar
gets.get(listItem)); |
| 147 listItem.element.scrollIntoViewIfNeeded(); | 147 listItem.element.scrollIntoViewIfNeeded(); |
| 148 }, | 148 }, |
| 149 | 149 |
| 150 | 150 |
| 151 __proto__: WebInspector.SidebarPane.prototype | 151 __proto__: WebInspector.View.prototype |
| 152 } | 152 } |
| OLD | NEW |