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

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

Issue 2149203003: DevTools: WI.SourceCodeDiff should not depend on UISourceCode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 923ed29b5fc9142044c231b61d548a24be09ea3b..d64bda0828e8e37930f46405fa17d64f47e52206 100644
--- a/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
+++ b/third_party/WebKit/Source/devtools/front_end/sources/UISourceCodeFrame.js
@@ -37,7 +37,7 @@ WebInspector.UISourceCodeFrame = function(uiSourceCode)
WebInspector.SourceFrame.call(this, uiSourceCode.contentURL(), workingCopy);
if (Runtime.experiments.isEnabled("sourceDiff"))
- this._diff = new WebInspector.SourceCodeDiff(uiSourceCode, this.textEditor);
+ this._diff = new WebInspector.SourceCodeDiff(uiSourceCode.requestOriginalContent(), this.textEditor);
this.textEditor.setAutocompleteDelegate(new WebInspector.SimpleAutocompleteDelegate());
this._rowMessageBuckets = {};
@@ -133,6 +133,8 @@ WebInspector.UISourceCodeFrame.prototype = {
*/
onTextEditorContentLoaded: function()
{
+ if (this._diff)
+ this._diff.updateDiffMarkersImmediately();
WebInspector.SourceFrame.prototype.onTextEditorContentLoaded.call(this);
for (var message of this._uiSourceCode.messages())
this._addMessageToSource(message);
@@ -146,6 +148,8 @@ WebInspector.UISourceCodeFrame.prototype = {
*/
onTextChanged: function(oldRange, newRange)
{
+ if (this._diff)
+ this._diff.updateDiffMarkersWhenPossible();
WebInspector.SourceFrame.prototype.onTextChanged.call(this, oldRange, newRange);
this._clearMessages();
if (this._isSettingContent)
@@ -163,8 +167,6 @@ WebInspector.UISourceCodeFrame.prototype = {
*/
_onWorkingCopyChanged: function(event)
{
- if (this._diff)
- this._diff.updateDiffMarkersWhenPossible();
if (this._muteSourceCodeEvents)
return;
this._innerSetContent(this._uiSourceCode.workingCopy());
@@ -182,8 +184,6 @@ WebInspector.UISourceCodeFrame.prototype = {
}
this._textEditor.markClean();
this._updateStyle();
- if (this._diff)
- this._diff.updateDiffMarkersWhenPossible();
},
_updateStyle: function()
@@ -204,7 +204,6 @@ WebInspector.UISourceCodeFrame.prototype = {
if (this._diff) {
var oldContent = this._textEditor.text();
this.setContent(content);
- this._diff.updateDiffMarkersImmediately();
this._diff.highlightModifiedLines(oldContent, content);
} else {
this.setContent(content);
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/sources/SourceCodeDiff.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698