Index: Source/devtools/front_end/ConsoleModel.js |
diff --git a/Source/devtools/front_end/ConsoleModel.js b/Source/devtools/front_end/ConsoleModel.js |
index 67eb4068a67d69776ff5433bbf93d6559db1ff50..29be78c5c00ac7778bf901c2a1095d4d095eea0d 100644 |
--- a/Source/devtools/front_end/ConsoleModel.js |
+++ b/Source/devtools/front_end/ConsoleModel.js |
@@ -48,7 +48,8 @@ WebInspector.ConsoleModel = function(target) |
WebInspector.ConsoleModel.Events = { |
ConsoleCleared: "console-cleared", |
MessageAdded: "console-message-added", |
- RepeatCountUpdated: "repeat-count-updated" |
+ RepeatCountUpdated: "repeat-count-updated", |
+ EvaluationResultMessageAdded: "evaluation-result-message-added", |
vsevik
2014/03/20 13:22:46
Let's name it CommandEvaluated and include origina
sergeyv
2014/03/20 13:34:03
Done.
|
} |
WebInspector.ConsoleModel.prototype = { |
@@ -78,14 +79,6 @@ WebInspector.ConsoleModel.prototype = { |
}, |
/** |
- * @param {!WebInspector.ConsoleModel.UIDelegate} delegate |
- */ |
- setUIDelegate: function(delegate) |
- { |
- this._uiDelegate = delegate; |
- }, |
- |
- /** |
* @param {!WebInspector.ConsoleMessage} msg |
* @param {boolean=} isFromBackend |
*/ |
@@ -108,20 +101,15 @@ WebInspector.ConsoleModel.prototype = { |
/** |
* @param {string} text |
- * @param {?string} newPromptText |
* @param {boolean} useCommandLineAPI |
*/ |
- evaluateCommand: function(text, newPromptText, useCommandLineAPI) |
+ evaluateCommand: function(text, useCommandLineAPI) |
{ |
- if (!this._uiDelegate) |
- this.show(); |
+ this.show(); |
var commandMessage = new WebInspector.ConsoleMessage(WebInspector.ConsoleMessage.MessageSource.JS, null, text, WebInspector.ConsoleMessage.MessageType.Command); |
this.addMessage(commandMessage); |
- if (newPromptText !== null) |
- this._uiDelegate.setPromptText(newPromptText); |
- |
/** |
* @param {?WebInspector.RemoteObject} result |
* @param {boolean} wasThrown |
@@ -133,7 +121,7 @@ WebInspector.ConsoleModel.prototype = { |
if (!result) |
return; |
- this._uiDelegate.printEvaluationResult(result, wasThrown, text, commandMessage); |
+ this.dispatchEventToListeners(WebInspector.ConsoleModel.Events.EvaluationResultMessageAdded, {result: result, wasThrown: wasThrown, text: text, commandMessage: commandMessage}); |
} |
this._target.runtimeModel.evaluate(text, "console", useCommandLineAPI, false, false, true, printResult.bind(this)); |
@@ -150,7 +138,7 @@ WebInspector.ConsoleModel.prototype = { |
*/ |
evaluate: function(expression) |
{ |
- this.evaluateCommand(expression, null, false); |
+ this.evaluateCommand(expression, false); |
}, |
/** |
@@ -241,26 +229,6 @@ WebInspector.ConsoleModel.prototype = { |
} |
/** |
- * @interface |
- */ |
-WebInspector.ConsoleModel.UIDelegate = function() { } |
- |
-WebInspector.ConsoleModel.UIDelegate.prototype = { |
- /** |
- * @param {string} text |
- */ |
- setPromptText: function(text) { }, |
- |
- /** |
- * @param {?WebInspector.RemoteObject} result |
- * @param {boolean} wasThrown |
- * @param {string} promptText |
- * @param {!WebInspector.ConsoleMessage} commandMessage |
- */ |
- printEvaluationResult: function(result, wasThrown, promptText, commandMessage) { } |
-} |
- |
-/** |
* @constructor |
* @param {string} source |
* @param {?string} level |