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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.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/CallStackSidebarPane.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
index 73503b4ca28c7e41a80716b46e53ae39d25f18f5..4c30a89d61bf00328c23bd135480646ec9358876 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/CallStackSidebarPane.js
@@ -39,8 +39,10 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
this._notPausedMessageElement = this.contentElement.createChild('div', 'gray-info-message');
this._notPausedMessageElement.textContent = Common.UIString('Not Paused');
+ /** @type {!UI.ListModel<!Sources.CallStackSidebarPane.Item>} */
+ this._items = new UI.ListModel();
/** @type {!UI.ListControl<!Sources.CallStackSidebarPane.Item>} */
- 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);
this._list.element.addEventListener('contextmenu', this._onContextMenu.bind(this), false);
this._list.element.addEventListener('click', this._onClick.bind(this), false);
@@ -68,7 +70,7 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
if (!details) {
this._notPausedMessageElement.classList.remove('hidden');
this._blackboxedMessageElement.classList.add('hidden');
- this._list.replaceAllItems([]);
+ this._items.replaceAllItems([]);
this._debuggerModel = null;
UI.context.setFlavor(SDK.DebuggerModel.CallFrame, null);
return;
@@ -139,7 +141,7 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
this._blackboxedMessageElement.classList.remove('hidden');
}
- this._list.replaceAllItems(items);
+ this._items.replaceAllItems(items);
this._list.selectNextItem(true /* canWrap */, false /* center */);
}
@@ -357,8 +359,8 @@ Sources.CallStackSidebarPane = class extends UI.SimpleView {
_copyStackTrace() {
var text = [];
- for (var i = 0; i < this._list.length(); i++) {
- var item = this._list.itemAtIndex(i);
+ for (var i = 0; i < this._items.length(); i++) {
+ var item = this._items.itemAtIndex(i);
if (item.promiseCreationFrame)
continue;
var itemText = this._itemTitle(item);

Powered by Google App Engine
This is Rietveld 408576698