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

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: event-based design 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..15f3a91a12186fb731d3866f885383928c241116 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.LineMessageAdded, this._onLineMessageAdded, this);
+ this._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.LineMessageRemoved, this._onLineMessageRemoved, this);
this._updateStyle();
}
@@ -93,6 +95,16 @@ WebInspector.UISourceCodeFrame.prototype = {
this._uiSourceCode.checkContentUpdated();
},
+ _onLineMessageAdded: function(evt) {
pfeldman 2015/10/27 17:37:34 Here and below, { goes the next line. Annotate evt
wes 2015/10/27 21:59:16 Acknowledged.
+ var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data);
+ this.addMessageToSource(new WebInspector.SourceFrameMessage(m.text(), WebInspector.SourceFrameMessage.Level[m.kind()], m.location()));
pfeldman 2015/10/27 17:37:34 Lets move the level enum into the UISourceCodeMess
wes 2015/10/27 21:59:16 The actual enum is going to need to be moved out o
+ },
+
+ _onLineMessageRemoved: function(evt) {
pfeldman 2015/10/27 17:37:34 ditto
wes 2015/10/27 21:59:16 Acknowledged.
+ var m = /** @type {!WebInspector.UISourceCodeMessage} */ (evt.data);
+ this.removeMessageFromSource(new WebInspector.SourceFrameMessage(m.text(), WebInspector.SourceFrameMessage.Level[m.kind()], m.location()));
+ },
+
commitEditing: function()
{
if (!this._uiSourceCode.isDirty())

Powered by Google App Engine
This is Rietveld 408576698