Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| index 8b6730246bfd24ec7e530708cf48f232c02e88e4..5ef29d5014453ee66888e7c815bc44e9a77917c2 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js |
| @@ -1118,6 +1118,32 @@ WebInspector.CodeMirrorTextEditor.prototype = { |
| /** |
| * @param {number} lineNumber |
| + * @param {string} text |
| + * @param {number} intensity |
| + */ |
| + addProfileInfo: function(lineNumber, text, intensity) |
| + { |
| + if (!this._hasProfileInfo) |
| + this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers", "CodeMirror-profile-info"]); |
|
lushnikov
2016/03/02 03:19:12
isn't refresh needed here as well?
alph
2016/03/02 18:34:34
It works without it, but I'll add one to be on the
|
| + this._hasProfileInfo = true; |
| + var testElement = createElementWithClass("div", "CodeMirror-profile-line-info"); |
| + testElement.textContent = text; |
| + testElement.style.backgroundColor = `rgba(255, 0, 0, ${intensity.toFixed(3)})`; |
|
lushnikov
2016/03/02 03:19:12
yay, fancy strings!
|
| + this._codeMirror.setGutterMarker(lineNumber, "CodeMirror-profile-info", testElement); |
| + }, |
| + |
| + resetProfileInfo: function() |
| + { |
| + if (!this._hasProfileInfo) |
| + return; |
| + this._hasProfileInfo = false; |
| + this._codeMirror.clearGutter("CodeMirror-profile-info"); |
| + this._codeMirror.setOption("gutters", ["CodeMirror-linenumbers"]); |
| + this._codeMirror.refresh(); |
| + }, |
| + |
| + /** |
| + * @param {number} lineNumber |
| * @param {number} columnNumber |
| */ |
| setExecutionLocation: function(lineNumber, columnNumber) |