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

Unified Diff: Source/devtools/front_end/ConsoleView.js

Issue 206253005: DevTools: Get rid of WebInspector.ConsoleModel.UIDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address vsevik's comments Created 6 years, 9 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 | « Source/devtools/front_end/ConsolePanel.js ('k') | Source/devtools/front_end/JavaScriptSourceFrame.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ConsoleView.js
diff --git a/Source/devtools/front_end/ConsoleView.js b/Source/devtools/front_end/ConsoleView.js
index 56b064c94859d834c27076ec352b4d1f25829388..f1765a402f521f94ae09d2e7c01c3afc4b18827c 100644
--- a/Source/devtools/front_end/ConsoleView.js
+++ b/Source/devtools/front_end/ConsoleView.js
@@ -29,7 +29,6 @@
/**
* @extends {WebInspector.VBox}
- * @implements {WebInspector.ConsoleModel.UIDelegate}
* @implements {WebInspector.Searchable}
* @constructor
* @param {boolean} hideContextSelector
@@ -101,6 +100,7 @@ WebInspector.ConsoleView = function(hideContextSelector)
WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.MessageAdded, this._onConsoleMessageAdded, this);
WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.ConsoleCleared, this._consoleCleared, this);
WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.RepeatCountUpdated, this._repeatCountUpdated, this);
+ WebInspector.console.addEventListener(WebInspector.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this);
this._linkifier = new WebInspector.Linkifier();
@@ -670,7 +670,7 @@ WebInspector.ConsoleView.prototype = {
var str = this.prompt.text;
if (!str.length)
return;
- this._appendCommand(str, "", true);
+ this._appendCommand(str, true);
},
/**
@@ -731,35 +731,23 @@ WebInspector.ConsoleView.prototype = {
/**
* @param {string} text
- * @param {string} newPromptText
* @param {boolean} useCommandLineAPI
*/
- _appendCommand: function(text, newPromptText, useCommandLineAPI)
+ _appendCommand: function(text, useCommandLineAPI)
{
- WebInspector.console.evaluateCommand(text, newPromptText, useCommandLineAPI);
+ this.prompt.text = "";
+ WebInspector.console.evaluateCommand(text, useCommandLineAPI);
},
/**
- * @override
- * @param {string} text
- */
- setPromptText: function(text)
- {
- this.prompt.text = text;
- },
-
- /**
- * @override
- * @param {?WebInspector.RemoteObject} result
- * @param {boolean} wasThrown
- * @param {string} promptText
- * @param {!WebInspector.ConsoleMessage} commandMessage
+ * @param {!WebInspector.Event} event
*/
- printEvaluationResult: function(result, wasThrown, promptText, commandMessage)
+ _commandEvaluated: function(event)
{
- this.prompt.pushHistoryItem(promptText);
+ var data = /**{{result: ?WebInspector.RemoteObject, wasThrown: boolean, text: string, commandMessage: !WebInspector.ConsoleMessage}} */ (event.data);
+ this.prompt.pushHistoryItem(data.text);
WebInspector.settings.consoleHistory.set(this.prompt.historyData.slice(-30));
- this._printResult(result, wasThrown, /** @type {!WebInspector.ConsoleCommand} */ (this._messageToViewMessage.get(commandMessage)));
+ this._printResult(data.result, data.wasThrown, /** @type {!WebInspector.ConsoleCommand} */ (this._messageToViewMessage.get(data.commandMessage)));
},
/**
« no previous file with comments | « Source/devtools/front_end/ConsolePanel.js ('k') | Source/devtools/front_end/JavaScriptSourceFrame.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698