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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js

Issue 1416793005: Devtools: API To set the red/yellow squiggles for a file via DI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update API with feedback from cl Created 5 years, 2 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
Index: third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
index 9ebaf88253665bbc300aa83df6e6dd1632a4876f..9ef97bf22ce3214142cc04a7b4bab32066beb622 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -39,6 +39,8 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode)
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyChanged, this._onWorkingCopyChanged, this);
this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.WorkingCopyCommitted, this._onWorkingCopyCommitted, this);
+ this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageAdded, this._onMessageAdded, this);
+ this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.MessageRemoved, this._onMessageRemoved, this);
this._updateStyle();
}
@@ -93,6 +95,24 @@ WebInspector.UISourceCodeFrame.prototype = {
this._uiSourceCode.checkContentUpdated();
},
+ /**
+ * @param {!WebInspector.Event} evt
+ */
+ _onMessageAdded: function(evt)
+ {
+ var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data);
+ this.addMessageToSource(new WebInspector.SourceFrameMessage(m.text(), m.level(), m.location()));
+ },
+
+ /**
+ * @param {!WebInspector.Event} evt
+ */
+ _onMessageRemoved: function(evt)
+ {
+ var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data);
+ this.removeMessageFromSource(new WebInspector.SourceFrameMessage(m.text(), m.level(), m.location()));
+ },
+
commitEditing: function()
{
if (!this._uiSourceCode.isDirty())

Powered by Google App Engine
This is Rietveld 408576698