| 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 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.Widget} | 7 * @extends {WebInspector.Widget} |
| 8 */ | 8 */ |
| 9 WebInspector.ConsolePrompt = function() | 9 WebInspector.ConsolePrompt = function() |
| 10 { | 10 { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 /** | 199 /** |
| 200 * @param {string} text | 200 * @param {string} text |
| 201 * @param {boolean} useCommandLineAPI | 201 * @param {boolean} useCommandLineAPI |
| 202 */ | 202 */ |
| 203 _appendCommand: function(text, useCommandLineAPI) | 203 _appendCommand: function(text, useCommandLineAPI) |
| 204 { | 204 { |
| 205 this.setText(""); | 205 this.setText(""); |
| 206 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); | 206 var currentExecutionContext = WebInspector.context.flavor(WebInspector.E
xecutionContext); |
| 207 if (currentExecutionContext) { | 207 if (currentExecutionContext) { |
| 208 WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionC
ontext, text, useCommandLineAPI); | 208 WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionC
ontext, text, useCommandLineAPI); |
| 209 if (WebInspector.inspectorView.currentPanel() && WebInspector.inspec
torView.currentPanel().name === "console") | 209 if (WebInspector.ConsolePanel.instance().isShowing()) |
| 210 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Ac
tion.CommandEvaluatedInConsolePanel); | 210 WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Ac
tion.CommandEvaluatedInConsolePanel); |
| 211 } | 211 } |
| 212 }, | 212 }, |
| 213 | 213 |
| 214 _enterProcessedForTest: function() { }, | 214 _enterProcessedForTest: function() { }, |
| 215 | 215 |
| 216 /** | 216 /** |
| 217 * @param {string} prefix | 217 * @param {string} prefix |
| 218 * @return {!WebInspector.SuggestBox.Suggestions} | 218 * @return {!WebInspector.SuggestBox.Suggestions} |
| 219 */ | 219 */ |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 function innerWordsWithPrefix(words) | 285 function innerWordsWithPrefix(words) |
| 286 { | 286 { |
| 287 fulfill(words.map(item => ({title:item})).concat(historyWords)); | 287 fulfill(words.map(item => ({title:item})).concat(historyWords)); |
| 288 } | 288 } |
| 289 }, | 289 }, |
| 290 | 290 |
| 291 _editorSetForTest: function() { }, | 291 _editorSetForTest: function() { }, |
| 292 | 292 |
| 293 __proto__: WebInspector.Widget.prototype | 293 __proto__: WebInspector.Widget.prototype |
| 294 } | 294 } |
| OLD | NEW |