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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2361273002: DevTools: Move "enter" logic from ConsoleView to ConsolePrompt (Closed)
Patch Set: Fix browser tests Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
index b9614d6a18696f964768eeac66422ab612f731b2..403c29baa82d7b12228cf68d010af0a77c28ce71 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -777,9 +777,6 @@ WebInspector.ConsoleView.prototype = {
if (keyboardEvent.key === "PageUp") {
this._updateStickToBottomOnWheel();
return;
- } else if (isEnterKey(keyboardEvent)) {
- this._enterKeyPressed(keyboardEvent);
- return;
}
var shortcut = WebInspector.KeyboardShortcut.makeKeyFromEvent(keyboardEvent);
@@ -790,44 +787,6 @@ WebInspector.ConsoleView.prototype = {
}
},
- _enterKeyPressed: function(event)
- {
- if (event.altKey || event.ctrlKey || event.shiftKey)
- return;
-
- event.consume(true);
-
- this._prompt.clearAutocomplete();
-
- var str = this._prompt.text();
- if (!str.length)
- return;
-
- var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- if (!this._prompt.isCaretAtEndOfPrompt() || !currentExecutionContext) {
- this._appendCommand(str, true);
- return;
- }
- currentExecutionContext.target().runtimeModel.compileScript(str, "", false, currentExecutionContext.id, compileCallback.bind(this));
-
- /**
- * @param {!RuntimeAgent.ScriptId=} scriptId
- * @param {?RuntimeAgent.ExceptionDetails=} exceptionDetails
- * @this {WebInspector.ConsoleView}
- */
- function compileCallback(scriptId, exceptionDetails)
- {
- if (str !== this._prompt.text())
- return;
- if (exceptionDetails && (exceptionDetails.exception.description === "SyntaxError: Unexpected end of input"
- || exceptionDetails.exception.description === "SyntaxError: Unterminated template literal")) {
- this._prompt.newlineAndIndent();
- return;
- }
- this._appendCommand(str, true);
- }
- },
-
/**
* @param {?WebInspector.RemoteObject} result
* @param {!WebInspector.ConsoleMessage} originatingConsoleMessage
@@ -849,21 +808,6 @@ WebInspector.ConsoleView.prototype = {
},
/**
- * @param {string} text
- * @param {boolean} useCommandLineAPI
- */
- _appendCommand: function(text, useCommandLineAPI)
- {
- this._prompt.setText("");
- var currentExecutionContext = WebInspector.context.flavor(WebInspector.ExecutionContext);
- if (currentExecutionContext) {
- WebInspector.ConsoleModel.evaluateCommandInConsole(currentExecutionContext, text, useCommandLineAPI);
- if (WebInspector.inspectorView.currentPanel() && WebInspector.inspectorView.currentPanel().name === "console")
- WebInspector.userMetrics.actionTaken(WebInspector.UserMetrics.Action.CommandEvaluatedInConsolePanel);
- }
- },
-
- /**
* @param {!WebInspector.Event} event
*/
_commandEvaluated: function(event)
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/console/ConsolePrompt.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698