| Index: third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
|
| index 48354f756e624bb11e4b2ffd96d457be79e49264..0cd305ef20f5d46a3e57faff9d782d2f21ccc2d5 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/source_frame/UISourceCodeFrame.js
|
| @@ -39,7 +39,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
|
| this.setEditable(this._canEditSource());
|
|
|
| if (Runtime.experiments.isEnabled('sourceDiff'))
|
| - this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(), uiSourceCode, this.textEditor);
|
| + this._diff = new SourceFrame.SourceCodeDiff(WorkspaceDiff.workspaceDiff(), this.textEditor);
|
|
|
|
|
| /** @type {?UI.AutocompleteConfig} */
|
| @@ -72,6 +72,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
|
| () => UI.context.setFlavor(SourceFrame.UISourceCodeFrame, this));
|
|
|
| this._updateStyle();
|
| + this._updateDiffUISourceCode();
|
|
|
| this._errorPopoverHelper = new UI.PopoverHelper(this.element);
|
| this._errorPopoverHelper.initializeCallbacks(this._getErrorAnchor.bind(this), this._showErrorPopover.bind(this));
|
| @@ -238,6 +239,7 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
|
| this._installMessageAndDecorationListeners();
|
| this._updateStyle();
|
| this._decorateAllTypes();
|
| + this._updateDiffUISourceCode();
|
| this.onBindingChanged();
|
| }
|
|
|
| @@ -248,6 +250,17 @@ SourceFrame.UISourceCodeFrame = class extends SourceFrame.SourceFrame {
|
| // Overriden in subclasses.
|
| }
|
|
|
| + _updateDiffUISourceCode() {
|
| + if (!this._diff)
|
| + return;
|
| + if (this._persistenceBinding)
|
| + this._diff.setUISourceCode(this._persistenceBinding.network);
|
| + else if (this._uiSourceCode.project().type() === Workspace.projectTypes.Network)
|
| + this._diff.setUISourceCode(this._uiSourceCode);
|
| + else
|
| + this._diff.setUISourceCode(null);
|
| + }
|
| +
|
| _updateStyle() {
|
| this.element.classList.toggle(
|
| 'source-frame-unsaved-committed-changes',
|
|
|