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

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: address comments + better centering 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/Icon.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
222 {title: item.substring(text.length - prefix.length), iconType: 'smalli con-text-prompt', isSecondary: true});
222 } 223 }
223 return result; 224 return result;
224 } 225 }
225 226
226 /** 227 /**
227 * @override 228 * @override
228 */ 229 */
229 focus() { 230 focus() {
230 if (this._editor) 231 if (this._editor)
231 this._editor.widget().focus(); 232 this._editor.widget().focus();
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 return this._currentHistoryItem(); 357 return this._currentHistoryItem();
357 } 358 }
358 359
359 /** 360 /**
360 * @return {string|undefined} 361 * @return {string|undefined}
361 */ 362 */
362 _currentHistoryItem() { 363 _currentHistoryItem() {
363 return this._data[this._data.length - this._historyOffset]; 364 return this._data[this._data.length - this._historyOffset];
364 } 365 }
365 }; 366 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/Icon.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698