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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js

Issue 2534383002: DevTools: [SuggestBox] migrate suggestbox icons onto UI.Icon (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 * @unrestricted 5 * @unrestricted
6 */ 6 */
7 Console.ConsolePrompt = class extends UI.Widget { 7 Console.ConsolePrompt = class extends UI.Widget {
8 constructor() { 8 constructor() {
9 super(); 9 super();
10 this._addCompletionsFromHistory = true; 10 this._addCompletionsFromHistory = true;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 var text = this.text(); 211 var text = this.text();
212 var set = new Set(); 212 var set = new Set();
213 var data = this._history.historyData(); 213 var data = this._history.historyData();
214 for (var i = data.length - 1; i >= 0 && result.length < 50; --i) { 214 for (var i = data.length - 1; i >= 0 && result.length < 50; --i) {
215 var item = data[i]; 215 var item = data[i];
216 if (!item.startsWith(text)) 216 if (!item.startsWith(text))
217 continue; 217 continue;
218 if (set.has(item)) 218 if (set.has(item))
219 continue; 219 continue;
220 set.add(item); 220 set.add(item);
221 result.push({title: item.substring(text.length - prefix.length), className : 'additional'}); 221 result.push({title: item.substring(text.length - prefix.length), iconType: 'smallicon-text-prompt', isSecondary: true});
222 } 222 }
223 return result; 223 return result;
224 } 224 }
225 225
226 /** 226 /**
227 * @override 227 * @override
228 */ 228 */
229 focus() { 229 focus() {
230 if (this._editor) 230 if (this._editor)
231 this._editor.widget().focus(); 231 this._editor.widget().focus();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return this._currentHistoryItem(); 356 return this._currentHistoryItem();
357 } 357 }
358 358
359 /** 359 /**
360 * @return {string|undefined} 360 * @return {string|undefined}
361 */ 361 */
362 _currentHistoryItem() { 362 _currentHistoryItem() {
363 return this._data[this._data.length - this._historyOffset]; 363 return this._data[this._data.length - this._historyOffset];
364 } 364 }
365 }; 365 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698