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

Unified Diff: Source/devtools/front_end/common/Console.js

Issue 396993003: DevTools: get rid of WebInspector.cssModel, use target models instead (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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/audits/AuditsPanel.js ('k') | Source/devtools/front_end/console/ConsolePanel.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « Source/devtools/front_end/audits/AuditsPanel.js ('k') | Source/devtools/front_end/console/ConsolePanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698