OLD | NEW |
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 } | 184 } |
185 | 185 |
186 /** | 186 /** |
187 * @param {string} text | 187 * @param {string} text |
188 * @param {boolean} useCommandLineAPI | 188 * @param {boolean} useCommandLineAPI |
189 */ | 189 */ |
190 _appendCommand(text, useCommandLineAPI) { | 190 _appendCommand(text, useCommandLineAPI) { |
191 this.setText(''); | 191 this.setText(''); |
192 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); | 192 var currentExecutionContext = UI.context.flavor(SDK.ExecutionContext); |
193 if (currentExecutionContext) { | 193 if (currentExecutionContext) { |
194 SDK.ConsoleModel.evaluateCommandInConsole(currentExecutionContext, text, u
seCommandLineAPI); | 194 SDK.consoleModel.evaluateCommandInConsole(currentExecutionContext, text, u
seCommandLineAPI); |
195 if (Console.ConsolePanel.instance().isShowing()) | 195 if (Console.ConsolePanel.instance().isShowing()) |
196 Host.userMetrics.actionTaken(Host.UserMetrics.Action.CommandEvaluatedInC
onsolePanel); | 196 Host.userMetrics.actionTaken(Host.UserMetrics.Action.CommandEvaluatedInC
onsolePanel); |
197 } | 197 } |
198 } | 198 } |
199 | 199 |
200 _enterProcessedForTest() { | 200 _enterProcessedForTest() { |
201 } | 201 } |
202 | 202 |
203 /** | 203 /** |
204 * @param {string} prefix | 204 * @param {string} prefix |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 return this._currentHistoryItem(); | 361 return this._currentHistoryItem(); |
362 } | 362 } |
363 | 363 |
364 /** | 364 /** |
365 * @return {string|undefined} | 365 * @return {string|undefined} |
366 */ | 366 */ |
367 _currentHistoryItem() { | 367 _currentHistoryItem() { |
368 return this._data[this._data.length - this._historyOffset]; | 368 return this._data[this._data.length - this._historyOffset]; |
369 } | 369 } |
370 }; | 370 }; |
OLD | NEW |