Chromium Code Reviews| 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 df56d748899a2be33b825c6110a4fb8679790baa..005f6d481338e5f33111aaa57d8de31c132cd1c8 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js |
| @@ -41,6 +41,7 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode) |
| 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._uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.LineMarkersChanged, this._updateMarkerDecorations, this); |
| this._updateStyle(); |
| this._errorPopoverHelper = new WebInspector.PopoverHelper(this.element, this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this)); |
| @@ -118,6 +119,7 @@ WebInspector.UISourceCodeFrame.prototype = { |
| WebInspector.SourceFrame.prototype.onTextEditorContentLoaded.call(this); |
| for (var message of this._uiSourceCode.messages()) |
| this._addMessageToSource(message); |
| + this._updateMarkerDecorations(); |
| }, |
| /** |
| @@ -330,6 +332,21 @@ WebInspector.UISourceCodeFrame.prototype = { |
| } |
| }, |
| + _updateMarkerDecorations: function() |
| + { |
| + this._textEditor.removeAllLineMarkers(); |
|
pfeldman
2016/03/02 19:48:59
Should we make this granular?
then you would go o
alph
2016/03/03 02:02:52
Done.
|
| + var lineMarkers = this._uiSourceCode.lineMarkers(); |
| + if (!lineMarkers) |
| + return; |
| + for (var marker of lineMarkers) { |
| + var lineNumber = marker.line(); |
| + var element = createElementWithClass("div", "text-editor-line-marker"); |
| + element.textContent = marker.text(); |
| + element.style.backgroundColor = marker.color(); |
| + this._textEditor.addLineMarker(lineNumber, element); |
| + } |
| + }, |
| + |
| __proto__: WebInspector.SourceFrame.prototype |
| } |