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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js

Issue 2916743002: [DevTools] Introduce Common.List used as a backend for list controls (Closed)
Patch Set: Tests.js 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/ui/SuggestBox.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
index 03e0c1240095d15a2b3bcd234324ee8a01de71bc..7c3badc2434caeae165592f78b2afdda5d78e499 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/SuggestBox.js
@@ -66,8 +66,10 @@ UI.SuggestBox = class {
/** @type {?string} */
this._onlyCompletion = null;
+ /** @type {!UI.ListModel<!UI.SuggestBox.Suggestion>} */
+ this._items = new UI.ListModel();
/** @type {!UI.ListControl<!UI.SuggestBox.Suggestion>} */
- this._list = new UI.ListControl(this, UI.ListMode.EqualHeightItems);
+ this._list = new UI.ListControl(this._items, this, UI.ListMode.EqualHeightItems);
this._element = this._list.element;
this._element.classList.add('suggest-box');
this._element.addEventListener('mousedown', event => event.preventDefault(), true);
@@ -316,7 +318,7 @@ UI.SuggestBox = class {
this._updateMaxSize(completions);
this._glassPane.setContentAnchorBox(anchorBox);
this._list.invalidateItemHeight();
- this._list.replaceAllItems(completions);
+ this._items.replaceAllItems(completions);
if (selectHighestPriority) {
var highestPriorityItem = completions[0];

Powered by Google App Engine
This is Rietveld 408576698