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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js

Issue 2916743002: [DevTools] Introduce Common.List used as a backend for list controls (Closed)
Patch Set: addressed comments Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
index 80095851c8de7638e651bcc4674cf86009698e85..f193a3fa0ec942a9c212f971c5c5e209215363c3 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/ThreadsSidebarPane.js
@@ -10,8 +10,10 @@ Sources.ThreadsSidebarPane = class extends UI.VBox {
super(true);
this.registerRequiredCSS('sources/threadsSidebarPane.css');
+ /** @type {!UI.ListModel<!SDK.DebuggerModel>} */
+ this._items = new UI.ListModel();
/** @type {!UI.ListControl<!SDK.DebuggerModel>} */
- this._list = new UI.ListControl(this, UI.ListMode.NonViewport);
+ this._list = new UI.ListControl(this._items, this, UI.ListMode.NonViewport);
this.contentElement.appendChild(this._list.element);
UI.context.addFlavorChangeListener(SDK.Target, this._targetFlavorChanged, this);
@@ -106,7 +108,7 @@ Sources.ThreadsSidebarPane = class extends UI.VBox {
* @param {!SDK.DebuggerModel} debuggerModel
*/
modelAdded(debuggerModel) {
- this._list.pushItem(debuggerModel);
+ this._items.pushItem(debuggerModel);
var currentTarget = UI.context.flavor(SDK.Target);
if (currentTarget === debuggerModel.target())
this._list.selectItem(debuggerModel);
@@ -117,7 +119,7 @@ Sources.ThreadsSidebarPane = class extends UI.VBox {
* @param {!SDK.DebuggerModel} debuggerModel
*/
modelRemoved(debuggerModel) {
- this._list.removeItem(debuggerModel);
+ this._items.removeItem(debuggerModel);
}
/**

Powered by Google App Engine
This is Rietveld 408576698