Index: Source/devtools/front_end/common/Console.js |
diff --git a/Source/devtools/front_end/common/Console.js b/Source/devtools/front_end/common/Console.js |
index 5bdeb7923edc139848694a0391c878b5342815c5..02c5386cb4a9ba5cdf3d792b0f6e13739fd9a728 100644 |
--- a/Source/devtools/front_end/common/Console.js |
+++ b/Source/devtools/front_end/common/Console.js |
@@ -43,8 +43,27 @@ WebInspector.Console.Message = function(text, level, timestamp, show) |
this.show = show; |
} |
+/** |
+ * @interface |
+ */ |
+WebInspector.Console.UIDelegate = function() |
+{ |
+} |
+ |
+WebInspector.Console.UIDelegate.prototype = { |
+ showConsole: function() { } |
+} |
+ |
WebInspector.Console.prototype = { |
/** |
+ * @param {!WebInspector.Console.UIDelegate} uiDelegate |
+ */ |
+ setUIDelegate: function(uiDelegate) |
+ { |
+ this._uiDelegate = uiDelegate; |
+ }, |
+ |
+ /** |
* @param {string} text |
* @param {!WebInspector.Console.MessageLevel} level |
* @param {boolean=} show |
@@ -58,11 +77,26 @@ WebInspector.Console.prototype = { |
/** |
* @param {string} text |
- * @param {boolean=} show |
*/ |
- addErrorMessage: function(text, show) |
+ log: function(text) |
+ { |
+ this.addMessage(text, WebInspector.Console.MessageLevel.Log); |
+ }, |
+ |
+ /** |
+ * @param {string} text |
+ */ |
+ warn: function(text) |
+ { |
+ this.addMessage(text, WebInspector.Console.MessageLevel.Warning); |
+ }, |
+ |
+ /** |
+ * @param {string} text |
+ */ |
+ error: function(text) |
{ |
- this.addMessage(text, WebInspector.Console.MessageLevel.Error, show); |
+ this.addMessage(text, WebInspector.Console.MessageLevel.Error, true); |
}, |
/** |
@@ -73,6 +107,12 @@ WebInspector.Console.prototype = { |
return this._messages; |
}, |
+ show: function() |
+ { |
+ if (this._uiDelegate) |
+ this._uiDelegate.showConsole(); |
+ }, |
+ |
__proto__: WebInspector.Object.prototype |
} |